OLD | NEW |
1 <html> | 1 <html> |
2 <!-- | 2 <!-- |
3 This test checks to make sure plugins aren't loaded when a page is prerendered, | 3 This test checks to make sure plugins aren't loaded when a page is prerendered, |
4 but are loaded once the page is displayed and Plugin Power Saver is enabled. | 4 and are also not loaded once the page is displayed. This is used to test certain |
| 5 content settings that do not allow plugin loading. |
| 6 |
| 7 This test relies on the Pepper plugin (but not the placeholder) implementing |
| 8 the postMessage() function on the plugin object. |
5 --> | 9 --> |
6 <head> | 10 <head> |
7 <title>Prerender Plugin Power Saver</title> | 11 <title>Prerender Plugin Never Load</title> |
8 | 12 |
9 <script> | 13 <script> |
10 // Make sure plugin was not loaded while prerendering. | 14 // Make sure plugin was not loaded while prerendering. |
11 function DidPrerenderPass() { | 15 function DidPrerenderPass() { |
12 // |plugin| should be the blocked plugin placeholder, rather than the | 16 // |plugin| should be the blocked plugin placeholder, rather than the |
13 // test plugin. | 17 // test plugin. |
14 var plugin = window.document['plugin']; | 18 var plugin = window.document['plugin']; |
15 return plugin.getURL == undefined; | 19 return plugin.postMessage == undefined; |
16 } | 20 } |
17 | 21 |
18 // Make sure plugin loads once the page is displayed. | 22 // Make sure plugin still does not load once the page is displayed. |
19 function DidDisplayPass() { | 23 function DidDisplayPass() { |
20 var plugin = window.document['plugin']; | 24 var plugin = window.document['plugin']; |
21 return plugin.getURL != undefined; | 25 return plugin.postMessage == undefined; |
22 } | 26 } |
23 </script> | 27 </script> |
24 | 28 |
25 </head> | 29 </head> |
26 <body> | 30 <body> |
27 <embed name="plugin" type="application/x-webkit-test-netscape"></embed> | 31 <embed name="plugin" type="application/x-ppapi-tests"></embed> |
28 </body> | 32 </body> |
29 </html> | 33 </html> |
OLD | NEW |