Backed out 2 changesets (bug 1600330) for failing at browser_agent.js on a CLOSED TREE.
authorGurzau Raul <rgurzau@mozilla.com>
Tue, 03 Dec 2019 21:27:59 +0200
changeset 505155 7a14672fc95d4881869efb191010e08bbbfdd4cf
parent 505154 8ab6eb30d4fad0d4679681aaa2c6a39a41f82aa9
child 505156 a84db640f52a0d9bc7e76811dfd3b1476c3b6d0b
push id102181
push userrgurzau@mozilla.com
push dateTue, 03 Dec 2019 19:30:55 +0000
treeherderautoland@7a14672fc95d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1600330
milestone73.0a1
backs outeef79aaf5378bc898ae68633abc59330f4a8bd1e
695a3213e7fdb1b0c8fdb69a8d563b774149a905
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 1600330) for failing at browser_agent.js on a CLOSED TREE. Backed out changeset eef79aaf5378 (bug 1600330) Backed out changeset 695a3213e7fd (bug 1600330)
remote/test/browser/browser.ini
remote/test/browser/browser_agent.js
remote/test/browser/head.js
--- a/remote/test/browser/browser.ini
+++ b/remote/test/browser/browser.ini
@@ -1,13 +1,12 @@
 [DEFAULT]
 tags = remote
 subsuite = remote
 prefs = remote.enabled=true
 support-files =
   chrome-remote-interface.js
   head.js
 
-[browser_agent.js]
 [browser_cdp.js]
 [browser_main_target.js]
 [browser_session.js]
 [browser_tabs.js]
deleted file mode 100644
--- a/remote/test/browser/browser_agent.js
+++ /dev/null
@@ -1,109 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-"use strict";
-
-const { Preferences } = ChromeUtils.import(
-  "resource://gre/modules/Preferences.jsm"
-);
-
-const URL = Services.io.newURI("http://localhost:0");
-
-// set up test conditions and clean up
-function add_agent_task(taskFn) {
-  add_plain_task(async () => {
-    try {
-      await RemoteAgent.close();
-      await taskFn();
-    } finally {
-      Preferences.reset("remote.enabled");
-      Preferences.reset("remote.force-local");
-    }
-  });
-}
-
-add_agent_task(async function listening() {
-  is(RemoteAgent.listening, false, "Agent is not listening");
-  await RemoteAgent.listen(URL);
-  is(RemoteAgent.listening, true, "Agent is listening");
-});
-
-add_agent_task(async function listen() {
-  const port = getNonAtomicFreePort();
-
-  let boundURL;
-  function observer(subject, topic, data) {
-    Services.obs.removeObserver(observer, topic);
-    boundURL = Services.io.newURI(data);
-  }
-  Services.obs.addObserver(observer, "remote-listening");
-
-  await RemoteAgent.listen("http://localhost:" + port);
-  isnot(boundURL, undefined, "remote-listening observer not notified");
-  is(
-    boundURL.port,
-    port,
-    `expected default port ${port}, but got ${boundURL.port}`
-  );
-});
-
-add_agent_task(async function listenWhenDisabled() {
-  Preferences.set("remote.enabled", false);
-  try {
-    await RemoteAgent.listen(URL);
-    fail("listen() did not return exception");
-  } catch (e) {
-    is(e.result, Cr.NS_ERROR_NOT_AVAILABLE);
-    is(e.message, "Disabled by preference");
-  }
-});
-
-// TODO(ato): https://bugzil.la/1590829
-add_agent_task(async function listenTakesString() {
-  await RemoteAgent.listen("http://localhost:0");
-  await RemoteAgent.close();
-});
-
-// TODO(ato): https://bugzil.la/1590829
-add_agent_task(async function listenNonURL() {
-  try {
-    await RemoteAgent.listen("foobar");
-    fail("listen() did not reject non-URL");
-  } catch (e) {
-    is(e.result, Cr.NS_ERROR_MALFORMED_URI);
-  }
-});
-
-add_agent_task(async function listenRestrictedToLoopbackDevice() {
-  try {
-    await RemoteAgent.listen("http://0.0.0.0:0");
-    fail("listen() did not reject non-loopback device");
-  } catch (e) {
-    is(e.result, Cr.NS_ERROR_ILLEGAL_VALUE);
-    is(e.message, "Restricted to loopback devices");
-  }
-});
-
-add_agent_task(async function listenNonLoopbackDevice() {
-  Preferences.set("remote.force-local", false);
-  await RemoteAgent.listen("http://0.0.0.0:0");
-});
-
-add_agent_task(async function test_close() {
-  await RemoteAgent.listen(URL);
-  await RemoteAgent.close();
-  // no-op when not listening
-  await RemoteAgent.close();
-});
-
-function getNonAtomicFreePort() {
-  const so = Cc["@mozilla.org/network/server-socket;1"].createInstance(
-    Ci.nsIServerSocket
-  );
-  try {
-    so.init(-1, true /* aLoopbackOnly */, -1 /* aBackLog */);
-    return so.port;
-  } finally {
-    so.close();
-  }
-}
--- a/remote/test/browser/head.js
+++ b/remote/test/browser/head.js
@@ -182,13 +182,8 @@ function getContentProperty(prop) {
 /**
  * Return a new promise, which resolves after ms have been elapsed
  */
 function timeoutPromise(ms) {
   return new Promise(resolve => {
     window.setTimeout(resolve, ms);
   });
 }
-
-/** Fail a test. */
-function fail(message) {
-  ok(false, message);
-}