Bug 1206921 Remove obsolete test r=kmag

Differential Revision: https://phabricator.services.mozilla.com/D13480

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Andrew Swan 2018-11-30 02:41:12 +00:00
Родитель 119fd6e9b9
Коммит 77ae2284a6
3 изменённых файлов: 0 добавлений и 137 удалений

Двоичный файл не отображается.

Просмотреть файл

@ -1,8 +1,5 @@
[DEFAULT]
support-files =
file_empty.html
file_bug687194.xpi
[test_bug687194.html]
skip-if = e10s || os == "android" # this test creates its own child process, no need to run it in e10s
[test_bug887098.html]

Просмотреть файл

@ -1,134 +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">
"use strict";
SimpleTest.waitForExplicitFinish();
const childFrameURL =
"data:text/html,<!DOCTYPE HTML><html><body></body></html>";
function childFrameScript() {
"use strict";
/* global Ci, Cu, addMessageListener */
ChromeUtils.import("resource://gre/modules/Services.jsm");
let cr =
Cc["@mozilla.org/chrome/chrome-registry;1"]
.getService(Ci.nsIXULChromeRegistry);
addMessageListener("test687194:resolveChromeURI", function(message) {
let result;
let threw = false;
try {
let uri = Services.io.newURI(message.data.URI);
result = cr.convertChromeURL(uri).spec;
} catch (e) {
threw = true;
result = "EXCEPTION: " + e;
}
message.target.sendAsyncMessage("test687194:resolveChromeURI:Answer",
{ threw, result });
});
}
let test;
async function* testStructure(mm) {
let lastResult;
mm.addMessageListener("test687194:resolveChromeURI:Answer", SpecialPowers.wrapCallback(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";
let install = await AddonManager.getInstallForURL(INSTALL_URI, "application/x-xpinstall");
install = SpecialPowers.wrap(install);
install.addListener(SpecialPowers.wrapCallbackObject({
/* eslint no-shadow: 0 */
onInstallEnded(install, addon) {
SimpleTest.executeSoon(() => test.next(addon));
},
}));
install.install();
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(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>