Bug 1551744 move webnavigation modules to extensions component r=kmag
authorShane Caraveo <scaraveo@mozilla.com>
Wed, 15 May 2019 00:17:25 +0000
changeset 532705 294fb9eba22edda7dd2f8c3691364eb8b6a2a2d0
parent 532704 9d42cbab5277796bf76e874bdc4fe3eaaad99889
child 532706 28b9af9efee6a0317e21fa3a1971f039f53a25ed
push id11270
push userrgurzau@mozilla.com
push dateWed, 15 May 2019 15:07:19 +0000
treeherdermozilla-beta@571bc76da583 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskmag
bugs1551744
milestone68.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1551744 move webnavigation modules to extensions component r=kmag Differential Revision: https://phabricator.services.mozilla.com/D31167
toolkit/components/extensions/MatchURLFilters.jsm
toolkit/components/extensions/WebNavigation.jsm
toolkit/components/extensions/WebNavigationContent.js
toolkit/components/extensions/WebNavigationFrames.jsm
toolkit/components/extensions/moz.build
toolkit/modules/addons/.eslintrc.js
toolkit/modules/addons/MatchURLFilters.jsm
toolkit/modules/addons/WebNavigation.jsm
toolkit/modules/addons/WebNavigationContent.js
toolkit/modules/addons/WebNavigationFrames.jsm
toolkit/modules/moz.build
toolkit/modules/tests/browser/browser.ini
toolkit/modules/tests/browser/browser_WebNavigation.js
toolkit/modules/tests/browser/file_WebNavigation_page1.html
toolkit/modules/tests/browser/file_WebNavigation_page2.html
toolkit/modules/tests/browser/file_WebNavigation_page3.html
rename from toolkit/modules/addons/MatchURLFilters.jsm
rename to toolkit/components/extensions/MatchURLFilters.jsm
rename from toolkit/modules/addons/WebNavigation.jsm
rename to toolkit/components/extensions/WebNavigation.jsm
rename from toolkit/modules/addons/WebNavigationContent.js
rename to toolkit/components/extensions/WebNavigationContent.js
rename from toolkit/modules/addons/WebNavigationFrames.jsm
rename to toolkit/components/extensions/WebNavigationFrames.jsm
--- a/toolkit/components/extensions/moz.build
+++ b/toolkit/components/extensions/moz.build
@@ -22,23 +22,27 @@ EXTRA_JS_MODULES += [
     'ExtensionSettingsStore.jsm',
     'ExtensionShortcuts.jsm',
     'ExtensionStorage.jsm',
     'ExtensionStorageIDB.jsm',
     'ExtensionStorageSync.jsm',
     'ExtensionTelemetry.jsm',
     'ExtensionUtils.jsm',
     'FindContent.jsm',
+    'MatchURLFilters.jsm',
     'MessageChannel.jsm',
     'MessageManagerProxy.jsm',
     'NativeManifests.jsm',
     'NativeMessaging.jsm',
     'PerformanceCounters.jsm',
     'ProxyScriptContext.jsm',
     'Schemas.jsm',
+    'WebNavigation.jsm',
+    'WebNavigationContent.js',
+    'WebNavigationFrames.jsm',
 ]
 
 if CONFIG['MOZ_WIDGET_TOOLKIT'] != "android":
     EXTRA_JS_MODULES += [
         'profiler_get_symbols.js',
         'ProfilerGetSymbols-worker.js',
         'ProfilerGetSymbols.jsm',
     ]
deleted file mode 100644
--- a/toolkit/modules/addons/.eslintrc.js
+++ /dev/null
@@ -1,5 +0,0 @@
-"use strict";
-
-module.exports = {
-  "extends": "../../components/extensions/.eslintrc.js",
-};
--- a/toolkit/modules/moz.build
+++ b/toolkit/modules/moz.build
@@ -4,19 +4,16 @@
 # 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/.
 
 include('../components/telemetry/telemetry-constants.mozbuild')
 
 with Files('**'):
     BUG_COMPONENT = ('Toolkit', 'General')
 
