Skip to content
This repository has been archived by the owner on Feb 26, 2022. It is now read-only.

Commit

Permalink
bug 1116004 - include test-page-worker in e10s-content test addon
Browse files Browse the repository at this point in the history
  • Loading branch information
zombie committed Dec 28, 2014
1 parent 43014b2 commit b05a1c4
Show file tree
Hide file tree
Showing 5 changed files with 580 additions and 0 deletions.
13 changes: 13 additions & 0 deletions test/addons/e10s-content/data/test-page-worker.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->

<html>
<head>
<meta charset="UTF-8">
<title>Page Worker test</title>
</head>
<body>
<p id="paragraph">Lorem ipsum dolor sit amet.</p>
</body>
</html>
29 changes: 29 additions & 0 deletions test/addons/e10s-content/data/test-page-worker.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */


// get title directly
self.postMessage(["equal", document.title, "Page Worker test",
"Correct page title accessed directly"]);

// get <p> directly
let p = document.getElementById("paragraph");
self.postMessage(["ok", !!p, "<p> can be accessed directly"]);
self.postMessage(["equal", p.firstChild.nodeValue,
"Lorem ipsum dolor sit amet.",
"Correct text node expected"]);

// Modify page
let div = document.createElement("div");
div.setAttribute("id", "block");
div.appendChild(document.createTextNode("Test text created"));
document.body.appendChild(div);

// Check back the modification
div = document.getElementById("block");
self.postMessage(["ok", !!div, "<div> can be accessed directly"]);
self.postMessage(["equal", div.firstChild.nodeValue,
"Test text created", "Correct text node expected"]);
self.postMessage(["done"]);

13 changes: 13 additions & 0 deletions test/addons/e10s-content/data/test.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->

<html>
<head>
<meta charset="UTF-8">
<title>foo</title>
</head>
<body>
<p>bar</p>
</body>
</html>
1 change: 1 addition & 0 deletions test/addons/e10s-content/lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const SKIPPING_TESTS = {
};

merge(module.exports, require('./test-content-worker'));
merge(module.exports, require('./test-page-worker'));

// run e10s tests only on builds from trunk, fx-team, Nightly..
if (!version.endsWith('a1')) {
Expand Down
Loading

0 comments on commit b05a1c4

Please sign in to comment.