From d2463bf8deaa410a6a34b5c92c0abdb6e94947a6 Mon Sep 17 00:00:00 2001 From: Yoav Weiss Date: Fri, 24 Aug 2018 12:57:44 +0000 Subject: [PATCH] Bug 1480290 [wpt PR 12266] - [client-hints] Detect errors to avoid timeouts, a=testonly Automatic update from web-platform-testsMerge pull request #12266 from bocoup/fix-timeout-client-hints [client-hints] Detect errors to avoid timeouts -- wpt-commits: 3c8cb3edc5ddbe2dba11ea694f07c8aeb2c36ee2 wpt-pr: 12266 --- testing/web-platform/meta/MANIFEST.json | 4 ++-- ...h_lifetime_same_origin_iframe.tentative.https.html | 19 ++++++++++--------- ...h_lifetime_same_origin_iframe.tentative.https.html | 18 ++++++++++-------- 3 files changed, 22 insertions(+), 19 deletions(-) diff --git a/testing/web-platform/meta/MANIFEST.json b/testing/web-platform/meta/MANIFEST.json index 992b51f2b46b..92eb00fbfdfd 100644 --- a/testing/web-platform/meta/MANIFEST.json +++ b/testing/web-platform/meta/MANIFEST.json @@ -434107,7 +434107,7 @@ "testharness" ], "client-hints/accept_ch_lifetime_same_origin_iframe.tentative.https.html": [ - "4d339b6dbf2643d4e69cae887aaff205429a6e7b", + "e828d6718d96ae7da1e6c32fa4967d4db0fd7a4d", "testharness" ], "client-hints/accept_ch_lifetime_subresource.tentative.https.html": [ @@ -434147,7 +434147,7 @@ "testharness" ], "client-hints/http_equiv_accept_ch_lifetime_same_origin_iframe.tentative.https.html": [ - "9f7d1f35096a49aa77e8248a70ad453c3d497474", + "9da173c37913fe9e435d0cd5d03ad265d4bfb9d3", "testharness" ], "client-hints/http_equiv_accept_ch_lifetime_subresource.tentative.https.html": [ diff --git a/testing/web-platform/tests/client-hints/accept_ch_lifetime_same_origin_iframe.tentative.https.html b/testing/web-platform/tests/client-hints/accept_ch_lifetime_same_origin_iframe.tentative.https.html index 4d339b6dbf26..e828d6718d96 100644 --- a/testing/web-platform/tests/client-hints/accept_ch_lifetime_same_origin_iframe.tentative.https.html +++ b/testing/web-platform/tests/client-hints/accept_ch_lifetime_same_origin_iframe.tentative.https.html @@ -39,8 +39,16 @@ promise_test(t => { }); }, "Precondition: Test that the browser does not have client hints preferences cached"); +var acceptChLifetimeLoaded; + async_test(t => { - window.addEventListener('message', function(e) { + acceptChLifetimeLoaded = t.step_func(() => { + // Open a new window. Verify that the user agent attaches the client hints. + var verify_win = window.open("resources/expect_client_hints_headers.html"); + assert_not_equals(verify_win, null, "Popup windows not allowed?"); + }); + + window.addEventListener('message', t.step_func((e) => { if(!e.source.location.pathname.includes("expect_client_hints_headers.html")) { return; } @@ -48,15 +56,8 @@ async_test(t => { return; assert_equals(e.data, "PASS"); t.done(); - }) + })); }, "Loading of resources/expect_client_hints_headers.html did not finish."); - -function acceptChLifetimeLoaded() { - // Open a new window. Verify that the user agent attaches the client hints. - var verify_win = window.open("resources/expect_client_hints_headers.html"); - assert_not_equals(verify_win, null, "Popup windows not allowed?"); -} -