OLD | NEW |
1 <html> | 1 <html> |
2 <head> | 2 <head> |
3 <script src="../inspector-test.js"></script> | 3 <script src="../inspector-test.js"></script> |
4 <script src="../resources-test.js"></script> | 4 <script src="../resources-test.js"></script> |
5 <script src="resource-tree-test.js"></script> | 5 <script src="resource-tree-test.js"></script> |
6 | 6 |
7 <link rel="stylesheet" href="resources/styles-initial.css"> | 7 <link rel="stylesheet" href="resources/styles-initial.css"> |
8 | 8 |
9 <script> | 9 <script> |
10 function navigateIframe() | 10 function navigateIframe(url) |
11 { | 11 { |
12 var iframe = document.getElementById("iframe"); | 12 var iframe = document.getElementById("iframe"); |
13 iframe.setAttribute("src", "resources/resource-tree-frame-navigate-iframe-af
ter.html"); | 13 iframe.setAttribute("src", url); |
| 14 return new Promise(x => iframe.onload = x); |
14 } | 15 } |
15 | 16 |
16 function test() | 17 async function test() |
17 { | 18 { |
18 InspectorTest.addResult("Before navigation"); | 19 InspectorTest.addResult("Before navigation"); |
19 InspectorTest.addResult("===================================="); | 20 InspectorTest.addResult("===================================="); |
| 21 await InspectorTest.evaluateInPageAsync('navigateIframe("resources/resource-
tree-frame-navigate-iframe-before.html")'); |
20 InspectorTest.dumpResourceTreeEverything(); | 22 InspectorTest.dumpResourceTreeEverything(); |
21 InspectorTest.addConsoleSniffer(step2); | |
22 InspectorTest.evaluateInPage("navigateIframe()"); | |
23 | 23 |
24 function step2() | 24 InspectorTest.addResult(""); |
25 { | 25 InspectorTest.addResult("After navigation"); |
26 InspectorTest.addResult(""); | 26 InspectorTest.addResult("===================================="); |
27 InspectorTest.addResult("After navigation"); | 27 await InspectorTest.evaluateInPageAsync('navigateIframe("resources/resource-
tree-frame-navigate-iframe-after.html")'); |
28 InspectorTest.addResult("===================================="); | 28 InspectorTest.dumpResourceTreeEverything(); |
29 InspectorTest.dumpResourceTreeEverything(); | 29 InspectorTest.completeTest(); |
30 InspectorTest.completeTest(); | |
31 } | |
32 } | 30 } |
33 | 31 |
34 </script> | 32 </script> |
35 | 33 |
36 </head> | 34 </head> |
37 | 35 |
38 <body> | 36 <body onload='runTest()'> |
39 <p> | 37 <p> |
40 Tests resource tree model on iframe navigation, compares resource tree against g
olden. Every line is important. | 38 Tests resource tree model on iframe navigation, compares resource tree against g
olden. Every line is important. |
41 </p> | 39 </p> |
42 | 40 |
43 <iframe id="iframe" src="resources/resource-tree-frame-navigate-iframe-before.ht
ml" onload="runTest()"> | 41 <iframe id="iframe"> |
44 | 42 |
45 </body> | 43 </body> |
46 </html> | 44 </html> |
OLD | NEW |