Commit 62421818 authored by Chromium WPT Sync's avatar Chromium WPT Sync Committed by Commit Bot

Import wpt@71e901cf4534417abfabe4d77a317817f5cc09db

Using wpt-import in Chromium 2bfdf22c.
With Chromium commits locally applied on WPT:
1c633d48 "Snap the snapped_dest_rect for backgrounds"
1061788d "Reland "Add quota usage details tests for all other storage backends.""
e9314f41 "Fix resource-timing.html document.domain test"
bcd3934d "Add a test for ServiceWorker and AppCache interaction with claim()"
4836c563 "Change web platform test with mouse inputs under "pinterevents/""


Note to sheriffs: This CL imports external tests and adds
expectations for those tests; if this CL is large and causes
a few new failures, please fix the failures by adding new
lines to TestExpectations rather than reverting. See:
https://chromium.googlesource.com/chromium/src/+/master/docs/testing/web_platform_tests.md

Directory owners for changes in this CL:
ksakamoto@chromium.org:
  external/wpt/resource-timing

NOAUTOREVERT=true
TBR=robertma

No-Export: true
Change-Id: I765f112223b7604f3a33563797575d2d9e76df1d
Reviewed-on: https://chromium-review.googlesource.com/c/1395564Reviewed-by: default avatarWPT Autoroller <wpt-autoroller@chops-service-accounts.iam.gserviceaccount.com>
Commit-Queue: WPT Autoroller <wpt-autoroller@chops-service-accounts.iam.gserviceaccount.com>
Cr-Commit-Position: refs/heads/master@{#619878}
parent 1a74620f
...@@ -72,6 +72,9 @@ promise_test(async () => { ...@@ -72,6 +72,9 @@ promise_test(async () => {
await loadRandomResource(); await loadRandomResource();
await waitForEventToFire(); await waitForEventToFire();
await clearAndAddAnotherEntryToBuffer(); await clearAndAddAnotherEntryToBuffer();
// Since we have no strict guarantees when an entry will be added to the
// buffer, waiting till next task to try to avoid flakiness.
await waitForNextTask();
await testThatEntryWasAdded(); await testThatEntryWasAdded();
}, "Test that entry was added to the buffer after a buffer full event"); }, "Test that entry was added to the buffer after a buffer full event");
</script> </script>
This is a testharness.js-based test.
FAIL Make sure that resources fetched by cross origin CSS are not in the timeline. assert_equals: Import should not be in timeline expected 0 but got 1
Harness: the test ran to completion.
<!DOCTYPE HTML>
<meta charset=utf-8>
<title>Make sure that resources fetched by cross origin CSS are not in the timeline.</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<body>
<!-- The stylesheet is fetched from http://www1.web–platform.test:64941/resource-timing/resources/nested.css -->
<link rel=stylesheet id=cross_origin_style href="//{{domains[www1]}}:{{ports[http][1]}}{{location[path]}}/../resources/nested.css">
<script>
const t = async_test("Make sure that resources fetched by cross origin CSS are not in the timeline.");
window.addEventListener("load", function() {
// A timeout is needed as entries are not guaranteed to be in the timeline before onload triggers.
t.step_timeout(function() {
const url = (new URL(document.getElementById("cross_origin_style").href));
const prefix = url.protocol + "//" + url.host;
assert_equals(performance.getEntriesByName(prefix + "/resource-timing/resources/resource_timing_test0.css?id=n1").length, 0, "Import should not be in timeline");
assert_equals(performance.getEntriesByName(prefix + "/fonts/Ahem.ttf?id=n1").length, 0, "Font should not be in timeline");
assert_equals(performance.getEntriesByName(prefix + "/resource-timing/resources/blue.png?id=n1").length, 0, "Image should not be in timeline");
t.done();
},100);
});
</script>
<ol>Some content</ol>
</body>
...@@ -49,6 +49,7 @@ function test_fail(msg, properties) ...@@ -49,6 +49,7 @@ function test_fail(msg, properties)
function test_resource_entries(entries, expected_entries) function test_resource_entries(entries, expected_entries)
{ {
test(function() {
// This is slightly convoluted so that we can sort the output. // This is slightly convoluted so that we can sort the output.
var actual_entries = {}; var actual_entries = {};
var origin = window.location.protocol + "//" + window.location.host; var origin = window.location.protocol + "//" + window.location.host;
...@@ -60,14 +61,14 @@ function test_resource_entries(entries, expected_entries) ...@@ -60,14 +61,14 @@ function test_resource_entries(entries, expected_entries)
if (entry.name == origin + expected_entry) { if (entry.name == origin + expected_entry) {
found = true; found = true;
if (expected_entry in actual_entries) { if (expected_entry in actual_entries) {
test_fail(expected_entry + ' is not expected to have duplicate entries'); assert_unreached(expected_entry + ' is not expected to have duplicate entries');
} }
actual_entries[expected_entry] = entry; actual_entries[expected_entry] = entry;
break; break;
} }
} }
if (!found) { if (!found) {
test_fail(entries[i].name + ' is not expected to be in the Resource Timing buffer'); assert_unreached(entries[i].name + ' is not expected to be in the Resource Timing buffer');
} }
} }
...@@ -78,16 +79,18 @@ function test_resource_entries(entries, expected_entries) ...@@ -78,16 +79,18 @@ function test_resource_entries(entries, expected_entries)
sorted_urls.sort(); sorted_urls.sort();
for (var i in sorted_urls) { for (var i in sorted_urls) {
var url = sorted_urls[i]; var url = sorted_urls[i];
test_equals(actual_entries[url].initiatorType, assert_equals(actual_entries[url].initiatorType,
expected_entries[url], expected_entries[url],
origin + url + ' is expected to have initiatorType ' + expected_entries[url]); origin + url + ' is expected to have initiatorType ' + expected_entries[url]);
} }
for (var j in expected_entries) { for (var j in expected_entries) {
if (!(j in actual_entries)) { if (!(j in actual_entries)) {
test_fail(origin + j + ' is expected to be in the Resource Timing buffer'); assert_unreached(origin + j + ' is expected to be in the Resource Timing buffer');
} }
} }
}, "Testing resource entries");
} }
function performance_entrylist_checker(type) function performance_entrylist_checker(type)
{ {
var entryType = type; var entryType = type;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment