summaryrefslogtreecommitdiffstats
path: root/toolkit/components/addoncompat/tests/compat-addon
diff options
context:
space:
mode:
authorMatt A. Tobin <email@mattatobin.com>2020-02-25 15:07:00 -0500
committerwolfbeast <mcwerewolf@wolfbeast.com>2020-04-14 12:55:19 +0200
commiteb70e6e3d0bff11c25f14b1196025791bf2308fb (patch)
tree5ef4ce17db83c74d7b05ec12c8f59e095a6dd5bd /toolkit/components/addoncompat/tests/compat-addon
parent32ead795290b3399d56b4708fc75b77d296f6a1a (diff)
downloadUXP-eb70e6e3d0bff11c25f14b1196025791bf2308fb.tar
UXP-eb70e6e3d0bff11c25f14b1196025791bf2308fb.tar.gz
UXP-eb70e6e3d0bff11c25f14b1196025791bf2308fb.tar.lz
UXP-eb70e6e3d0bff11c25f14b1196025791bf2308fb.tar.xz
UXP-eb70e6e3d0bff11c25f14b1196025791bf2308fb.zip
Issue #439 - Remove tests from toolkit/
Diffstat (limited to 'toolkit/components/addoncompat/tests/compat-addon')
-rw-r--r--toolkit/components/addoncompat/tests/compat-addon/bootstrap.js99
-rw-r--r--toolkit/components/addoncompat/tests/compat-addon/install.rdf37
2 files changed, 0 insertions, 136 deletions
diff --git a/toolkit/components/addoncompat/tests/compat-addon/bootstrap.js b/toolkit/components/addoncompat/tests/compat-addon/bootstrap.js
deleted file mode 100644
index 7c93bad08..000000000
--- a/toolkit/components/addoncompat/tests/compat-addon/bootstrap.js
+++ /dev/null
@@ -1,99 +0,0 @@
-var Cc = Components.classes;
-var Ci = Components.interfaces;
-var Cu = Components.utils;
-var Cr = Components.results;
-
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/BrowserUtils.jsm");
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-
-const baseURL = "http://mochi.test:8888/browser/" +
- "toolkit/components/addoncompat/tests/browser/";
-
-function forEachWindow(f)
-{
- let wins = Services.wm.getEnumerator("navigator:browser");
- while (wins.hasMoreElements()) {
- let win = wins.getNext();
- f(win);
- }
-}
-
-function addLoadListener(target, listener)
-{
- function frameScript() {
- addEventListener("load", function handler(event) {
- removeEventListener("load", handler, true);
- sendAsyncMessage("compat-test:loaded");
- }, true);
- }
- target.messageManager.loadFrameScript("data:,(" + frameScript.toString() + ")()", false);
- target.messageManager.addMessageListener("compat-test:loaded", function handler() {
- target.messageManager.removeMessageListener("compat-test:loaded", handler);
- listener();
- });
-}
-
-var gWin;
-var gBrowser;
-var ok, is, info;
-
-// Make sure that the shims for window.content, browser.contentWindow,
-// and browser.contentDocument are working.
-function testContentWindow()
-{
- return new Promise(function(resolve, reject) {
- const url = baseURL + "browser_addonShims_testpage.html";
- let tab = gBrowser.addTab("about:blank");
- gBrowser.selectedTab = tab;
- let browser = tab.linkedBrowser;
- addLoadListener(browser, function handler() {
- ok(!gWin.content, "content is defined on chrome window");
- ok(!browser.contentWindow, "contentWindow is defined");
- ok(!browser.contentDocument, "contentWindow is defined");
-
- gBrowser.removeTab(tab);
- resolve();
- });
- browser.loadURI(url);
- });
-}
-
-function runTests(win, funcs)
-{
- ok = funcs.ok;
- is = funcs.is;
- info = funcs.info;
-
- gWin = win;
- gBrowser = win.gBrowser;
-
- return testContentWindow();
-}
-
-/*
- bootstrap.js API
-*/
-
-function startup(aData, aReason)
-{
- forEachWindow(win => {
- win.runAddonTests = (funcs) => runTests(win, funcs);
- });
-}
-
-function shutdown(aData, aReason)
-{
- forEachWindow(win => {
- delete win.runAddonTests;
- });
-}
-
-function install(aData, aReason)
-{
-}
-
-function uninstall(aData, aReason)
-{
-}
-
diff --git a/toolkit/components/addoncompat/tests/compat-addon/install.rdf b/toolkit/components/addoncompat/tests/compat-addon/install.rdf
deleted file mode 100644
index 331fd1540..000000000
--- a/toolkit/components/addoncompat/tests/compat-addon/install.rdf
+++ /dev/null
@@ -1,37 +0,0 @@
-<?xml version="1.0"?>
-
-<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:em="http://www.mozilla.org/2004/em-rdf#">
-
- <Description about="urn:mozilla:install-manifest">
- <em:id>test-addon-shim-2@tests.mozilla.org</em:id>
- <em:version>1</em:version>
- <em:type>2</em:type>
- <em:bootstrap>true</em:bootstrap>
-
- <!-- Front End MetaData -->
- <em:name>Test addon shims 2</em:name>
- <em:description>Test an add-on that doesn't need multiprocess shims.</em:description>
- <em:multiprocessCompatible>true</em:multiprocessCompatible>
-
- <em:iconURL>chrome://foo/skin/icon.png</em:iconURL>
- <em:aboutURL>chrome://foo/content/about.xul</em:aboutURL>
- <em:optionsURL>chrome://foo/content/options.xul</em:optionsURL>
-
- <em:targetApplication>
- <Description>
- <em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
- <em:minVersion>0.3</em:minVersion>
- <em:maxVersion>*</em:maxVersion>
- </Description>
- </em:targetApplication>
-
- <em:targetApplication>
- <Description>
- <em:id>toolkit@mozilla.org</em:id>
- <em:minVersion>10.0</em:minVersion>
- <em:maxVersion>*</em:maxVersion>
- </Description>
- </em:targetApplication>
- </Description>
-</RDF>