diff -r 000000000000 -r 6474c204b198 addon-sdk/source/test/fixtures/test-page-worker.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/addon-sdk/source/test/fixtures/test-page-worker.js Wed Dec 31 06:09:35 2014 +0100 @@ -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
directly +let p = document.getElementById("paragraph"); +self.postMessage(["ok", !!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, "