From 88ccb362a5d4786a10ab179032682ae64098a34c Mon Sep 17 00:00:00 2001 From: Kunihiko Sakamoto Date: Fri, 1 Feb 2019 13:40:54 +0000 Subject: [PATCH] Bug 1523562 [wpt PR 15075] - Fix preload tests failing on wpt.fyi dashboard, second attempt, a=testonly Automatic update from web-platform-tests Fix preload tests failing on wpt.fyi dashboard, second attempt https://crrev.com/c/1411963 fixed the url conflicts with other tests, but the test still flakes when running repeatedly, because the resource is loaded from disk cache in subsequent runs (https://github.com/web-platform-tests/wpt/pull/14882). We don't care if the preloaded resources came from cache in these tests, so let's just verify the number of Resource Timing entries. Bug: 922343 Change-Id: I2c1d146856a125dbbb641d7efb4e6151094f6a3e Reviewed-on: https://chromium-review.googlesource.com/c/1436777 Reviewed-by: Kinuko Yasuda Commit-Queue: Kunihiko Sakamoto Cr-Commit-Position: refs/heads/master@{#626019} -- wpt-commits: a52ae0c66f4a764f036d6b85e9d2e611acf45383 wpt-pr: 15075 --- .../preload/link-header-preload-nonce.html | 4 ++-- .../link-header-preload-srcset.tentative.html | 20 +++++++++---------- .../tests/preload/resources/preload_helper.js | 6 ++++++ 3 files changed, 18 insertions(+), 12 deletions(-) diff --git a/testing/web-platform/tests/preload/link-header-preload-nonce.html b/testing/web-platform/tests/preload/link-header-preload-nonce.html index 51b2224864d5..240d6f11dd59 100644 --- a/testing/web-platform/tests/preload/link-header-preload-nonce.html +++ b/testing/web-platform/tests/preload/link-header-preload-nonce.html @@ -9,8 +9,8 @@ diff --git a/testing/web-platform/tests/preload/link-header-preload-srcset.tentative.html b/testing/web-platform/tests/preload/link-header-preload-srcset.tentative.html index 9eb8ac4e00d2..024da965796f 100644 --- a/testing/web-platform/tests/preload/link-header-preload-srcset.tentative.html +++ b/testing/web-platform/tests/preload/link-header-preload-srcset.tentative.html @@ -11,16 +11,16 @@ diff --git a/testing/web-platform/tests/preload/resources/preload_helper.js b/testing/web-platform/tests/preload/resources/preload_helper.js index 5a23be74b8df..b2cf8323db01 100644 --- a/testing/web-platform/tests/preload/resources/preload_helper.js +++ b/testing/web-platform/tests/preload/resources/preload_helper.js @@ -20,3 +20,9 @@ function verifyNumberOfDownloads(url, number) }); assert_equals(numDownloads, number, url); } + +function verifyNumberOfResourceTimingEntries(url, number) +{ + var numEntries = performance.getEntriesByName(getAbsoluteURL(url)).length; + assert_equals(numEntries, number, url); +}