Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
address some comments
  • Loading branch information
TimothyGu committed Aug 20, 2018
commit 8b7bd3c825d5e4f790edb060117dc26488768880
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,25 @@
// second actually calls document.open() to test if the method call removes
// that specific task from the queue.

// This is necessary to allow the promise rejection test below.
setup({
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you point to the reason this is needed? (the promise rejection test below)

Reason being that this can also mask other problems with the test, so usage should be well motivated. (and is)

allow_uncaught_exception: true
});

function taskTest(description, testBody) {
async_test(t => {
const frame = document.body.appendChild(document.createElement("iframe"));
// The empty HTML seems to be necessary to cajole Chrome into firing a load
// event, which is necessary to make sure the frame's document doesn't have
// a parser associated with it.
// The empty HTML seems to be necessary to cajole Chrome and Safari into
// firing a load event asynchronously, which is necessary to make sure the
// frame's document doesn't have a parser associated with it.
// See: https://bugs.chromium.org/p/chromium/issues/detail?id=875354
frame.src = "/common/blank.html";
t.add_cleanup(() => frame.remove());
frame.onload = t.step_func(() => {
// Make sure there is no parser. Firefox seems to have an additional
// non-spec-compliant readiness state "uninitialized", so test for the
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you file/link to a bug for this?

// two known valid readiness states instead.
// See: https://bugzilla.mozilla.org/show_bug.cgi?id=1191683
assert_in_array(frame.contentDocument.readyState, ["interactive", "complete"]);
testBody(t, frame, doc => {});
});
Expand All @@ -49,14 +52,8 @@ function taskTest(description, testBody) {
}

taskTest("timeout", (t, frame, open) => {
let happened = false;
// Work around the lint script, since we can't use step_timeout here.
frame.contentWindow['setTimeout'](() => happened = true, 100);
frame.contentWindow.setTimeout(t.step_func_done(), 100);
open(frame.contentDocument);
t.step_timeout(() => {
assert_true(happened);
t.done();
}, 200);
});

taskTest("window message", (t, frame, open) => {
Expand Down
1 change: 1 addition & 0 deletions lint.whitelist
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ SET TIMEOUT: html/semantics/embedded-content/the-iframe-element/*
SET TIMEOUT: html/semantics/embedded-content/the-img-element/*
SET TIMEOUT: html/semantics/scripting-1/the-script-element/*
SET TIMEOUT: html/webappapis/dynamic-markup-insertion/opening-the-input-stream/0*
SET TIMEOUT: html/webappapis/dynamic-markup-insertion/opening-the-input-stream/tasks.window.js
SET TIMEOUT: html/webappapis/scripting/event-loops/*
SET TIMEOUT: html/webappapis/scripting/events/event-handler-processing-algorithm-error/*
SET TIMEOUT: html/webappapis/scripting/processing-model-2/*
Expand Down