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

Unified Diff: third_party/WebKit/LayoutTests/external/wpt/server-timing/test_server_timing.html

Issue 2839683003: Server-Timing (Closed)
Patch Set: make those robots happy, attempt #4 Created 3 years, 8 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
Index: third_party/WebKit/LayoutTests/external/wpt/server-timing/test_server_timing.html
diff --git a/third_party/WebKit/LayoutTests/external/wpt/server-timing/test_server_timing.html b/third_party/WebKit/LayoutTests/external/wpt/server-timing/test_server_timing.html
new file mode 100644
index 0000000000000000000000000000000000000000..2a6ffa264999e9b9b151c4f133e55739f688dc93
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/external/wpt/server-timing/test_server_timing.html
@@ -0,0 +1,50 @@
+<!DOCTYPE html>
+<head>
+ <meta charset='utf-8' />
+ <script src="/resources/testharness.js"></script>
+ <script src='/resources/testharnessreport.js'></script>
+ <script src='resources/webperftestharness.js'></script>
+ <script src="/common/performance-timeline-utils.js"></script>
+ <script>
+ setup({explicit_done: true})
+
+ window.addEventListener('load', function() {
+ // there should be exactly two server-timing entries, 1 for document, 1 for img#one
+ test_entries(performance.getEntriesByType('server'), [{
+ name: document.location.href,
+ entryType: 'server',
+ startTime: 0,
+ duration: 1.2,
+ metric: 'metric1',
+ description: 'document',
+ }, {
+ name: document.querySelector('img#one').src,
+ entryType: 'server',
+ startTime: 0,
+ duration: 3.4,
+ metric: 'metric2',
+ description: 'blue.png',
+ }])
+
+ new PerformanceObserver(function(entryList, observer) {
+ // there should be exactly one server-timing entry, 1 for img#two
+ test_entries(entryList.getEntriesByType('server'), [{
+ name: document.querySelector('img#two').src,
+ entryType: 'server',
+ startTime: 0,
+ duration: 5.6,
+ metric: 'metric3',
+ description: 'green.png',
+ }])
+ observer.disconnect()
+ done()
+ }).observe({entryTypes: ['server']})
+
+ var img = document.createElement('img')
+ img.id = 'two'
+ img.src = './resources/green.png'
+ document.getElementsByTagName('script')[0].parentNode.appendChild(img)
+ })
+ </script>
+</head>
+<img id='one' src='resources/blue.png'>

Powered by Google App Engine
This is Rietveld 408576698