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

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/w3c/webperf/approved/navigation-timing/html/nav2_test_instance_accessors.html

Issue 2675973004: Update NT2 name to be the requested URL instead of 'document' (Closed)
Patch Set: fix failing wpt tests (imported after creation of this CL), and delete a redundant, old test Created 3 years, 10 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 <html> 2 <html>
3 <head> 3 <head>
4 <meta charset="utf-8"> 4 <meta charset="utf-8">
5 <title>Navigation Timing 2 WPT</title> 5 <title>Navigation Timing 2 WPT</title>
6 <link rel="author" title="Google" href="http://www.google.com/" /> 6 <link rel="author" title="Google" href="http://www.google.com/" />
7 <link rel="help" href="http://www.w3.org/TR/navigation-timing-2/#sec-Per formanceNavigationTiming"/> 7 <link rel="help" href="http://www.w3.org/TR/navigation-timing-2/#sec-Per formanceNavigationTiming"/>
8 <script src="/resources/testharness.js"></script> 8 <script src="/resources/testharness.js"></script>
9 <script src="/resources/testharnessreport.js"></script> 9 <script src="/resources/testharnessreport.js"></script>
10 </head> 10 </head>
11 <body> 11 <body>
12 <h1>Description</h1> 12 <h1>Description</h1>
13 <p>This test validates that nav timing 2 instance can be accessed by thr ee different accessors once available: window.performance.getEntries()/getEntrie sByType("navigation")/getEntriesByName("document")</p> 13 <p>This test validates that nav timing 2 instance can be accessed by thr ee different accessors once available: window.performance.getEntries()/getEntrie sByType("navigation")/getEntriesByName("<Requested URL>")</p>
14 14
15 <script> 15 <script>
16 var navTiming2Attributes = [ 16 var navTiming2Attributes = [
17 'connectEnd', 17 'connectEnd',
18 'connectStart', 18 'connectStart',
19 'decodedBodySize', 19 'decodedBodySize',
20 'domComplete', 20 'domComplete',
21 'domContentLoadedEventEnd', 21 'domContentLoadedEventEnd',
22 'domContentLoadedEventStart', 22 'domContentLoadedEventStart',
23 'domInteractive', 23 'domInteractive',
(...skipping 19 matching lines...) Expand all
43 'unloadEventEnd', 43 'unloadEventEnd',
44 'unloadEventStart', 44 'unloadEventStart',
45 'workerStart' 45 'workerStart'
46 ]; 46 ];
47 47
48 async_test(function (t) { 48 async_test(function (t) {
49 var observer = new PerformanceObserver( 49 var observer = new PerformanceObserver(
50 t.step_func(function (entryList) { 50 t.step_func(function (entryList) {
51 var instance1 = performance.getEntries()[0]; 51 var instance1 = performance.getEntries()[0];
52 var instance2 = performance.getEntriesByType("navigation")[0 ]; 52 var instance2 = performance.getEntriesByType("navigation")[0 ];
53 var instance3 = performance.getEntriesByName("document")[0]; 53 var instance3 = performance.getEntriesByName("http://127.0.0 .1:8000/w3c/webperf/approved/navigation-timing/html/nav2_test_instance_accessors .html")[0];
54 54
55 assert_equals(performance.getEntriesByType("navigation").len gth, 1, "Expected there is only one navigation timing instance."); 55 assert_equals(performance.getEntriesByType("navigation").len gth, 1, "Expected there is only one navigation timing instance.");
56 assert_equals(performance.getEntriesByName("document").lengt h, 1, "Expected there is only one navigation timing instance."); 56 assert_equals(performance.getEntriesByName("http://127.0.0.1 :8000/w3c/webperf/approved/navigation-timing/html/nav2_test_instance_accessors.h tml").length, 1, "Expected there is only one navigation timing instance.");
57 57
58 for (var i = 0; i < navTiming2Attributes.length; i++) { 58 for (var i = 0; i < navTiming2Attributes.length; i++) {
59 assert_equals(instance1[navTiming2Attributes[i]], instan ce2[navTiming2Attributes[i]]); 59 assert_equals(instance1[navTiming2Attributes[i]], instan ce2[navTiming2Attributes[i]]);
60 } 60 }
61 61
62 for (var i = 0; i < navTiming2Attributes.length; i++) { 62 for (var i = 0; i < navTiming2Attributes.length; i++) {
63 assert_equals(instance1[navTiming2Attributes[i]], instan ce3[navTiming2Attributes[i]]); 63 assert_equals(instance1[navTiming2Attributes[i]], instan ce3[navTiming2Attributes[i]]);
64 } 64 }
65 observer.disconnect(); 65 observer.disconnect();
66 t.done(); 66 t.done();
67 }) 67 })
68 ); 68 );
69 observer.observe({entryTypes: ["navigation"]}); 69 observer.observe({entryTypes: ["navigation"]});
70 70
71 }, "Performance navigation timing entries are accessible through three d ifferent accessors."); 71 }, "Performance navigation timing entries are accessible through three d ifferent accessors.");
72 </script> 72 </script>
73 </body> 73 </body>
74 </html> 74 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698