Backed out 4 changesets (bug 1543098) for high frequency browser_runtime_executionContext.js failures CLOSED TREE
authorCiure Andrei <aciure@mozilla.com>
Wed, 01 May 2019 14:53:50 +0300
changeset 472067 6843d141c496ade289d5d162532d9fc6d479e78c
parent 472066 99548c52b81f7b1ff00f0fef2eb713911ab4e830
child 472068 092d677f7181521cb8dce8ae7787c1d88645286f
push id35946
push userapavel@mozilla.com
push dateWed, 01 May 2019 15:54:31 +0000
treeherdermozilla-central@a027a998b8b7 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1543098
milestone68.0a1
backs outa414e99fbbc856d82d5cf2561e2df3dd9638b6f2
f5645934c8ecab2ef3eb965fd3818697dcd8e20e
142fc2db9173dff66a413ce64a4d8a2b8a217425
0a13ac4fa9d75c4287bdc7866cffb2d5efe9ab65
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
Backed out 4 changesets (bug 1543098) for high frequency browser_runtime_executionContext.js failures CLOSED TREE Backed out changeset a414e99fbbc8 (bug 1543098) Backed out changeset f5645934c8ec (bug 1543098) Backed out changeset 142fc2db9173 (bug 1543098) Backed out changeset 0a13ac4fa9d7 (bug 1543098)
remote/domains/content/Runtime.jsm
remote/test/browser/browser.ini
remote/test/browser/browser_runtime_executionContext.js
--- a/remote/domains/content/Runtime.jsm
+++ b/remote/domains/content/Runtime.jsm
@@ -2,118 +2,33 @@
  * 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/. */
 
 "use strict";
 
 var EXPORTED_SYMBOLS = ["Runtime"];
 
 const {ContentProcessDomain} = ChromeUtils.import("chrome://remote/content/domains/ContentProcessDomain.jsm");
-const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 class Runtime extends ContentProcessDomain {
   constructor(session) {
     super(session);
     this.enabled = false;
   }
 
   destructor() {
     this.disable();
   }
 
   // commands
 
   async enable() {
     if (!this.enabled) {
       this.enabled = true;
-      this.chromeEventHandler.addEventListener("DOMWindowCreated", this,
-        {mozSystemGroup: true});
-
-      // Listen for pageshow and pagehide to track pages going in/out to/from the BF Cache
-      this.chromeEventHandler.addEventListener("pageshow", this,
-        {mozSystemGroup: true});
-      this.chromeEventHandler.addEventListener("pagehide", this,
-        {mozSystemGroup: true});
-
-      Services.obs.addObserver(this, "inner-window-destroyed");
-
-      // Spin the event loop in order to send the `executionContextCreated` event right
-      // after we replied to `enable` request.
-      Services.tm.dispatchToMainThread(() => {
-        const frameId = this.content.windowUtils.outerWindowID;
-        const id = this.content.windowUtils.currentInnerWindowID;
-        this.emit("Runtime.executionContextCreated", {
-          context: {
-            id,
-            auxData: {
-              isDefault: true,
-              frameId,
-            },
-          },
-        });
-      });
     }
   }
 
   disable() {
     if (this.enabled) {
       this.enabled = false;
-      this.chromeEventHandler.removeEventListener("DOMWindowCreated", this,
-        {mozSystemGroup: true});
-      this.chromeEventHandler.removeEventListener("pageshow", this,
-        {mozSystemGroup: true});
-      this.chromeEventHandler.removeEventListener("pagehide", this,
-        {mozSystemGroup: true});
-      Services.obs.removeObserver(this, "inner-window-destroyed");
     }
   }
-
-  handleEvent({type, target, persisted}) {
-    const frameId = target.defaultView.windowUtils.outerWindowID;
-    const id = target.defaultView.windowUtils.currentInnerWindowID;
-    switch (type) {
-    case "DOMWindowCreated":
-      this.emit("Runtime.executionContextCreated", {
-        context: {
-          id,
-          auxData: {
-            isDefault: target == this.content.document,
-            frameId,
-          },
-        },
-      });
-      break;
-
-    case "pageshow":
-      // `persisted` is true when this is about a page being resurected from BF Cache
-      if (!persisted) {
-        return;
-      }
-      this.emit("Runtime.executionContextCreated", {
-        context: {
-          id,
-          auxData: {
-            isDefault: target == this.content.document,
-            frameId,
-          },
-        },
-      });
-      break;
-
-    case "pagehide":
-      // `persisted` is true when this is about a page being frozen into BF Cache
-      if (!persisted) {
-        return;
-      }
-      this.emit("Runtime.executionContextDestroyed", {
-        executionContextId: id,
-      });
-      break;
-    }
-  }
-
-  observe(subject, topic, data) {
-    const innerWindowID = subject.QueryInterface(Ci.nsISupportsPRUint64).data;
-    this.emit("Runtime.executionContextDestroyed", {
-      executionContextId: innerWindowID,
-    });
-  }
 }
