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

Side by Side Diff: third_party/WebKit/LayoutTests/external/wpt/navigation-timing/test_timing_reload.html

Issue 2676573004: Import wpt@6010f54a979d242f657b284bae53c2b218c533f4 (Closed)
Patch Set: Update test expectations and baselines. 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
(Empty)
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <meta charset="utf-8" />
5 <title>window.performance.timing attributes after a reloaded navigation< /title>
6 <link rel="author" title="Microsoft" href="http://www.microsoft.com/" />
7 <link rel="help" href="http://www.w3.org/TR/navigation-timing/#sec-navig ation-timing-interface"/>
8 <script src="/resources/testharness.js"></script>
9 <script src="/resources/testharnessreport.js"></script>
10 <script src="resources/webperftestharness.js"></script>
11 <script>
12 setup({explicit_done: true});
13
14 // explicitly test the namespace before we start testing
15 test_namespace('navigation');
16
17 var reload_frame;
18 var initial_timing;
19
20 function onload_test()
21 {
22 reload_frame = document.getElementById("frameContext");
23
24 if (reload_frame.contentWindow.performance === undefined)
25 {
26 // avoid script errors
27 done();
28 return;
29 }
30
31 reload_frame.onload = do_test;
32
33 // save frame's initial timings
34 initial_timing = {};
35 var timing = reload_frame.contentWindow.performance.timing;
36
37 for (var i = 0; i < timingAttributes.length; ++i)
38 {
39 var property = timingAttributes[i];
40 initial_timing[property] = timing[property];
41 }
42
43 setTimeout("reload_the_frame();", 100);
44 }
45
46 function reload_the_frame()
47 {
48 reload_frame.contentWindow.location.reload(true);
49 }
50
51 function do_test()
52 {
53 reload_frame.onload = "";
54
55 // ensure the frame reloaded
56 test_equals(reload_frame.contentWindow.performance.navigation.ty pe,
57 performanceNamespace.navigation.TYPE_RELOAD,
58 "window.performance.navigation.type == TYPE_RELOAD", {help:"http://www.w3.org/TR/navigation-timing/#sec-navigation-info-interface"}) ;
59
60 // ensure reload timings changed
61 var timing = reload_frame.contentWindow.performance.timing;
62 for (var i = 0; i < timingAttributes.length; ++i)
63 {
64 var property = timingAttributes[i];
65
66 // ignore any timings that were zero initially
67 if (initial_timing[property] !== 0)
68 {
69 test_not_equals(timing[property], initial_timing[propert y],
70 property + " is different after the reload.");
71 }
72 }
73
74 done();
75 }
76 </script>
77 </head>
78 <body onload="onload_test();">
79 <h1>Description</h1>
80 <p>This test validates that the window.performance.timing attributes cha nge when a page is reloaded.</p>
81
82 <p>This page should be loaded with a green background frame below. The frame will be automatically reloaded
83 and then verified that the window.performance.timing attributes have bee n updated to the new reloaded navigation timings.</p>
84
85 <div id="log"></div>
86 <br />
87 <iframe id="frameContext" src="resources/blank_page_green.html" style="w idth: 250px; height: 250px;"></iframe>
88
89 </body>
90 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698