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

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/misc/performance-entry-serializer.html

Issue 2962113002: Updates to Server-Timing in accordance with with spec changes (Closed)
Patch Set: fix web-platform-tests Created 3 years, 5 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 unified diff | Download patch
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <script src="/w3c/resources/testharness.js"></script> 2 <script src="/w3c/resources/testharness.js"></script>
3 <script src="/w3c/resources/testharnessreport.js"></script> 3 <script src="/w3c/resources/testharnessreport.js"></script>
4 <script> 4 <script>
5 5
6 test(function() { 6 test(function() {
7 window.performance.mark('mark1'); 7 window.performance.mark('mark1');
8 window.performance.mark('mark2'); 8 window.performance.mark('mark2');
9 window.performance.measure('measure1', 'mark1', 'mark2'); 9 window.performance.measure('measure1', 'mark1', 'mark2');
10 10
11 var entries = window.performance.getEntries(); 11 var entries = window.performance.getEntries();
12 for (var i = 0; i < entries.length; i++) { 12 for (var i = 0; i < entries.length; i++) {
13 var entry = entries[i]; 13 var entry = entries[i];
14 var serialized = JSON.parse(JSON.stringify(entry)); 14 var serialized = JSON.parse(JSON.stringify(entry));
15 for (var attr in entry) { 15 for (var attr in entry) {
16 if (typeof entry[attr] != 'function') { 16 if (typeof entry[attr] != 'function') {
17 assert_equals(serialized[attr], entry[attr], entry.constructor.n ame + '.' + attr); 17 var assertMethod = assert_equals
18 if (Array.isArray(serialized[attr]) && Array.isArray(entry[attr] )) {
19 assertMethod = assert_array_equals
20 }
21 assertMethod(serialized[attr], entry[attr], entry.constructor.na me + '.' + attr);
18 } 22 }
19 } 23 }
20 } 24 }
21 }, 'PerformanceEntry subclasses should serialize all attributes'); 25 }, 'PerformanceEntry subclasses should serialize all attributes');
22 26
23 </script> 27 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698