Chromium Code Reviews| OLD | NEW |
|---|---|
| 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> |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 63 var entries = entryList.getEntries(); | 63 var entries = entryList.getEntries(); |
| 64 assert_equals(entries[0].entryType, "navigation", | 64 assert_equals(entries[0].entryType, "navigation", |
| 65 "Expected entryType to be: navigation."); | 65 "Expected entryType to be: navigation."); |
| 66 assert_equals(entries[0].name, "http://web-platform.test:800 1/navigation-timing/nav2_test_attributes_values.html"); | 66 assert_equals(entries[0].name, "http://web-platform.test:800 1/navigation-timing/nav2_test_attributes_values.html"); |
| 67 assert_equals(entries[0].startTime, 0, | 67 assert_equals(entries[0].startTime, 0, |
| 68 "Expected startTime to be: 0."); | 68 "Expected startTime to be: 0."); |
| 69 assert_equals(entries[0].duration, entries[0].loadEventEnd, | 69 assert_equals(entries[0].duration, entries[0].loadEventEnd, |
| 70 "Expected duration to be equal to loadEventEnd."); | 70 "Expected duration to be equal to loadEventEnd."); |
| 71 assert_equals(entries[0].initiatorType, "navigation", | 71 assert_equals(entries[0].initiatorType, "navigation", |
| 72 "Expected initiatorType to be: navigation."); | 72 "Expected initiatorType to be: navigation."); |
| 73 assert_equals(entries[0].nextHopProtocol, "foo"); | |
|
Yoav Weiss
2017/06/10 05:31:33
Why is it "foo"?
shaseley
2017/06/13 23:14:17
Done.
| |
| 73 // This test may fail when response is from cach. Disable or clean cach before | 74 // This test may fail when response is from cach. Disable or clean cach before |
| 74 // running this test. | 75 // running this test. |
| 75 assert_true(entries[0].transferSize > entries[0].encodedBody Size, | 76 assert_true(entries[0].transferSize > entries[0].encodedBody Size, |
| 76 "Expected transferSize to be greater than encodedBodySiz e in uncached navigation."); | 77 "Expected transferSize to be greater than encodedBodySiz e in uncached navigation."); |
| 77 assert_equals(entries[0].encodedBodySize, 4154); | 78 assert_equals(entries[0].encodedBodySize, 4154); |
| 78 assert_equals(entries[0].decodedBodySize, 4154); | 79 assert_equals(entries[0].decodedBodySize, 4154); |
| 79 verifyTimingEventOrder(entries[0], navTiming2EventOrder1); | 80 verifyTimingEventOrder(entries[0], navTiming2EventOrder1); |
| 80 // When unloadEvent happens | 81 // When unloadEvent happens |
| 81 if (entries[0]["unloadEventStart"] != 0) { | 82 if (entries[0]["unloadEventStart"] != 0) { |
| 82 verifyTimingEventOrder(entries[0], navTiming2EventOrder2 ); | 83 verifyTimingEventOrder(entries[0], navTiming2EventOrder2 ); |
| 83 } | 84 } |
| 84 // When a secure transport is used | 85 // When a secure transport is used |
| 85 if (entries[0]["secureConnectionStart"] != 0) { | 86 if (entries[0]["secureConnectionStart"] != 0) { |
| 86 verifyTimingEventOrder(entries[0], navTiming2EventOrder3 ); | 87 verifyTimingEventOrder(entries[0], navTiming2EventOrder3 ); |
| 87 } | 88 } |
| 88 observer.disconnect(); | 89 observer.disconnect(); |
| 89 t.done(); | 90 t.done(); |
| 90 }) | 91 }) |
| 91 ); | 92 ); |
| 92 observer.observe({entryTypes: ["navigation"]}); | 93 observer.observe({entryTypes: ["navigation"]}); |
| 93 | 94 |
| 94 }, "Performance navigation timing instance's value is reasonable."); | 95 }, "Performance navigation timing instance's value is reasonable."); |
| 95 </script> | 96 </script> |
| 96 </body> | 97 </body> |
| 97 </html> | 98 </html> |
| OLD | NEW |