2 <script src="../fast/js/resources/js-test-pre.js"></script>
4 <body onload="runTest()">
5 <p id="description"></p>
6 <div id="console"></div>
10 if (!window.layoutTestController) {
11 debug("This test can only run from within DumpRenderTree because it requires TestNetscapePlugin.\n");
15 plugin1 = document.createElement("embed");
16 plugin1.type = "application/x-webkit-test-netscape";
17 plugin1.setAttribute('test', 'private-browsing');
18 document.body.appendChild(plugin1);
20 shouldBe("plugin1.privateBrowsingEnabled", "false");
21 shouldBe("plugin1.cachedPrivateBrowsingEnabled", "false");
23 // Now enable private browsing
24 layoutTestController.setPrivateBrowsingEnabled(true);
26 shouldBe("plugin1.privateBrowsingEnabled", "true");
27 shouldBe("plugin1.cachedPrivateBrowsingEnabled", "true");
29 plugin2 = document.createElement("embed");
30 plugin2.type = "application/x-webkit-test-netscape";
31 plugin2.setAttribute('test', 'private-browsing');
32 document.body.appendChild(plugin2);
34 shouldBe("plugin2.privateBrowsingEnabled", "true");
35 shouldBe("plugin2.cachedPrivateBrowsingEnabled", "true");
41 description("Tests that the private browsing API implementation works as expected");