-with Files('addons/**'):
-    BUG_COMPONENT = ('WebExtensions', 'General')
-
 with Files('docs/**'):
     BUG_COMPONENT = ('Toolkit', 'Async Tooling')
 
 with Files('subprocess/**'):
     BUG_COMPONENT = ('Toolkit', 'Async Tooling')
 
 with Files('tests/browser/*AsyncPrefs*'):
     BUG_COMPONENT = ('Core', 'Security: Process Sandboxing')
@@ -162,20 +159,16 @@ SPHINX_TREES['toolkit_modules'] = 'docs'
 with Files('docs/**'):
     SCHEDULES.exclusive = ['docs']
 
 EXTRA_JS_MODULES += [
     'AboutPagesUtils.jsm',
     'ActorChild.jsm',
     'ActorManagerChild.jsm',
     'ActorManagerParent.jsm',
-    'addons/MatchURLFilters.jsm',
-    'addons/WebNavigation.jsm',
-    'addons/WebNavigationContent.js',
-    'addons/WebNavigationFrames.jsm',
     'AppMenuNotifications.jsm',
     'AsyncPrefs.jsm',
     'AutoCompletePopupContent.jsm',
     'AutoScrollController.jsm',
     'BinarySearch.jsm',
     'BrowserUtils.jsm',
     'CanonicalJSON.jsm',
     'CertUtils.jsm',
--- a/toolkit/modules/tests/browser/browser.ini
+++ b/toolkit/modules/tests/browser/browser.ini
@@ -1,15 +1,12 @@
 [DEFAULT]
 support-files =
   file_FinderIframeTest.html
   file_FinderSample.html
-  file_WebNavigation_page1.html
-  file_WebNavigation_page2.html
-  file_WebNavigation_page3.html
   file_getSelectionDetails_inputs.html
   head.js
 
 [browser_AsyncPrefs.js]
 [browser_BrowserUtils.js]
 [browser_CreditCard.js]
 [browser_Deprecated.js]
 [browser_Finder.js]
@@ -23,12 +20,10 @@ skip-if = (verify && debug && (os == 'ma
 [browser_Finder_skip_invisible_and_option.js]
 [browser_Finder_vertical_text.js]
 [browser_FinderHighlighter.js]
 skip-if = debug || os = "linux"
 [browser_FinderHighlighter2.js]
 skip-if = debug || os = "linux"
 [browser_Geometry.js]
 [browser_InlineSpellChecker.js]
-[browser_WebNavigation.js]
-skip-if = true # Superseded by WebExtension tests
 [browser_PromiseMessage.js]
 [browser_Troubleshoot.js]
deleted file mode 100644
--- a/toolkit/modules/tests/browser/browser_WebNavigation.js
+++ /dev/null
@@ -1,136 +0,0 @@
-"use strict";
-
-var {WebNavigation} = ChromeUtils.import("resource://gre/modules/WebNavigation.jsm");
-
-const BASE = "http://example.com/browser/toolkit/modules/tests/browser";
-const URL = BASE + "/file_WebNavigation_page1.html";
-const FRAME = BASE + "/file_WebNavigation_page2.html";
-const FRAME2 = BASE + "/file_WebNavigation_page3.html";
-
-const EVENTS = [
-  "onBeforeNavigate",
-  "onCommitted",
-  "onDOMContentLoaded",
-  "onCompleted",
-  "onErrorOccurred",
-  "onReferenceFragmentUpdated",
-];
-
-const REQUIRED = [
-  "onBeforeNavigate",
-  "onCommitted",
-  "onDOMContentLoaded",
-  "onCompleted",
-];
-
-var expectedBrowser;
-var received = [];
-var completedResolve;
-var waitingURL, waitingEvent;
-var rootWindowID;
-
-function gotEvent(event, details) {
-  if (!details.url.startsWith(BASE)) {
-    return;
-  }
-  info(`Got ${event} ${details.url} ${details.windowId} ${details.parentWindowId}`);
-
-  is(details.browser, expectedBrowser, "correct <browser> element");
-
-  received.push({url: details.url, event});
-
-  if (typeof(rootWindowID) == "undefined") {
-    rootWindowID = details.windowId;
-  }
-
-  if (details.url == URL) {
-    is(details.windowId, rootWindowID, "root window ID correct");
-  } else {
-    is(details.parentWindowId, rootWindowID, "parent window ID correct");
-    isnot(details.windowId, rootWindowID, "window ID probably okay");
-  }
-
-  isnot(details.windowId, undefined);
-  isnot(details.parentWindowId, undefined);
-
-  if (details.url == waitingURL && event == waitingEvent) {
-    completedResolve();
-  }
-}
-
-function loadViaFrameScript(url, event, script) {
-  // Loading via a frame script ensures that the chrome process never
-  // "gets ahead" of frame scripts in non-e10s mode.
-  received = [];
-  waitingURL = url;
-  waitingEvent = event;
-  expectedBrowser.messageManager.loadFrameScript("data:," + script, false);
-  return new Promise(resolve => { completedResolve = resolve; });
-}
-
-add_task(async function webnav_ordering() {
-  let listeners = {};
-  for (let event of EVENTS) {
-    listeners[event] = gotEvent.bind(null, event);
-    WebNavigation[event].addListener(listeners[event]);
-  }
-
-  gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser);
-  let browser = gBrowser.selectedBrowser;
-  expectedBrowser = browser;
-
-  await BrowserTestUtils.browserLoaded(browser);
-
-  await loadViaFrameScript(URL, "onCompleted", `content.location = "${URL}";`);
-
-  function checkRequired(url) {
-    for (let event of REQUIRED) {
-      let found = false;
-      for (let r of received) {
-        if (r.url == url && r.event == event) {
-          found = true;
-        }
-      }
-      ok(found, `Received event ${event} from ${url}`);
-    }
-  }
-
-  checkRequired(URL);
-  checkRequired(FRAME);
-
-  function checkBefore(action1, action2) {
-    function find(action) {
-      for (let i = 0; i < received.length; i++) {
-        if (received[i].url == action.url && received[i].event == action.event) {
-          return i;
-        }
-      }
-      return -1;
-    }
-
-    let index1 = find(action1);
-    let index2 = find(action2);
-    ok(index1 != -1, `Action ${JSON.stringify(action1)} happened`);
-    ok(index2 != -1, `Action ${JSON.stringify(action2)} happened`);
-    ok(index1 < index2, `Action ${JSON.stringify(action1)} happened before ${JSON.stringify(action2)}`);
-  }
-
-  checkBefore({url: URL, event: "onCommitted"}, {url: FRAME, event: "onBeforeNavigate"});
-  checkBefore({url: FRAME, event: "onCompleted"}, {url: URL, event: "onCompleted"});
-
-  await loadViaFrameScript(FRAME2, "onCompleted", `content.frames[0].location = "${FRAME2}";`);
-
-  checkRequired(FRAME2);
-
-  await loadViaFrameScript(FRAME2 + "#ref", "onReferenceFragmentUpdated",
-                           "content.frames[0].document.getElementById('elt').click();");
-
-  info("Received onReferenceFragmentUpdated from FRAME2");
-
-  gBrowser.removeCurrentTab();
-
-  for (let event of EVENTS) {
-    WebNavigation[event].removeListener(listeners[event]);
-  }
-});
-
deleted file mode 100644
--- a/toolkit/modules/tests/browser/file_WebNavigation_page1.html
+++ /dev/null
@@ -1,9 +0,0 @@
-<!DOCTYPE HTML>
-
-<html>
-<body>
-
-<iframe src="file_WebNavigation_page2.html" width="200" height="200"></iframe>
-
-</body>
-</html>
deleted file mode 100644
--- a/toolkit/modules/tests/browser/file_WebNavigation_page2.html
+++ /dev/null
@@ -1,7 +0,0 @@
-<!DOCTYPE HTML>
-
-<html>
-<body>
-
-</body>
-</html>
deleted file mode 100644
--- a/toolkit/modules/tests/browser/file_WebNavigation_page3.html
+++ /dev/null
@@ -1,9 +0,0 @@
-<!DOCTYPE HTML>
-
-<html>
-<body>
-
-<a id="elt" href="file_WebNavigation_page3.html#ref">click me</a>
-
-</body>
-</html>