1<html>
2<body>
3<script>
4function doTest()
5{
6 if (!window.testRunner || !window.internals) {
7 document.body.innerHTML = "FAIL: requires internals API";
8 return;
9 }
10 if (!window.localStorage.step) {
11 testRunner.waitUntilDone();
12 testRunner.dumpAsText();
13
14 window.localStorage.step = 1;
15 window.localStorage.step0Value = window.internals.pluginCount();
16
17 if (window.testRunner)
18 testRunner.setBlockAllPlugins(true);
19
20 window.location.reload();
21 return;
22 }
23 if (window.localStorage.step == 1) {
24 window.localStorage.step = 2;
25 window.localStorage.step1Value = window.internals.pluginCount();
26
27 testRunner.setBlockAllPlugins(false);
28
29 window.location.reload();
30 return;
31 }
32 window.localStorage.step2Value = window.internals.pluginCount();
33 var test1 = window.localStorage.step0Value > window.localStorage.step1Value;
34 var test2 = window.localStorage.step2Value > window.localStorage.step1Value;
35
36 console.log("number of plugins decreased after blocking: " + (test1 ? "PASS" : "FAIL"));
37 console.log("number of plugins increased after allowing: " + (test2 ? "PASS" : "FAIL"));
38 document.body.innerHTML = test1 && test2 ? "PASS" : "FAIL";
39
40 testRunner.notifyDone();
41}
42doTest();
43</script>
44</body>
45</html>