Backed out 2 changesets (bug 1570378) for ESlint failure on browser_page_javascriptDialog_ . CLOSED TREE
authorNarcis Beleuzu <nbeleuzu@mozilla.com>
Mon, 05 Aug 2019 13:42:46 +0300
changeset 486166 4f81a4f40f888b0881e4fb07505768a815463e42
parent 486165 e208aa908846a72332c40f97768dadce6c289f61
child 486167 48ffed44db64bf22d6358f976aeddf0de2984107
push id36391
push usermalexandru@mozilla.com
push dateMon, 05 Aug 2019 15:55:27 +0000
treeherdermozilla-central@9c91b33629b6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1570378
milestone70.0a1
backs out412894c27fa28f945f0f364bb5aeab28e673830b
adb3dec1090b16e0acd3792c5a4dc1e2a6401c3f
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 2 changesets (bug 1570378) for ESlint failure on browser_page_javascriptDialog_ . CLOSED TREE Backed out changeset 412894c27fa2 (bug 1570378) Backed out changeset adb3dec1090b (bug 1570378)
remote/test/browser/browser_input_dispatchKeyEvent.js
remote/test/browser/browser_input_dispatchKeyEvent_race.js
remote/test/browser/browser_input_dispatchMouseEvent.js
remote/test/browser/browser_network_requestWillBeSent.js
remote/test/browser/browser_page_bringToFront.js
remote/test/browser/browser_page_frameNavigated.js
remote/test/browser/browser_page_frameNavigated_iframe.js
remote/test/browser/browser_page_runtime_events.js
remote/test/browser/browser_runtime_callFunctionOn.js
remote/test/browser/browser_runtime_executionContext.js
remote/test/browser/browser_runtime_get_properties.js
remote/test/browser/browser_runtime_remote_objects.js
remote/test/browser/head.js
--- a/remote/test/browser/browser_input_dispatchKeyEvent.js
+++ b/remote/test/browser/browser_input_dispatchKeyEvent.js
@@ -30,17 +30,17 @@ add_task(async function() {
   info("Enable selectionchange events on input elements");
   await new Promise(resolve => {
     const options = {
       set: [["dom.select_events.textcontrols.enabled", true]],
     };
     SpecialPowers.pushPrefEnv(options, resolve);
   });
 
-  const { client, tab } = await setupForURL(toDataURL("<input>"));
+  const { client, tab } = await setupTestForUri(toDataURL("<input>"));
   is(gBrowser.selectedTab, tab, "Selected tab is the target tab");
 
   const { Input } = client;
 
   info("Focus the input on the page");
   await ContentTask.spawn(gBrowser.selectedBrowser, null, function() {
     const input = content.document.querySelector("input");
     input.focus();
--- a/remote/test/browser/browser_input_dispatchKeyEvent_race.js
+++ b/remote/test/browser/browser_input_dispatchKeyEvent_race.js
@@ -21,21 +21,21 @@
 //
 // In order for this to work, we need to be sure that `await Input.dispatchKeyEvent`
 // resolves only after the content page flushed the event handlers (and
 // `window.myVariable = "newValue"` was executed).
 //
 // This can be racy because Input.dispatchKeyEvent and window.myVariable = "newValue" run
 // in different processes.
 
-const PAGE_URL =
+const PAGE_URI =
   "http://example.com/browser/remote/test/browser/doc_input_dispatchKeyEvent_race.html";
 
 add_task(async function() {
-  const { client, tab } = await setupForURL(PAGE_URL);
+  const { client, tab } = await setupTestForUri(PAGE_URI);
   is(gBrowser.selectedTab, tab, "Selected tab is the target tab");
 
   const { Input, Runtime } = client;
 
   // Need an enabled Runtime domain to run evaluate.
   info("Enable the Runtime domain");
   await Runtime.enable();
   const { context } = await Runtime.executionContextCreated();
--- a/remote/test/browser/browser_input_dispatchMouseEvent.js
+++ b/remote/test/browser/browser_input_dispatchMouseEvent.js
@@ -1,15 +1,15 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 
 "use strict";
 
 add_task(async function testDispatchMouseEvent() {
-  const { client, tab } = await setupForURL(toDataURL("<div>foo</div>"));
+  const { client, tab } = await setupTestForUri(toDataURL("<div>foo</div>"));
 
   const { Input } = client;
 
   await ContentTask.spawn(gBrowser.selectedBrowser, {}, function() {
     const div = content.document.querySelector("div");
     this.mouseDownPromise = new Promise(resolve => {
       div.addEventListener("mousedown", resolve, { once: true });
     });
--- a/remote/test/browser/browser_network_requestWillBeSent.js
+++ b/remote/test/browser/browser_network_requestWillBeSent.js
@@ -1,53 +1,53 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 
 "use strict";
 
 // Test the Network.requestWillBeSent event
 
-const PAGE_URL =
+const PAGE_URI =
   "http://example.com/browser/remote/test/browser/doc_network_requestWillBeSent.html";
-const JS_URL =
+const JS_URI =
   "http://example.com/browser/remote/test/browser/file_network_requestWillBeSent.js";
 
 add_task(async function() {
-  const { client } = await setupForURL(toDataURL("default-test-page"));
+  const { client } = await setupTestForUri(toDataURL("default-test-page"));
 
   const { Page, Network } = client;
 
   await Network.enable();
   ok(true, "Network domain has been enabled");
 
   let requests = 0;
   const onRequests = new Promise(resolve => {
     Network.requestWillBeSent(event => {
       ok(true, "Received a request");
       switch (++requests) {
         case 1:
-          is(event.request.url, PAGE_URL, "Got the page request");
+          is(event.request.url, PAGE_URI, "Got the page request");
           is(event.type, "Document", "The page request has 'Document' type");
           is(
             event.requestId,
             event.loaderId,
             "The page request has requestId = loaderId (puppeteer assumes that to detect the page start request)"
           );
           break;
         case 2:
-          is(event.request.url, JS_URL, "Got the JS request");
+          is(event.request.url, JS_URI, "Got the JS request");
           resolve();
           break;
         case 3:
           ok(false, "Expect only two requests");
       }
     });
   });
 
-  const { frameId } = await Page.navigate({ url: PAGE_URL });
+  const { frameId } = await Page.navigate({ url: PAGE_URI });
   ok(frameId, "Page.navigate returned a frameId");
 
   info("Wait for Network.requestWillBeSent events");
   await onRequests;
 
   await client.close();
   ok(true, "The client is closed");
 
--- a/remote/test/browser/browser_page_bringToFront.js
+++ b/remote/test/browser/browser_page_bringToFront.js
@@ -2,17 +2,17 @@
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 
 "use strict";
 
 const FIRST_DOC = toDataURL("first");
 const SECOND_DOC = toDataURL("second");
 
 add_task(async function testBringToFrontUpdatesSelectedTab() {
-  const { client, tab } = await setupForURL(FIRST_DOC);
+  const { client, tab } = await setupTestForUri(FIRST_DOC);
   is(gBrowser.selectedTab, tab, "Selected tab is the target tab");
 
   info("Open another tab that should become the front tab");
   const otherTab = await BrowserTestUtils.openNewForegroundTab(
     gBrowser,
     SECOND_DOC
   );
   is(gBrowser.selectedTab, otherTab, "Selected tab is now the new tab");
@@ -30,17 +30,17 @@ add_task(async function testBringToFront
 
   BrowserTestUtils.removeTab(tab);
   BrowserTestUtils.removeTab(otherTab);
 
   await RemoteAgent.close();
 });
 
 add_task(async function testBringToFrontUpdatesFocusedWindow() {
-  const { client, tab } = await setupForURL(FIRST_DOC);
+  const { client, tab } = await setupTestForUri(FIRST_DOC);
   is(gBrowser.selectedTab, tab, "Selected tab is the target tab");
 
   is(tab.ownerGlobal, getFocusedNavigator(), "The initial window is focused");
 
   const otherWindow = await BrowserTestUtils.openNewBrowserWindow();
   is(otherWindow, getFocusedNavigator(), "The new window is focused");
 
   const { Page } = client;
--- a/remote/test/browser/browser_page_frameNavigated.js
+++ b/remote/test/browser/browser_page_frameNavigated.js
@@ -6,17 +6,17 @@
 // Test the Page navigation events
 
 const TEST_DOC = toDataURL("default-test-page");
 
 const promises = new Set();
 const resolutions = new Map();
 
 add_task(async function() {
-  const { client } = await setupForURL(TEST_DOC);
+  const { client } = await setupTestForUri(TEST_DOC);
 
   const { Page } = client;
 
   // turn on navigation related events, such as DOMContentLoaded et al.
   await Page.enable();
   ok(true, "Page domain has been enabled");
 
   const { frameTree } = await Page.getFrameTree();
--- a/remote/test/browser/browser_page_frameNavigated_iframe.js
+++ b/remote/test/browser/browser_page_frameNavigated_iframe.js
@@ -7,17 +7,17 @@
 
 const PAGE_URL =
   "http://example.com/browser/remote/test/browser/doc_page_frameNavigated_iframe.html";
 
 const promises = new Set();
 const resolutions = new Map();
 
 add_task(async function() {
-  const { client } = await setupForURL(toDataURL("default-test-page"));
+  const { client } = await setupTestForUri(toDataURL("default-test-page"));
 
   const { Page } = client;
   await Page.enable();
 
   // Store all frameNavigated events in an array
   const frameNavigatedEvents = [];
   Page.frameNavigated(e => frameNavigatedEvents.push(e));
 
--- a/remote/test/browser/browser_page_runtime_events.js
+++ b/remote/test/browser/browser_page_runtime_events.js
@@ -6,17 +6,17 @@
 /* global getCDP */
 
 // Assert the order of Runtime.executionContextDestroyed,
 // Page.frameNavigated, and Runtime.executionContextCreated
 
 const TEST_DOC = toDataURL("default-test-page");
 
 add_task(async function testCDP() {
-  const { client } = await setupForURL(TEST_DOC);
+  const { client } = await setupTestForUri(TEST_DOC);
   const { Page, Runtime } = client;
 
   const events = [];
   function assertReceivedEvents(expected, message) {
     Assert.deepEqual(events, expected, message);
     // Empty the list of received events
     events.splice(0);
   }
--- a/remote/test/browser/browser_runtime_callFunctionOn.js
+++ b/remote/test/browser/browser_runtime_callFunctionOn.js
@@ -2,17 +2,17 @@
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 
 "use strict";
 
 // Test the Runtime.callFunctionOn
 // See also browser_runtime_evaluate, which covers basic usages of this method.
 
 add_task(async function() {
-  const { client } = await setup();
+  const { client } = await setupTestForUri(toDataURL(""));
 
   const firstContext = await testRuntimeEnable(client);
   const contextId = firstContext.id;
   await testObjectReferences(client, contextId);
   await testExceptions(client, contextId);
   await testReturnByValue(client, contextId);
   await testAwaitPromise(client, contextId);
   await testObjectId(client, contextId);
--- a/remote/test/browser/browser_runtime_executionContext.js
+++ b/remote/test/browser/browser_runtime_executionContext.js
@@ -3,17 +3,17 @@
 
 "use strict";
 
 // Test the Runtime execution context events
 
 const TEST_DOC = toDataURL("default-test-page");
 
 add_task(async function() {
-  const { client } = await setupForURL(TEST_DOC);
+  const { client } = await setupTestForUri(TEST_DOC);
 
   const firstContext = await testRuntimeEnable(client);
   await testEvaluate(client, firstContext);
   const secondContext = await testNavigate(client, firstContext);
   await testNavigateBack(client, firstContext, secondContext);
   const thirdContext = await testNavigateViaLocation(client, firstContext);
   await testReload(client, thirdContext);
 
--- a/remote/test/browser/browser_runtime_get_properties.js
+++ b/remote/test/browser/browser_runtime_get_properties.js
@@ -1,17 +1,17 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 
 "use strict";
 
 // Test the Runtime remote object
 
 add_task(async function() {
-  const { client } = await setup();
+  const { client } = await setupTestForUri(toDataURL(""));
 
   const firstContext = await testRuntimeEnable(client);
   const contextId = firstContext.id;
 
   await testGetOwnSimpleProperties(client, contextId);
   await testGetCustomProperty(client, contextId);
   await testGetPrototypeProperties(client, contextId);
   await testGetGetterSetterProperties(client, contextId);
--- a/remote/test/browser/browser_runtime_remote_objects.js
+++ b/remote/test/browser/browser_runtime_remote_objects.js
@@ -1,17 +1,17 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 
 "use strict";
 
 // Test the Runtime remote object
 
 add_task(async function() {
-  const { client } = await setup();
+  const { client } = await setupTestForUri(toDataURL(""));
 
   const firstContext = await testRuntimeEnable(client);
   const contextId = firstContext.id;
 
   await testObjectRelease(client, contextId);
 
   await client.close();
   ok(true, "The client is closed");
--- a/remote/test/browser/head.js
+++ b/remote/test/browser/head.js
@@ -97,42 +97,39 @@ function getTargets(CDP) {
         return;
       }
       resolve(targets);
     });
   });
 }
 
 /**
- * Set up test environment in same fashion as setupForURL(),
- * except using an empty document.
+ * Create a new tab for the provided uri and start a CDP server debugging the
+ * created tab.
  */
-async function setup() {
-  return setupForURL(toDataURL(""));
-}
+async function setupTestForUri(uri) {
+  // Open a test page, to prevent debugging the random default page
+  const tab = await BrowserTestUtils.openNewForegroundTab(gBrowser, uri);
 
-/**
- * Set up test environment by starting the remote agent, connecting
- * the CDP client over loopback, and creating a fresh tab to avoid
- * state bleedover from previous test.
- */
-async function setupForURL(url) {
-  const tab = await BrowserTestUtils.openNewForegroundTab(gBrowser, url);
+  // Start the CDP server
+  await RemoteAgent.listen(Services.io.newURI("http://localhost:9222"));
 
-  await 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 we are debugging the right target, i.e. the requested URL
-      return list.find(target => target.url == url);
+      // Ensure debugging the right target, i.e. the one for our test tab.
+      return list.find(target => {
+        return target.url == uri;
+      });
     },
   });
-  info("CDP client instantiated");
-
+  ok(true, "CDP client has been instantiated");
   return { client, tab };
 }
 
 /** Creates a data URL for the given source document. */
 function toDataURL(src, doctype = "html") {
   let doc, mime;
   switch (doctype) {
     case "html":