Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrap event handlers in Client Hints tests in t.step_func #17164

Merged
merged 1 commit into from
Jun 4, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
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
4 changes: 2 additions & 2 deletions client-hints/accept_ch.tentative.https.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,15 @@
}, "Precondition: Test that the browser does not have client hints preferences cached");

async_test(t => {
window.addEventListener('message', function(e) {
window.addEventListener('message', t.step_func(function(e) {
if(!e.source.location.pathname.includes("do_not_expect_client_hints_headers.html")) {
return;
}
if(typeof e.data != "string")
return;
assert_equals(e.data, "PASS");
t.done();
})
}));
}, "Loading of resources/do_not_expect_client_hints_headers.html did not finish.");

function acceptChLoaded() {
Expand Down
4 changes: 2 additions & 2 deletions client-hints/accept_ch_lifetime.tentative.https.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,15 @@
}, "Precondition: Test that the browser does not have client hints preferences cached");

async_test(t => {
window.addEventListener('message', function(e) {
window.addEventListener('message', t.step_func(function(e) {
if(!e.source.location.pathname.includes("expect_client_hints_headers.html")) {
return;
}
if(typeof e.data != "string")
return;
assert_equals(e.data, "PASS");
t.done();
})
}));
}, "Loading of resources/expect_client_hints_headers.html did not finish.");


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,15 @@
}, "Precondition: Test that the browser does not have client hints preferences cached");

async_test(t => {
window.addEventListener('message', function(e) {
window.addEventListener('message', t.step_func(function(e) {
if(!e.source.location.pathname.includes("do_not_expect_client_hints_headers.html")) {
return;
}
if(typeof e.data != "string")
return;
assert_equals(e.data, "PASS");
t.done();
})
}));
}, "Loading of resources/do_not_expect_client_hints_headers.html did not finish.");

function acceptChLifetimeLoaded() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,15 @@
}, "Test receiving Accept-CH-Lifetime header");

async_test(t => {
window.addEventListener('message', function(e) {
window.addEventListener('message', t.step_func(function(e) {
if(!e.source.location.pathname.includes("do_not_expect_client_hints_headers.html")) {
return;
}
if(typeof e.data != "string")
return;
assert_equals(e.data, "PASS");
t.done();
})
}));
}, "Loading of resources/do_not_expect_client_hints_headers.html did not finish.");

</script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,15 @@
}, "Precondition: Test that the browser does not have client hints preferences cached");

async_test(t => {
window.addEventListener('message', function(e) {
window.addEventListener('message', t.step_func(function(e) {
if(!e.source.location.pathname.includes("expect_client_hints_headers.html")) {
return;
}
if(typeof e.data != "string")
return;
assert_equals(e.data, "PASS");
t.done();
})
}));
}, "Loading of resources/expect_client_hints_headers.html did not finish.");

function acceptChLifetimeLoaded() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,15 @@
}, "Precondition: Test that the browser does not have client hints preferences cached");

async_test(t => {
window.addEventListener('message', function(e) {
window.addEventListener('message', t.step_func(function(e) {
if(!e.source.location.pathname.includes("do_not_expect_client_hints_headers.html")) {
return;
}
if(typeof e.data != "string")
return;
assert_equals(e.data, "PASS");
t.done();
})
}));
}, "Loading of resources/do_not_expect_client_hints_headers.html did not finish.");

function acceptChLifetimeLoaded() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,15 @@
}, "Test receiving Accept-CH-Lifetime header");

async_test(t => {
window.addEventListener('message', function(e) {
window.addEventListener('message', t.step_func(function(e) {
if(!e.source.location.pathname.includes("do_not_expect_client_hints_headers.html")) {
return;
}
if(typeof e.data != "string")
return;
assert_equals(e.data, "PASS");
t.done();
})
}));
}, "Loading of resources/do_not_expect_client_hints_headers.html did not finish.");


Expand Down