Backed out changeset e7f4ffe10569 (bug 1406763) for linting failure at testing/marionette/session.js:317: Missing semicolon. r=backout
authorSebastian Hengst <archaeopteryx@coole-files.de>
Thu, 12 Oct 2017 20:51:44 +0200
changeset 385898 6e77e4951c77eb8462702555e45b063dc73b4199
parent 385897 da7917089c4ba756a1c5416dc8d1a8afaa3ae20f
child 385899 97bf696997c5d08e717c92bcf6cf3d0e57435db0
push id53201
push userarchaeopteryx@coole-files.de
push dateThu, 12 Oct 2017 18:52:20 +0000
treeherderautoland@6e77e4951c77 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbackout
bugs1406763
milestone58.0a1
backs oute7f4ffe10569be04293a8195045cbc8f198209f6
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 changeset e7f4ffe10569 (bug 1406763) for linting failure at testing/marionette/session.js:317: Missing semicolon. r=backout
testing/marionette/test_session.js
--- a/testing/marionette/test_session.js
+++ b/testing/marionette/test_session.js
@@ -182,143 +182,108 @@ add_test(function test_Proxy_toString() 
 
   run_next_test();
 });
 
 add_test(function test_Proxy_toJSON() {
   let p = new session.Proxy();
   deepEqual(p.toJSON(), {});
 
-  // autoconfig url
-  p = new session.Proxy();
-  p.proxyType = "pac";
-  p.proxyAutoconfigUrl = "foo";
-  deepEqual(p.toJSON(), {proxyType: "pac", proxyAutoconfigUrl: "foo"});
-
-  // manual proxy
+  // manual
   p = new session.Proxy();
   p.proxyType = "manual";
   deepEqual(p.toJSON(), {proxyType: "manual"});
 
   for (let proxy of ["ftpProxy", "httpProxy", "sslProxy", "socksProxy"]) {
     let expected = {proxyType: "manual"}
 
-    p = new session.Proxy();
-    p.proxyType = "manual";
+    let manual = new session.Proxy();
+    manual.proxyType = "manual";
 
     if (proxy == "socksProxy") {
-      p.socksVersion = 5;
+      manual.socksVersion = 5;
       expected.socksVersion = 5;
     }
 
     // without port
-    p[proxy] = "foo";
+    manual[proxy] = "foo";
     expected[proxy] = "foo"
-    deepEqual(p.toJSON(), expected);
+    deepEqual(manual.toJSON(), expected);
 
     // with port
-    p[proxy] = "foo";
-    p[`${proxy}Port`] = 0;
+    manual[proxy] = "foo";
+    manual[`${proxy}Port`] = 0;
     expected[proxy] = "foo:0";
-    deepEqual(p.toJSON(), expected);
+    deepEqual(manual.toJSON(), expected);
 
-    p[`${proxy}Port`] = 42;
+    manual[`${proxy}Port`] = 42;
     expected[proxy] = "foo:42"
-    deepEqual(p.toJSON(), expected);
+    deepEqual(manual.toJSON(), expected);
   }
 
   run_next_test();
 });
 
 add_test(function test_Proxy_fromJSON() {
-  let p = new session.Proxy();
-  deepEqual(p, session.Proxy.fromJSON(undefined));
-  deepEqual(p, session.Proxy.fromJSON(null));
+  deepEqual({}, session.Proxy.fromJSON(undefined).toJSON());
+  deepEqual({}, session.Proxy.fromJSON(null).toJSON());
 
   for (let typ of [true, 42, "foo", []]) {
     Assert.throws(() => session.Proxy.fromJSON(typ), InvalidArgumentError);
   }
 
   // must contain a valid proxyType
   Assert.throws(() => session.Proxy.fromJSON({}), InvalidArgumentError);
   Assert.throws(() => session.Proxy.fromJSON({proxyType: "foo"}),
       InvalidArgumentError);
 
-  // autoconfig url
-  for (let url of [true, 42, [], {}]) {
-    Assert.throws(() => session.Proxy.fromJSON(
-        {proxyType: "pac", proxyAutoconfigUrl: url}), /InvalidArgumentError/);
-  }
-
-  p = new session.Proxy();
-  p.proxyType = "pac";
-  p.proxyAutoconfigUrl = "foo";
-  deepEqual(p,
-      session.Proxy.fromJSON({proxyType: "pac", proxyAutoconfigUrl: "foo"}));
-
-  // manual proxy
-  p = new session.Proxy();
-  p.proxyType = "manual";
-  deepEqual(p, session.Proxy.fromJSON({proxyType: "manual"}));
+  // manual
+  session.Proxy.fromJSON({proxyType: "manual"});
 
   for (let proxy of ["httpProxy", "sslProxy", "ftpProxy", "socksProxy"]) {
     let manual = {proxyType: "manual"};
 
     // invalid hosts
     for (let host of [true, 42, [], {}, null, "http://foo",
         "foo:-1", "foo:65536", "foo/test", "foo#42", "foo?foo=bar",
         "2001:db8::1"]) {
       manual[proxy] = host;
       Assert.throws(() => session.Proxy.fromJSON(manual),
           InvalidArgumentError);
     }
 
-    p = new session.Proxy();
-    p.proxyType = "manual";
+    let expected = {"proxyType": "manual"};
     if (proxy == "socksProxy") {
       manual.socksVersion = 5;
-      p.socksVersion = 5;
+      expected.socksVersion = 5;
     }
 
-    let host_map = {
-      "foo:1": {hostname: "foo", port: 1},
-      "foo:21": {hostname: "foo", port: 21},
-      "foo:80": {hostname: "foo", port: 80},
-      "foo:443": {hostname: "foo", port: 443},
-      "foo:65535": {hostname: "foo", port: 65535},
-      "127.0.0.1:42": {hostname: "127.0.0.1", port: 42},
-      "[2001:db8::1]:42": {hostname: "[2001:db8::1]", port: "42"},
-    };
+    // valid proxy hosts with port
+    for (let host of ["foo:1", "foo:80", "foo:443", "foo:65535",
+        "127.0.0.1:42", "[2001:db8::1]:42"]) {
+      manual[proxy] = host;
+      expected[proxy] = host;
 
-    // valid proxy hosts with port
-    for (let host in host_map) {
-      manual[proxy] = host;
-
-      p[`${proxy}`] = host_map[host]["hostname"];
-      p[`${proxy}Port`] = host_map[host]["port"];
-
-      deepEqual(p, session.Proxy.fromJSON(manual));
+      deepEqual(expected, session.Proxy.fromJSON(manual).toJSON());
     }
 
     // Without a port the default port of the scheme is used
     for (let host of ["foo", "foo:"]) {
       manual[proxy] = host;
 
       // For socks no default port is available
-      p[proxy] = `foo`;
       if (proxy === "socksProxy") {
-        p[`${proxy}Port`] = null;
+        expected[proxy] = `foo`;
       } else {
         let default_ports = {"ftpProxy": 21, "httpProxy": 80,
            "sslProxy": 443};
 
-        p[`${proxy}Port`] = default_ports[proxy];
+        expected[proxy] = `foo:${default_ports[proxy]}`;
       }
-
-      deepEqual(p, session.Proxy.fromJSON(manual));
+      deepEqual(expected, session.Proxy.fromJSON(manual).toJSON());
     }
   }
 
   // missing required socks version
   Assert.throws(() => session.Proxy.fromJSON(
       {proxyType: "manual", socksProxy: "foo:1234"}),
       InvalidArgumentError);
 
@@ -326,23 +291,19 @@ add_test(function test_Proxy_fromJSON() 
   for (let noProxy of [true, 42, {}, null, "foo",
       [true], [42], [{}], [null]]) {
     Assert.throws(() => session.Proxy.fromJSON(
         {proxyType: "manual", noProxy: noProxy}),
         InvalidArgumentError);
   }
 
   // valid noProxy
-  p = new session.Proxy();
-  p.proxyType = "manual";
-  for (let noProxy of [[], ["foo"], ["foo", "bar"],
-      ["127.0.0.1"], ["[2001:db8::1"]]) {
+  for (let noProxy of [[], ["foo"], ["foo", "bar"]]) {
     let manual = {proxyType: "manual", "noProxy": noProxy}
-    p.noProxy = noProxy;
-    deepEqual(p, session.Proxy.fromJSON(manual));
+    deepEqual(manual, session.Proxy.fromJSON(manual).toJSON());
   }
 
   run_next_test();
 });
 
 add_test(function test_Capabilities_ctor() {
   let caps = new session.Capabilities();
   ok(caps.has("browserName"));