Bug 1590358 - Replace static assertions in browser chrome tests with info(), r=remote-protocol-reviewers,whimboo

Differential Revision: https://phabricator.services.mozilla.com/D53352

--HG--
extra : moz-landing-system : lando
This commit is contained in:
danwalsh99 2019-11-19 13:37:34 +00:00
parent d79e42a0ef
commit 41f66d6264
12 changed files with 26 additions and 26 deletions

View File

@ -28,7 +28,7 @@ add_task(async function testCDP(client) {
// receive console.log messages and print them
Log.enable();
ok(true, "Log domain has been enabled");
info("Log domain has been enabled");
Log.entryAdded(({ entry }) => {
const { timestamp, level, text, args } = entry;
@ -38,7 +38,7 @@ add_task(async function testCDP(client) {
// turn on navigation related events, such as DOMContentLoaded et al.
await Page.enable();
ok(true, "Page domain has been enabled");
info("Page domain has been enabled");
const frameStoppedLoading = Page.frameStoppedLoading();
const navigatedWithinDocument = Page.navigatedWithinDocument();
@ -46,14 +46,14 @@ add_task(async function testCDP(client) {
await Page.navigate({
url: toDataURL(`<script>console.log("foo")</script>`),
});
ok(true, "A new page has been loaded");
info("A new page has been loaded");
await loadEventFired;
ok(true, "`Page.loadEventFired` fired");
info("`Page.loadEventFired` fired");
await frameStoppedLoading;
ok(true, "`Page.frameStoppedLoading` fired");
info("`Page.frameStoppedLoading` fired");
await navigatedWithinDocument;
ok(true, "`Page.navigatedWithinDocument` fired");
info("`Page.navigatedWithinDocument` fired");
});

View File

@ -15,7 +15,7 @@ add_task(async function(_client, CDP) {
const targetURL = mainProcessTarget.wsDebuggerURL;
const client = await CDP({ target: targetURL });
ok(true, "CDP client has been instantiated");
info("CDP client has been instantiated");
try {
const { Browser, Target } = client;

View File

@ -52,5 +52,5 @@ add_task(async function testDispatchMouseEvent(client) {
return this.clickPromise;
});
ok(true, "All events detected");
info("All events detected");
});

View File

@ -14,12 +14,12 @@ add_task(async function(client) {
const { Page, Network } = client;
await Network.enable();
ok(true, "Network domain has been enabled");
info("Network domain has been enabled");
let requests = 0;
const onRequests = new Promise(resolve => {
Network.requestWillBeSent(event => {
ok(true, "Received a request");
info("Received a request");
switch (++requests) {
case 1:
is(event.request.url, PAGE_URL, "Got the page request");

View File

@ -20,7 +20,7 @@ add_task(async function(client) {
// turn on navigation related events, such as DOMContentLoaded et al.
await Page.enable();
ok(true, "Page domain has been enabled");
info("Page domain has been enabled");
const { frameTree } = await Page.getFrameTree();
ok(!!frameTree.frame, "getFrameTree exposes one frame");
@ -35,7 +35,7 @@ add_task(async function(client) {
// Save the given `promise` resolution into the `promises` global Set
function recordPromise(name, promise) {
promise.then(event => {
ok(true, `Received Page.${name}`);
info(`Received Page.${name}`);
resolutions.set(name, event);
});
promises.add(promise);
@ -54,7 +54,7 @@ add_task(async function(client) {
const url = RANDOM_ID_DOC;
const { frameId } = await Page.navigate({ url });
ok(true, "A new page has been loaded");
info("A new page has been loaded");
ok(frameId, "Page.navigate returned a frameId");
is(
@ -72,7 +72,7 @@ add_task(async function(client) {
recordPromises();
await Page.reload();
ok(true, "The page has been reloaded");
info("The page has been reloaded");
await assertNavigationEvents({ url, frameId });
@ -88,7 +88,7 @@ add_task(async function(client) {
recordPromises();
await Page.navigate({ url });
ok(true, "The page has been reloaded");
info("The page has been reloaded");
await assertNavigationEvents({ url, frameId });

View File

@ -33,11 +33,11 @@ add_task(async function testCDP(client) {
// turn on navigation related events, such as DOMContentLoaded et al.
await Page.enable();
ok(true, "Page domain has been enabled");
info("Page domain has been enabled");
const onExecutionContextCreated = Runtime.executionContextCreated();
await Runtime.enable();
ok(true, "Runtime domain has been enabled");
info("Runtime domain has been enabled");
// Runtime.enable will dispatch `executionContextCreated` for the existing document
let { context } = await onExecutionContextCreated;
@ -66,7 +66,7 @@ add_task(async function testCDP(client) {
const onExecutionContextCreated2 = Runtime.executionContextCreated();
const url = toDataURL("test-page");
const { frameId } = await Page.navigate({ url });
ok(true, "A new page has been loaded");
info("A new page has been loaded");
ok(frameId, "Page.navigate returned a frameId");
is(
frameId,

View File

@ -19,7 +19,7 @@ add_task(async function(client) {
async function testRuntimeEnable({ Runtime }) {
// Enable watching for new execution context
await Runtime.enable();
ok(true, "Runtime domain has been enabled");
info("Runtime domain has been enabled");
// Calling Runtime.enable will emit executionContextCreated for the existing contexts
const { context } = await Runtime.executionContextCreated();

View File

@ -84,7 +84,7 @@ add_task(async function(client) {
async function testRuntimeEnable({ Runtime }) {
// Enable watching for new execution context
await Runtime.enable();
ok(true, "Runtime domain has been enabled");
info("Runtime domain has been enabled");
// Calling Runtime.enable will emit executionContextCreated for the existing contexts
const { context } = await Runtime.executionContextCreated();

View File

@ -21,7 +21,7 @@ add_task(async function(client) {
async function testRuntimeEnable({ Runtime }) {
// Enable watching for new execution context
await Runtime.enable();
ok(true, "Runtime domain has been enabled");
info("Runtime domain has been enabled");
// Calling Runtime.enable will emit executionContextCreated for the existing contexts
const { context } = await Runtime.executionContextCreated();
@ -53,7 +53,7 @@ async function testNavigate({ Runtime, Page }, previousContext) {
const executionContextCreated = Runtime.executionContextCreated();
const { frameId } = await Page.navigate({ url: toDataURL("test-page") });
ok(true, "A new page has been loaded");
info("A new page has been loaded");
is(
frameId,
previousContext.auxData.frameId,

View File

@ -18,7 +18,7 @@ add_task(async function(client) {
async function testRuntimeEnable({ Runtime }) {
// Enable watching for new execution context
await Runtime.enable();
ok(true, "Runtime domain has been enabled");
info("Runtime domain has been enabled");
// Calling Runtime.enable will emit executionContextCreated for the existing contexts
const { context } = await Runtime.executionContextCreated();

View File

@ -15,7 +15,7 @@ add_task(async function(client) {
async function testRuntimeEnable({ Runtime }) {
// Enable watching for new execution context
await Runtime.enable();
ok(true, "Runtime domain has been enabled");
info("Runtime domain has been enabled");
// Calling Runtime.enable will emit executionContextCreated for the existing contexts
const { context } = await Runtime.executionContextCreated();
@ -53,7 +53,7 @@ async function testObjectRelease({ Runtime }, contextId) {
await Runtime.releaseObject({
objectId: result.objectId,
});
ok(true, "Object is released");
info("Object is released");
try {
await Runtime.callFunctionOn({

View File

@ -35,5 +35,5 @@ add_task(async function(_, CDP) {
await Target.disposeBrowserContext({ browserContextId });
await client.close();
ok(true, "The client is closed");
info("The client is closed");
});