--- a/remote/test/browser/browser.ini
+++ b/remote/test/browser/browser.ini
@@ -4,11 +4,10 @@ prefs = remote.enabled=true
 support-files =
   chrome-remote-interface.js
   head.js
 skip-if = debug || asan # bug 1546945
 
 [browser_cdp.js]
 [browser_main_target.js]
 [browser_page_frameNavigated.js]
-[browser_runtime_executionContext.js]
 [browser_tabs.js]
 [browser_target.js]
deleted file mode 100644
--- a/remote/test/browser/browser_runtime_executionContext.js
+++ /dev/null
@@ -1,104 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-"use strict";
-
-/* global getCDP */
-
-const {RemoteAgent} = ChromeUtils.import("chrome://remote/content/RemoteAgent.jsm");
-const {RemoteAgentError} = ChromeUtils.import("chrome://remote/content/Error.jsm");
-
-// Test the Runtime execution context events
-
-const TEST_URI = "data:text/html;charset=utf-8,default-test-page";
-
-add_task(async function() {
-  try {
-    await testCDP();
-  } catch (e) {
-    // Display better error message with the server side stacktrace
-    // if an error happened on the server side:
-    if (e.response) {
-      throw RemoteAgentError.fromJSON(e.response);
-    } else {
-      throw e;
-    }
-  }
-});
-
-async function testCDP() {
-  // Open a test page, to prevent debugging the random default page
-  await BrowserTestUtils.openNewForegroundTab(gBrowser, TEST_URI);
-
-  // Start the CDP server
-  RemoteAgent.init();
-  RemoteAgent.tabs.start();
-  RemoteAgent.listen(Services.io.newURI("http://localhost:9222"));
-
-  // Retrieve the chrome-remote-interface library object
-  const CDP = await getCDP();
-
-  // Connect to the server
-  const client = await CDP({
-    target(list) {
-      // Ensure debugging the right target, i.e. the one for our test tab.
-      return list.find(target => target.url == TEST_URI);
-    },
-  });
-  ok(true, "CDP client has been instantiated");
-
-  const {Page, Runtime} = client;
-
-  // turn on navigation related events, such as DOMContentLoaded et al.
-  await Runtime.enable();
-  ok(true, "Runtime domain has been enabled");
-
-  // Calling Runtime.enable will emit executionContextCreated for the existing contexts
-  const { context: context1 } = await Runtime.executionContextCreated();
-  ok(!!context1.id, "The execution context has an id");
-  ok(context1.auxData.isDefault, "The execution context is the default one");
-  ok(!!context1.auxData.frameId, "The execution context has a frame id set");
-
-  info("Navigate to a new URL");
-  const executionContextDestroyed2 = Runtime.executionContextDestroyed();
-  const executionContextCreated2 = Runtime.executionContextCreated();
-
-  const url = "data:text/html;charset=utf-8,test-page";
-  const { frameId } = await Page.navigate({ url });
-  ok(true, "A new page has been loaded");
-  is(frameId, context1.auxData.frameId, "Page.navigate returns the same frameId than executionContextCreated");
-
-  let { executionContextId } = await executionContextDestroyed2;
-  is(executionContextId, context1.id, "The destroyed event reports the previous context id");
-
-  const { context: context2 } = await executionContextCreated2;
-  ok(!!context2.id, "The execution context has an id");
-  isnot(context1.id, context2.id, "The new execution context has a different id");
-  ok(context2.auxData.isDefault, "The execution context is the default one");
-  is(context2.auxData.frameId, frameId, "The execution context frame id is the same " +
-    "than the one returned by Page.navigate");
-
-  isnot(executionContextId, context2.id, "The destroyed id is different from the " +
-    "created one");
-
-  // Navigates back to the previous page.
-  // This should resurect the original document from the BF Cache and recreate the
-  // context for it
-  info("Navigate back to the previous document");
-  const executionContextDestroyed3 = Runtime.executionContextDestroyed();
-  const executionContextCreated3 = Runtime.executionContextCreated();
-  gBrowser.selectedBrowser.goBack();
-  const { context: context3 } = await executionContextCreated3;
-  is(context3.id, context1.id, "The new execution context should be the same than the first one");
-  ok(context3.auxData.isDefault, "The execution context is the default one");
-  is(context3.auxData.frameId, frameId, "The execution context frame id is always the same");
-
-  ({ executionContextId } = await executionContextDestroyed3);
-  is(executionContextId, context2.id, "The destroyed event reports the previous context id");
-  await client.close();
-  ok(true, "The client is closed");
-
-  BrowserTestUtils.removeTab(gBrowser.selectedTab);
-
-  await RemoteAgent.close();
-}