This repository has been archived by the owner on Feb 26, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 263
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bug 1116004 - include test-page-worker in e10s-content test addon
- Loading branch information
Showing
5 changed files
with
580 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"]); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.