Bug 1651312 - [remote] Fix invalid data type checks in browser-chrome tests. r=remote-protocol-reviewers,maja_zf

Differential Revision: https://phabricator.services.mozilla.com/D82678
This commit is contained in:
Henrik Skupin 2020-07-08 13:47:22 +00:00
parent acc77fd89e
commit f8fbd2e85e
6 changed files with 18 additions and 19 deletions

View file

@ -27,7 +27,6 @@ add_task(async function testBasicNavigation({ client }) {
await loadEventFired;
const currentFrame = await getTopFrame(client);
is(4, "4", "identical");
is(frameId, currentFrame.id, "Page.navigate returns expected frameId");
is(

View file

@ -118,7 +118,7 @@ add_task(async function awaitPromiseResolve({ client }) {
});
is(result.type, "number", "The type is correct");
is(result.subtype, null, "The subtype is null for numbers");
is(result.subtype, undefined, "The subtype is undefined for numbers");
is(result.value, 42, "The result is the promise's resolution");
});
@ -133,7 +133,7 @@ add_task(async function awaitPromiseDelayedResolve({ client }) {
executionContextId,
});
is(result.type, "number", "The type is correct");
is(result.subtype, null, "The subtype is null for numbers");
is(result.subtype, undefined, "The subtype is undefined for numbers");
is(result.value, 42, "The result is the promise's resolution");
});
@ -318,7 +318,7 @@ add_task(async function objectId({ client }) {
});
is(result.type, "object", "The type is correct");
is(result.subtype, null, "The subtype is null for objects");
is(result.subtype, undefined, "The subtype is undefined for objects");
ok(!!result.objectId, "Got an object id");
// Then apply a method on this object
@ -329,7 +329,7 @@ add_task(async function objectId({ client }) {
});
is(result2.type, "number", "The type is correct");
is(result2.subtype, null, "The subtype is null for numbers");
is(result2.subtype, undefined, "The subtype is undefined for numbers");
is(result2.value, 42, "Expected value returned");
});
@ -345,7 +345,7 @@ add_task(async function objectIdArgumentReference({ client }) {
});
is(result.type, "object", "The type is correct");
is(result.subtype, null, "The subtype is null for objects");
is(result.subtype, undefined, "The subtype is undefined for objects");
ok(!!result.objectId, "Got an object id");
// Then increment the `foo` attribute of this JS object,
@ -374,7 +374,7 @@ add_task(async function objectIdArgumentReference({ client }) {
});
is(result3.type, "object", "The type is correct");
is(result3.subtype, null, "The subtype is null for objects");
is(result3.subtype, undefined, "The subtype is undefined for objects");
// Remote objects don't have unique ids. So you may have multiple object ids
// that reference the same remote object
ok(!!result3.objectId, "Got an object id");

View file

@ -9,8 +9,8 @@ add_task(async function returnAsObjectTypes({ client }) {
const { id: executionContextId } = await enableRuntime(client);
const expressions = [
{ expression: "({foo:true})", type: "object", subtype: null },
{ expression: "Symbol('foo')", type: "symbol", subtype: null },
{ expression: "({foo:true})", type: "object", subtype: undefined },
{ expression: "Symbol('foo')", type: "symbol", subtype: undefined },
{ expression: "new Promise(()=>{})", type: "object", subtype: "promise" },
{ expression: "new Int8Array(8)", type: "object", subtype: "typedarray" },
{ expression: "new WeakMap()", type: "object", subtype: "weakmap" },

View file

@ -35,7 +35,7 @@ add_task(async function awaitPromiseResolve({ client }) {
});
is(result.type, "number", "The type is correct");
is(result.subtype, null, "The subtype is null for numbers");
is(result.subtype, undefined, "The subtype is undefined for numbers");
is(result.value, 42, "The result is the promise's resolution");
});
@ -66,7 +66,7 @@ add_task(async function awaitPromiseDelayedResolve({ client }) {
awaitPromise: true,
});
is(result.type, "number", "The type is correct");
is(result.subtype, null, "The subtype is null for numbers");
is(result.subtype, undefined, "The subtype is undefined for numbers");
is(result.value, 42, "The result is the promise's resolution");
});
@ -193,8 +193,8 @@ add_task(async function returnAsObjectTypes({ client }) {
await enableRuntime(client);
const expressions = [
{ expression: "({foo:true})", type: "object", subtype: null },
{ expression: "Symbol('foo')", type: "symbol", subtype: null },
{ expression: "({foo:true})", type: "object", subtype: undefined },
{ expression: "Symbol('foo')", type: "symbol", subtype: undefined },
{ expression: "new Promise(()=>{})", type: "object", subtype: "promise" },
{ expression: "new Int8Array(8)", type: "object", subtype: "typedarray" },
{ expression: "new WeakMap()", type: "object", subtype: "weakmap" },

View file

@ -34,7 +34,7 @@ async function testGetOwnSimpleProperties({ Runtime }, contextId) {
contextId,
expression: "({ bool: true, fun() {}, int: 1, object: {}, string: 'foo' })",
});
is(result.subtype, null, "JS Object have no subtype");
is(result.subtype, undefined, "JS Object has no subtype");
is(result.type, "object", "The type is correct");
ok(!!result.objectId, "Got an object id");
@ -94,7 +94,7 @@ async function testGetPrototypeProperties({ Runtime }, contextId) {
contextId,
expression: "({ foo: 42 })",
});
is(result.subtype, null, "JS Object have no subtype");
is(result.subtype, undefined, "JS Object has no subtype");
is(result.type, "object", "The type is correct");
ok(!!result.objectId, "Got an object id");
@ -121,7 +121,7 @@ async function testGetGetterSetterProperties({ Runtime }, contextId) {
expression:
"({ get prop() { return this.x; }, set prop(v) { this.x = v; } })",
});
is(result.subtype, null, "JS Object have no subtype");
is(result.subtype, undefined, "JS Object has no subtype");
is(result.type, "object", "The type is correct");
ok(!!result.objectId, "Got an object id");
@ -156,7 +156,7 @@ async function testGetGetterSetterProperties({ Runtime }, contextId) {
],
});
is(result3.type, "number", "The type is correct");
is(result3.subtype, null, "The subtype is null for numbers");
is(result3.subtype, undefined, "The subtype is undefined for numbers");
is(result3.value, 42, "The getter returned the value set by the setter");
}
@ -165,7 +165,7 @@ async function testGetCustomProperty({ Runtime }, contextId) {
contextId,
expression: `const obj = {}; Object.defineProperty(obj, "prop", { value: 42 }); obj`,
});
is(result.subtype, null, "JS Object have no subtype");
is(result.subtype, undefined, "JS Object has no subtype");
is(result.type, "object", "The type is correct");
ok(!!result.objectId, "Got an object id");

View file

@ -31,7 +31,7 @@ async function testObjectRelease({ Runtime }, contextId) {
contextId,
expression: "({ foo: 42 })",
});
is(result.subtype, null, "JS Object have no subtype");
is(result.subtype, undefined, "JS Object has no subtype");
is(result.type, "object", "The type is correct");
ok(!!result.objectId, "Got an object id");