--- 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});