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="../security-test.js"></script> | 4 <script src="../security-test.js"></script> |
5 <script> | 5 <script> |
6 function test() | 6 function test() |
7 { | 7 { |
8 | 8 |
9 var request1 = new SDK.NetworkRequest(InspectorTest.mainTarget, 0, "https://
foo.test/", "https://foo.test", 0, 0, null); | 9 var request1 = new SDK.NetworkRequest(InspectorTest.networkManager, Inspecto
rTest.NetworkAgent, 0, "https://foo.test/", "https://foo.test", 0, 0, null); |
10 request1.setSecurityState(Protocol.Security.SecurityState.Secure); | 10 request1.setSecurityState(Protocol.Security.SecurityState.Secure); |
11 InspectorTest.dispatchRequestFinished(request1); | 11 InspectorTest.dispatchRequestFinished(request1); |
12 | 12 |
13 var request2 = new SDK.NetworkRequest(InspectorTest.mainTarget, 0, "https://
bar.test/foo.jpg", "https://bar.test", 0, 0, null); | 13 var request2 = new SDK.NetworkRequest(InspectorTest.networkManager, Inspecto
rTest.NetworkAgent, 0, "https://bar.test/foo.jpg", "https://bar.test", 0, 0, nul
l); |
14 request2.setSecurityState(Protocol.Security.SecurityState.Secure); | 14 request2.setSecurityState(Protocol.Security.SecurityState.Secure); |
15 InspectorTest.dispatchRequestFinished(request2); | 15 InspectorTest.dispatchRequestFinished(request2); |
16 | 16 |
17 InspectorTest.addResult("Before interstitial is shown:"); | 17 InspectorTest.addResult("Before interstitial is shown:"); |
18 InspectorTest.dumpDeepInnerHTML(Security.SecurityPanel._instance()._sidebarT
ree.element); | 18 InspectorTest.dumpDeepInnerHTML(Security.SecurityPanel._instance()._sidebarT
ree.element); |
19 | 19 |
20 // Test that the sidebar is hidden when an interstitial is shown. https://cr
bug.com/559150 | 20 // Test that the sidebar is hidden when an interstitial is shown. https://cr
bug.com/559150 |
21 InspectorTest.mainTarget.model(SDK.ResourceTreeModel).dispatchEventToListene
rs(SDK.ResourceTreeModel.Events.InterstitialShown); | 21 InspectorTest.mainTarget.model(SDK.ResourceTreeModel).dispatchEventToListene
rs(SDK.ResourceTreeModel.Events.InterstitialShown); |
22 // Simulate a request finishing after the interstitial is shown, to make sur
e that doesn't show up in the sidebar. | 22 // Simulate a request finishing after the interstitial is shown, to make sur
e that doesn't show up in the sidebar. |
23 var request3 = new SDK.NetworkRequest(InspectorTest.mainTarget, 0, "https://
bar.test/foo.jpg", "https://bar.test", 0, 0, null); | 23 var request3 = new SDK.NetworkRequest(InspectorTest.networkManager, Inspecto
rTest.NetworkAgent, 0, "https://bar.test/foo.jpg", "https://bar.test", 0, 0, nul
l); |
24 request3.setSecurityState(Protocol.Security.SecurityState.Unknown); | 24 request3.setSecurityState(Protocol.Security.SecurityState.Unknown); |
25 InspectorTest.dispatchRequestFinished(request3); | 25 InspectorTest.dispatchRequestFinished(request3); |
26 InspectorTest.addResult("After interstitial is shown:"); | 26 InspectorTest.addResult("After interstitial is shown:"); |
27 InspectorTest.dumpDeepInnerHTML(Security.SecurityPanel._instance()._sidebarT
ree.element); | 27 InspectorTest.dumpDeepInnerHTML(Security.SecurityPanel._instance()._sidebarT
ree.element); |
28 | 28 |
29 // Test that the sidebar is shown again when the interstitial is hidden. htt
ps://crbug.com/559150 | 29 // Test that the sidebar is shown again when the interstitial is hidden. htt
ps://crbug.com/559150 |
30 InspectorTest.mainTarget.model(SDK.ResourceTreeModel).dispatchEventToListene
rs(SDK.ResourceTreeModel.Events.InterstitialHidden); | 30 InspectorTest.mainTarget.model(SDK.ResourceTreeModel).dispatchEventToListene
rs(SDK.ResourceTreeModel.Events.InterstitialHidden); |
31 InspectorTest.addResult("After interstitial is hidden:"); | 31 InspectorTest.addResult("After interstitial is hidden:"); |
32 InspectorTest.dumpDeepInnerHTML(Security.SecurityPanel._instance()._sidebarT
ree.element); | 32 InspectorTest.dumpDeepInnerHTML(Security.SecurityPanel._instance()._sidebarT
ree.element); |
33 | 33 |
34 InspectorTest.completeTest(); | 34 InspectorTest.completeTest(); |
35 } | 35 } |
36 </script> | 36 </script> |
37 </head> | 37 </head> |
38 <body onload="runTest()"> | 38 <body onload="runTest()"> |
39 <p>Tests that the sidebar origin list disappears and appers when an interstitial
is shown or hidden.</p> | 39 <p>Tests that the sidebar origin list disappears and appers when an interstitial
is shown or hidden.</p> |
40 </body> | 40 </body> |
41 </html> | 41 </html> |
OLD | NEW |