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

Unified Diff: chrome/browser/plugins/plugin_power_saver_browsertest.cc

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: merge Created 5 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/plugins/plugin_power_saver_browsertest.cc
diff --git a/chrome/browser/plugins/plugin_power_saver_browsertest.cc b/chrome/browser/plugins/plugin_power_saver_browsertest.cc
index 23709a370b96240ee4f78c6c9108b7e36323eba5..bdfe2420bcf11555cedf340da0a7112350106c61 100644
--- a/chrome/browser/plugins/plugin_power_saver_browsertest.cc
+++ b/chrome/browser/plugins/plugin_power_saver_browsertest.cc
@@ -40,9 +40,9 @@ class PluginPowerSaverBrowserTest : virtual public InProcessBrowserTest {
bool IsPluginPeripheral(const char* element_id) {
std::string script = base::StringPrintf(
"var plugin = window.document.getElementById('%s');"
- "function handleEvent() {"
+ "function handleEvent(event) {"
" if (event.data.isPeripheral != undefined &&"
- " event.data.source == 'getPeripheralStatusResponse') {"
+ " event.data.source == 'getPowerSaverStatusResponse') {"
" window.domAutomationController.send("
" event.data.isPeripheral ? 'peripheral' : 'essential');"
" plugin.removeEventListener('message', handleEvent);"
@@ -55,7 +55,7 @@ class PluginPowerSaverBrowserTest : virtual public InProcessBrowserTest {
" window.domAutomationController.send('peripheral');"
"} else {"
" plugin.addEventListener('message', handleEvent);"
- " plugin.postMessage('getPeripheralStatus');"
+ " plugin.postMessage('getPowerSaverStatus');"
"}",
element_id);
@@ -71,7 +71,7 @@ class PluginPowerSaverBrowserTest : virtual public InProcessBrowserTest {
// status message during:
// - Plugin creation, to handle a plugin freshly created from a poster.
// - Peripheral status change.
- // - In response to the explicit 'getPeripheralStatus' request, in case the
+ // - In response to the explicit 'getPowerSaverStatus' request, in case the
// test has missed the above two events.
void SimulateClickAndAwaitMarkedEssential(const char* element_id,
const gfx::Point& point) {
@@ -80,7 +80,7 @@ class PluginPowerSaverBrowserTest : virtual public InProcessBrowserTest {
std::string script = base::StringPrintf(
"var plugin = window.document.getElementById('%s');"
- "function handleEvent() {"
+ "function handleEvent(event) {"
" if (event.data.isPeripheral == false) {"
" window.domAutomationController.send('essential');"
" plugin.removeEventListener('message', handleEvent);"
@@ -92,7 +92,7 @@ class PluginPowerSaverBrowserTest : virtual public InProcessBrowserTest {
"} else {"
" plugin.addEventListener('message', handleEvent);"
" if (plugin.postMessage != undefined) {"
- " plugin.postMessage('getPeripheralStatus');"
+ " plugin.postMessage('getPowerSaverStatus');"
" }"
"}",
element_id);

Powered by Google App Engine
This is Rietveld 408576698