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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/dom/webtiming-navigate-within-document.html

Issue 2667393002: Stop using script-tests in fast/dom/. (Closed)
Patch Set: . 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 PUBLIC "-//IETF//DTD HTML//EN"> 1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2 <html> 2 <html>
3 <head> 3 <head>
4 <script src="../../resources/js-test.js"></script> 4 <script src="../../resources/js-test.js"></script>
5 </head> 5 </head>
6 <body> 6 <body>
7 <script src="script-tests/webtiming-navigate-within-document.js"></script> 7 <script>
8 description("This test checks that navigating within the document does not reset Web Timing numbers.");
9
10 window.performance = window.performance || {};
11 var timing = performance.timing || {};
12
13 function checkTimingNotChanged()
14 {
15 var properties = getAllPropertyNames(timing);
16 for (var i = 0; i < properties.length; ++i) {
17 var property = properties[i];
18 if (timing[property] === initialTiming[property])
19 testPassed(property + " is unchanged.");
20 else
21 testFailed(property + " changed.");
22 }
23 finishJSTest();
24 }
25
26 var initialTiming = {};
27 function saveTimingAfterLoad()
28 {
29 for (var property in timing) {
30 initialTiming[property] = timing[property];
31 }
32 window.location.href = "#1";
33 setTimeout("checkTimingNotChanged()", 0);
34 }
35
36 function loadHandler()
37 {
38 window.removeEventListener("load", loadHandler);
39 setTimeout("saveTimingAfterLoad()", 0);
40 }
41 window.addEventListener("load", loadHandler, false);
42
43 jsTestIsAsync = true;
44 </script>
8 </body> 45 </body>
9 </html> 46 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698