summaryrefslogtreecommitdiffstats
path: root/toolkit/components/remotebrowserutils
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/remotebrowserutils
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/remotebrowserutils')
-rw-r--r--toolkit/components/remotebrowserutils/moz.build2
-rw-r--r--toolkit/components/remotebrowserutils/tests/browser/.eslintrc.js7
-rw-r--r--toolkit/components/remotebrowserutils/tests/browser/browser.ini6
-rw-r--r--toolkit/components/remotebrowserutils/tests/browser/browser_RemoteWebNavigation.js156
-rw-r--r--toolkit/components/remotebrowserutils/tests/browser/dummy_page.html7
5 files changed, 0 insertions, 178 deletions
diff --git a/toolkit/components/remotebrowserutils/moz.build b/toolkit/components/remotebrowserutils/moz.build
index 9cfc4a976..47ee6a483 100644
--- a/toolkit/components/remotebrowserutils/moz.build
+++ b/toolkit/components/remotebrowserutils/moz.build
@@ -8,5 +8,3 @@ EXTRA_COMPONENTS += [
'remotebrowserutils.manifest',
'RemoteWebNavigation.js',
]
-
-BROWSER_CHROME_MANIFESTS += ['tests/browser/browser.ini']
diff --git a/toolkit/components/remotebrowserutils/tests/browser/.eslintrc.js b/toolkit/components/remotebrowserutils/tests/browser/.eslintrc.js
deleted file mode 100644
index 7c8021192..000000000
--- a/toolkit/components/remotebrowserutils/tests/browser/.eslintrc.js
+++ /dev/null
@@ -1,7 +0,0 @@
-"use strict";
-
-module.exports = {
- "extends": [
- "../../../../../testing/mochitest/browser.eslintrc.js"
- ]
-};
diff --git a/toolkit/components/remotebrowserutils/tests/browser/browser.ini b/toolkit/components/remotebrowserutils/tests/browser/browser.ini
deleted file mode 100644
index 916d0f9cb..000000000
--- a/toolkit/components/remotebrowserutils/tests/browser/browser.ini
+++ /dev/null
@@ -1,6 +0,0 @@
-[DEFAULT]
-run-if = e10s
-support-files =
- dummy_page.html
-
-[browser_RemoteWebNavigation.js]
diff --git a/toolkit/components/remotebrowserutils/tests/browser/browser_RemoteWebNavigation.js b/toolkit/components/remotebrowserutils/tests/browser/browser_RemoteWebNavigation.js
deleted file mode 100644
index 106758e81..000000000
--- a/toolkit/components/remotebrowserutils/tests/browser/browser_RemoteWebNavigation.js
+++ /dev/null
@@ -1,156 +0,0 @@
-/* eslint-env mozilla/frame-script */
-
-const DUMMY1 = "http://example.com/browser/toolkit/modules/tests/browser/dummy_page.html";
-const DUMMY2 = "http://example.org/browser/toolkit/modules/tests/browser/dummy_page.html"
-
-function waitForLoad(uri) {
- return BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser, false, uri);
-}
-
-function waitForPageShow(browser = gBrowser.selectedBrowser) {
- return BrowserTestUtils.waitForContentEvent(browser, "pageshow", true);
-}
-
-function makeURI(url) {
- return Cc["@mozilla.org/network/io-service;1"].
- getService(Ci.nsIIOService).
- newURI(url, null, null);
-}
-
-// Tests that loadURI accepts a referrer and it is included in the load.
-add_task(function* test_referrer() {
- gBrowser.selectedTab = gBrowser.addTab();
- let browser = gBrowser.selectedBrowser;
-
- browser.webNavigation.loadURI(DUMMY1,
- Ci.nsIWebNavigation.LOAD_FLAGS_NONE,
- makeURI(DUMMY2),
- null, null);
- yield waitForLoad(DUMMY1);
-
- yield ContentTask.spawn(browser, [ DUMMY1, DUMMY2 ], function([dummy1, dummy2]) {
- is(content.location.href, dummy1, "Should have loaded the right URL");
- is(content.document.referrer, dummy2, "Should have the right referrer");
- });
-
- gBrowser.removeCurrentTab();
-});
-
-// Tests that remote access to webnavigation.sessionHistory works.
-add_task(function* test_history() {
- function checkHistoryIndex(browser, n) {
- return ContentTask.spawn(browser, n, function(n) {
- let history = docShell.QueryInterface(Ci.nsIInterfaceRequestor)
- .getInterface(Ci.nsISHistory);
- is(history.index, n, "Should be at the right place in history");
- });
- }
- gBrowser.selectedTab = gBrowser.addTab();
- let browser = gBrowser.selectedBrowser;
-
- browser.webNavigation.loadURI(DUMMY1,
- Ci.nsIWebNavigation.LOAD_FLAGS_NONE,
- null, null, null);
- yield waitForLoad(DUMMY1);
-
- browser.webNavigation.loadURI(DUMMY2,
- Ci.nsIWebNavigation.LOAD_FLAGS_NONE,
- null, null, null);
- yield waitForLoad(DUMMY2);
-
- yield ContentTask.spawn(browser, [DUMMY1, DUMMY2], function([dummy1, dummy2]) {
- let history = docShell.QueryInterface(Ci.nsIInterfaceRequestor)
- .getInterface(Ci.nsISHistory);
- is(history.count, 2, "Should be two history items");
- is(history.index, 1, "Should be at the right place in history");
- let entry = history.getEntryAtIndex(0, false);
- is(entry.URI.spec, dummy1, "Should have the right history entry");
- entry = history.getEntryAtIndex(1, false);
- is(entry.URI.spec, dummy2, "Should have the right history entry");
- });
-
- let promise = waitForPageShow();
- browser.webNavigation.goBack();
- yield promise;
- yield checkHistoryIndex(browser, 0);
-
- promise = waitForPageShow();
- browser.webNavigation.goForward();
- yield promise;
- yield checkHistoryIndex(browser, 1);
-
- promise = waitForPageShow();
- browser.webNavigation.gotoIndex(0);
- yield promise;
- yield checkHistoryIndex(browser, 0);
-
- gBrowser.removeCurrentTab();
-});
-
-// Tests that load flags are passed through to the content process.
-add_task(function* test_flags() {
- function checkHistory(browser, { count, index }) {
- return ContentTask.spawn(browser, [ DUMMY2, count, index ],
- function([ dummy2, count, index ]) {
- let history = docShell.QueryInterface(Ci.nsIInterfaceRequestor)
- .getInterface(Ci.nsISHistory);
- is(history.count, count, "Should be one history item");
- is(history.index, index, "Should be at the right place in history");
- let entry = history.getEntryAtIndex(index, false);
- is(entry.URI.spec, dummy2, "Should have the right history entry");
- });
- }
-
- gBrowser.selectedTab = gBrowser.addTab();
- let browser = gBrowser.selectedBrowser;
-
- browser.webNavigation.loadURI(DUMMY1,
- Ci.nsIWebNavigation.LOAD_FLAGS_NONE,
- null, null, null);
- yield waitForLoad(DUMMY1);
-
- browser.webNavigation.loadURI(DUMMY2,
- Ci.nsIWebNavigation.LOAD_FLAGS_REPLACE_HISTORY,
- null, null, null);
- yield waitForLoad(DUMMY2);
- yield checkHistory(browser, { count: 1, index: 0 });
-
- browser.webNavigation.loadURI(DUMMY1,
- Ci.nsIWebNavigation.LOAD_FLAGS_BYPASS_HISTORY,
- null, null, null);
- yield waitForLoad(DUMMY1);
- yield checkHistory(browser, { count: 1, index: 0 });
-
- gBrowser.removeCurrentTab();
-});
-
-// Tests that attempts to use unsupported arguments throw an exception.
-add_task(function* test_badarguments() {
- if (!gMultiProcessBrowser)
- return;
-
- gBrowser.selectedTab = gBrowser.addTab();
- let browser = gBrowser.selectedBrowser;
-
- try {
- browser.webNavigation.loadURI(DUMMY1,
- Ci.nsIWebNavigation.LOAD_FLAGS_NONE,
- null, {}, null);
- ok(false, "Should have seen an exception from trying to pass some postdata");
- }
- catch (e) {
- ok(true, "Should have seen an exception from trying to pass some postdata");
- }
-
- try {
- browser.webNavigation.loadURI(DUMMY1,
- Ci.nsIWebNavigation.LOAD_FLAGS_NONE,
- null, null, {});
- ok(false, "Should have seen an exception from trying to pass some headers");
- }
- catch (e) {
- ok(true, "Should have seen an exception from trying to pass some headers");
- }
-
- gBrowser.removeCurrentTab();
-});
diff --git a/toolkit/components/remotebrowserutils/tests/browser/dummy_page.html b/toolkit/components/remotebrowserutils/tests/browser/dummy_page.html
deleted file mode 100644
index c1c9a4e04..000000000
--- a/toolkit/components/remotebrowserutils/tests/browser/dummy_page.html
+++ /dev/null
@@ -1,7 +0,0 @@
-<!DOCTYPE html>
-
-<html>
-<body>
-<p>Page</p>
-</body>
-</html>