diff options
author | Matt A. Tobin <email@mattatobin.com> | 2018-06-26 16:09:08 -0400 |
---|---|---|
committer | Matt A. Tobin <email@mattatobin.com> | 2018-06-26 16:09:08 -0400 |
commit | eda567b364a06e9e63efb865a6b1c73f1cb5232e (patch) | |
tree | 912ab15d877f733318e2c0394713bca33b830547 /toolkit/mozapps/webextensions/test/mochitest/test_bug687194.html | |
parent | 80eb356d57fc310cdf812cae63de30d6e56c1788 (diff) | |
download | UXP-eda567b364a06e9e63efb865a6b1c73f1cb5232e.tar UXP-eda567b364a06e9e63efb865a6b1c73f1cb5232e.tar.gz UXP-eda567b364a06e9e63efb865a6b1c73f1cb5232e.tar.lz UXP-eda567b364a06e9e63efb865a6b1c73f1cb5232e.tar.xz UXP-eda567b364a06e9e63efb865a6b1c73f1cb5232e.zip |
[AllAM] Remove Mozilla Tests
Diffstat (limited to 'toolkit/mozapps/webextensions/test/mochitest/test_bug687194.html')
-rw-r--r-- | toolkit/mozapps/webextensions/test/mochitest/test_bug687194.html | 133 |
1 files changed, 0 insertions, 133 deletions
diff --git a/toolkit/mozapps/webextensions/test/mochitest/test_bug687194.html b/toolkit/mozapps/webextensions/test/mochitest/test_bug687194.html deleted file mode 100644 index 8f99ea73a..000000000 --- a/toolkit/mozapps/webextensions/test/mochitest/test_bug687194.html +++ /dev/null @@ -1,133 +0,0 @@ -<!DOCTYPE HTML> -<html> -<head> - <title>Test for registering/unregistering chrome OOP</title> - <script type="application/javascript" - src="/tests/SimpleTest/SimpleTest.js"> - </script> - <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> -</head> -<body> - - <script type="application/javascript;version=1.8"> - "use strict"; - - SimpleTest.waitForExplicitFinish(); - - const childFrameURL = - "data:text/html,<!DOCTYPE HTML><html><body></body></html>"; - - function childFrameScript() { - "use strict"; - - var ios = - Components.classes["@mozilla.org/network/io-service;1"] - .getService(Components.interfaces.nsIIOService); - let cr = - Components.classes["@mozilla.org/chrome/chrome-registry;1"] - .getService(Ci.nsIXULChromeRegistry); - addMessageListener("test687194:resolveChromeURI", function(message) { - let result; - let threw = false; - try { - let uri = ios.newURI(message.data.URI, null, null); - result = cr.convertChromeURL(uri).spec; - } catch (e) { - threw = true; - result = "EXCEPTION: " + e; - } - - message.target.sendAsyncMessage("test687194:resolveChromeURI:Answer", - { threw: threw, result: result }); - }); - } - - let test; - function* testStructure(mm) { - let lastResult; - - mm.addMessageListener("test687194:resolveChromeURI:Answer", function(msg) { - test.next(msg.data); - }); - - mm.sendAsyncMessage("test687194:resolveChromeURI", - { URI: "chrome://bug687194/content/e10sbug.js" }); - lastResult = yield; - is(lastResult.threw, true, "URI shouldn't resolve to begin with"); - - let { AddonManager } = SpecialPowers.Cu.import("resource://gre/modules/AddonManager.jsm", {}); - const INSTALL_URI = - "http://mochi.test:8888/tests/toolkit/mozapps/extensions/test/mochitest/file_bug687194.xpi" - AddonManager.getInstallForURL(INSTALL_URI, (install) => { - install = SpecialPowers.wrap(install); - install.addListener(SpecialPowers.wrapCallbackObject({ - onInstallEnded: function(install, addon) { - SimpleTest.executeSoon(() => test.next(addon)); - } - })); - install.install(); - }, "application/x-xpinstall"); - - let addon = SpecialPowers.wrap(yield); - - mm.sendAsyncMessage("test687194:resolveChromeURI", - { URI: "chrome://bug687194/content/e10sbug.js" }); - lastResult = yield; - is(lastResult.threw, false, "able to resolve after the installation"); - - let listener = SpecialPowers.wrapCallbackObject({ - onUninstalled: function(removedAddon) { - if (removedAddon.id === addon.id) { - AddonManager.removeAddonListener(listener); - SimpleTest.executeSoon(() => test.next()); - } - } - }); - AddonManager.addAddonListener(listener); - addon.uninstall(); - - yield; - - mm.sendAsyncMessage("test687194:resolveChromeURI", - { URI: "chrome://bug687194/content/e10sbug.js" }); - lastResult = yield; - is(lastResult.threw, true, "should have unregistered the URI"); - SimpleTest.finish(); - } - - function runTests() { - info("Browser prefs set."); - - let iframe = document.createElement("iframe"); - SpecialPowers.wrap(iframe).mozbrowser = true; - iframe.id = "iframe"; - iframe.src = childFrameURL; - - iframe.addEventListener("mozbrowserloadend", function() { - info("Got iframe load event."); - let mm = SpecialPowers.getBrowserFrameMessageManager(iframe); - mm.loadFrameScript("data:,(" + childFrameScript.toString() + ")();", - false); - - test = testStructure(mm); - test.next(); - }); - - document.body.appendChild(iframe); - } - - addEventListener("load", function() { - info("Got load event."); - - SpecialPowers.addPermission("browser", true, document); - SpecialPowers.pushPrefEnv({ - "set": [ - ["dom.ipc.browser_frames.oop_by_default", true], - ["dom.mozBrowserFramesEnabled", true], - ["browser.pagethumbnails.capturing_disabled", true] - ] - }, runTests); - }); - </script> -</body> -</html> |