Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(97)

Unified Diff: LayoutTests/http/tests/workers/resources/performance-timeline-worker.js

Issue 1184403003: Offer Resource Timing in workers (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: style fix Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | Source/core/core.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/http/tests/workers/resources/performance-timeline-worker.js
diff --git a/LayoutTests/http/tests/workers/resources/performance-timeline-worker.js b/LayoutTests/http/tests/workers/resources/performance-timeline-worker.js
index 97cc588c7d19d9a35476e3671208b10e092472de..b843fd29601a3770c7a7c47a41a74be6b8d947e6 100644
--- a/LayoutTests/http/tests/workers/resources/performance-timeline-worker.js
+++ b/LayoutTests/http/tests/workers/resources/performance-timeline-worker.js
@@ -28,4 +28,22 @@ promise_test(function(test) {
});
}, 'User Timing');
+promise_test(function(test) {
+ return fetch('../../resources/dummy.txt')
+ .then(function(resp) {
+ return resp.text();
+ })
+ .then(function(t) {
+ var expectedResources = ['/resources/testharness.js', '/resources/dummy.txt'];
+ assert_equals(performance.getEntriesByType('resource').length, expectedResources.length);
+ for (var i = 0; i < expectedResources.length; i++) {
+ var entry = performance.getEntriesByType('resource')[i];
+ assert_true(entry.name.endsWith(expectedResources[i]));
+ assert_equals(entry.workerStart, 0);
+ assert_greater_than(entry.startTime, 0);
+ assert_greater_than(entry.responseEnd, entry.startTime);
+ }
+ });
+ }, 'Resource Timing');
+
done();
« no previous file with comments | « no previous file | Source/core/core.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698