private-browsing-mode.html 1.29 KB
Newer Older
1
<head>
2
<script src="../resources/js-test-pre.js"></script>
3 4 5 6 7 8 9
</head>
<body onload="runTest()">
<p id="description"></p>
<div id="console"></div>
<script>
function runTest() 
{
10
    if (!window.testRunner) {
11 12 13 14 15 16
        debug("This test can only run from within DumpRenderTree because it requires TestNetscapePlugin.\n");
        return;
    }
    
    plugin1 = document.createElement("embed");
    plugin1.type = "application/x-webkit-test-netscape";
17
    plugin1.setAttribute('test', 'private-browsing');
18 19 20 21 22 23
    document.body.appendChild(plugin1);
    
    shouldBe("plugin1.privateBrowsingEnabled", "false");
    shouldBe("plugin1.cachedPrivateBrowsingEnabled", "false");

    // Now enable private browsing
24
    testRunner.setPrivateBrowsingEnabled(true);
25 26 27 28 29 30

    shouldBe("plugin1.privateBrowsingEnabled", "true");
    shouldBe("plugin1.cachedPrivateBrowsingEnabled", "true");
    
    plugin2 = document.createElement("embed");
    plugin2.type = "application/x-webkit-test-netscape";
31
    plugin2.setAttribute('test', 'private-browsing');
32 33 34 35 36 37 38 39 40 41 42 43 44
    document.body.appendChild(plugin2);
    
    shouldBe("plugin2.privateBrowsingEnabled", "true");
    shouldBe("plugin2.cachedPrivateBrowsingEnabled", "true");
    
}
</script>

<script>
description("Tests that the private browsing API implementation works as expected");


</script>