Crash closing window containing Flash plug-in
[WebKit-https.git] / LayoutTests / plugins / private-browsing-mode.html
1 <head>
2 <link rel="stylesheet" href="../fast/js/resources/js-test-style.css">
3 <script src="../fast/js/resources/js-test-pre.js"></script>
4 </head>
5 <body onload="runTest()">
6 <p id="description"></p>
7 <div id="console"></div>
8 <script>
9 function runTest() 
10 {
11     if (!window.layoutTestController) {
12         debug("This test can only run from within DumpRenderTree because it requires TestNetscapePlugin.\n");
13         return;
14     }
15     
16     plugin1 = document.createElement("embed");
17     plugin1.type = "application/x-webkit-test-netscape";
18     document.body.appendChild(plugin1);
19     
20     shouldBe("plugin1.privateBrowsingEnabled", "false");
21     shouldBe("plugin1.cachedPrivateBrowsingEnabled", "false");
22
23     // Now enable private browsing
24     layoutTestController.setPrivateBrowsingEnabled(true);
25
26     shouldBe("plugin1.privateBrowsingEnabled", "true");
27     shouldBe("plugin1.cachedPrivateBrowsingEnabled", "true");
28     
29     plugin2 = document.createElement("embed");
30     plugin2.type = "application/x-webkit-test-netscape";
31     document.body.appendChild(plugin2);
32     
33     shouldBe("plugin2.privateBrowsingEnabled", "true");
34     shouldBe("plugin2.cachedPrivateBrowsingEnabled", "true");
35     
36 }
37 </script>
38
39 <script>
40 description("Tests that the private browsing API implementation works as expected");
41
42
43 successfullyParsed = true;
44 </script>