Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(209)

Side by Side Diff: chrome/test/data/prerender/prerender_plugin_power_saver.html

Issue 1114623002: Plugin Power Saver: Make PPS work well with prerendered pages. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 <html>
2 <!--
3 This test checks the interaction between prerender and the Plugin Power Saver
Lei Zhang 2015/04/29 22:14:15 nit: prerendering
tommycli 2015/04/29 22:25:16 Done.
4 feature. It expects:
5 - The plugin is not loaded during prerender.
6 - It is loaded (briefly) during the preroll of the plugin.
7 - It is replaced by the placeholder after the preroll is over.
Lei Zhang 2015/04/29 22:14:15 placeholder -> power saver placeholder
tommycli 2015/04/29 22:25:16 Done.
8
9 This test relies on the Pepper plugin (but not the placeholder) implementing
10 the postMessage() function on the plugin object.
11 -->
12 <head>
13 <title>Prerender Plugin Delay Loading</title>
14
15 <script>
16 // Make sure plugin was not loaded while prerendering.
17 function DidPrerenderPass() {
Lei Zhang 2015/04/29 22:14:15 Does anyone call this?
tommycli 2015/04/29 22:25:16 Yes, called during the PrerenderTestURL call (befo
18 // |plugin| should be the blocked plugin placeholder, rather than the
19 // test plugin.
20 var plugin = window.document.getElementById('plugin');
21 return plugin.postMessage === undefined;
22 }
23
24 // Make sure the plugin briefly exists, then is replaced with a placeholder.
25 function AwaitPluginPrerollAndPlaceholder() {
26 var plugin = window.document.getElementById('plugin');
27 function handleEvent(event) {
28 // We should eventually get a message indicating that the plugin has been
29 // throttled and replaced with a static placeholder.
30 if (event.data.isThrottled) {
31 plugin.removeEventListener('message', handleEvent);
32 window.domAutomationController.send(plugin.postMessage === undefined);
33 }
34 }
35
36 // The plugin should (briefly) exist for the preroll phase.
37 if (plugin.postMessage == undefined) {
38 window.domAutomationController.send(false);
39 }
40
41 plugin.addEventListener('message', handleEvent);
42 plugin.postMessage('getPowerSaverStatus');
43 }
44 </script>
45
46 </head>
47 <body>
48
49 <object id="plugin" type="application/x-ppapi-tests" height='100' width='100'>
50 </object>
51
52 </body>
53 </html>
OLDNEW
« no previous file with comments | « chrome/test/data/prerender/prerender_plugin_never_load.html ('k') | components/plugins/renderer/loadable_plugin_placeholder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698