Bug 1406763 - Fix broken Assert.throws() calls for error class. r=ato
authorHenrik Skupin <mail@hskupin.info>
Thu, 12 Oct 2017 17:56:31 +0200
changeset 385930 ee681d6964d3f6f626d4ea2b569f241b4f67ab1b
parent 385929 633b06e5fc74afd202a58c722ae732872e512bc2
child 385931 77872d4a7260fb81bca5df6fc8a74a060ac44afb
push id32672
push userarchaeopteryx@coole-files.de
push dateFri, 13 Oct 2017 09:00:05 +0000
treeherdermozilla-central@3efcb26e5f37 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersato
bugs1406763
milestone58.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 1406763 - Fix broken Assert.throws() calls for error class. r=ato MozReview-Commit-ID: H1fw7VitAyO
testing/marionette/test_session.js
--- a/testing/marionette/test_session.js
+++ b/testing/marionette/test_session.js
@@ -243,23 +243,23 @@ add_test(function test_Proxy_toJSON() {
 });
 
 add_test(function test_Proxy_fromJSON() {
   let p = new session.Proxy();
   deepEqual(p, session.Proxy.fromJSON(undefined));
   deepEqual(p, session.Proxy.fromJSON(null));
 
   for (let typ of [true, 42, "foo", []]) {
-    Assert.throws(() => session.Proxy.fromJSON(typ), InvalidArgumentError);
+    Assert.throws(() => session.Proxy.fromJSON(typ), /InvalidArgumentError/);
   }
 
   // must contain a valid proxyType
-  Assert.throws(() => session.Proxy.fromJSON({}), InvalidArgumentError);
+  Assert.throws(() => session.Proxy.fromJSON({}), /InvalidArgumentError/);
   Assert.throws(() => session.Proxy.fromJSON({proxyType: "foo"}),
-      InvalidArgumentError);
+      /InvalidArgumentError/);
 
   // autoconfig url
   for (let url of [true, 42, [], {}]) {
     Assert.throws(() => session.Proxy.fromJSON(
         {proxyType: "pac", proxyAutoconfigUrl: url}), /InvalidArgumentError/);
   }
 
   p = new session.Proxy();
@@ -277,17 +277,17 @@ add_test(function test_Proxy_fromJSON() 
     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);
+          /InvalidArgumentError/);
     }
 
     p = new session.Proxy();
     p.proxyType = "manual";
     if (proxy == "socksProxy") {
       manual.socksVersion = 5;
       p.socksVersion = 5;
     }
@@ -329,24 +329,24 @@ add_test(function test_Proxy_fromJSON() 
 
       deepEqual(p, session.Proxy.fromJSON(manual));
     }
   }
 
   // missing required socks version
   Assert.throws(() => session.Proxy.fromJSON(
       {proxyType: "manual", socksProxy: "foo:1234"}),
-      InvalidArgumentError);
+      /InvalidArgumentError/);
 
   // noProxy: invalid settings
   for (let noProxy of [true, 42, {}, null, "foo",
       [true], [42], [{}], [null]]) {
     Assert.throws(() => session.Proxy.fromJSON(
         {proxyType: "manual", noProxy: noProxy}),
-        InvalidArgumentError);
+        /InvalidArgumentError/);
   }
 
   // noProxy: valid settings
   p = new session.Proxy();
   p.proxyType = "manual";
   for (let noProxy of [[], ["foo"], ["foo", "bar"], ["127.0.0.1"]]) {
     let manual = {proxyType: "manual", "noProxy": noProxy}
     p.noProxy = noProxy;
@@ -416,17 +416,17 @@ add_test(function test_Capabilities_toJS
 add_test(function test_Capabilities_fromJSON() {
   const {fromJSON} = session.Capabilities;
 
   // plain
   for (let typ of [{}, null, undefined]) {
     ok(fromJSON(typ).has("browserName"));
   }
   for (let typ of [true, 42, "foo", []]) {
-    Assert.throws(() => fromJSON(typ), InvalidArgumentError);
+    Assert.throws(() => fromJSON(typ), /InvalidArgumentError/);
   }
 
   // matching
   let caps = new session.Capabilities();
 
   caps = fromJSON({acceptInsecureCerts: true});
   equal(true, caps.get("acceptInsecureCerts"));
   caps = fromJSON({acceptInsecureCerts: false});