| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include <string> | 5 #include <string> |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/stl_util.h" | 8 #include "base/stl_util.h" |
| 9 #include "base/strings/string_piece.h" | 9 #include "base/strings/string_piece.h" |
| 10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
| (...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 261 InProcessBrowserTest::SetUpOnMainThread(); | 261 InProcessBrowserTest::SetUpOnMainThread(); |
| 262 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); | 262 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); |
| 263 | 263 |
| 264 embedded_test_server()->ServeFilesFromDirectory( | 264 embedded_test_server()->ServeFilesFromDirectory( |
| 265 ui_test_utils::GetTestFilePath( | 265 ui_test_utils::GetTestFilePath( |
| 266 base::FilePath(FILE_PATH_LITERAL("plugin_power_saver")), | 266 base::FilePath(FILE_PATH_LITERAL("plugin_power_saver")), |
| 267 base::FilePath())); | 267 base::FilePath())); |
| 268 } | 268 } |
| 269 | 269 |
| 270 void SetUpCommandLine(base::CommandLine* command_line) override { | 270 void SetUpCommandLine(base::CommandLine* command_line) override { |
| 271 command_line->AppendSwitch(switches::kEnablePluginPowerSaver); | |
| 272 command_line->AppendSwitch(switches::kEnablePepperTesting); | 271 command_line->AppendSwitch(switches::kEnablePepperTesting); |
| 273 command_line->AppendSwitch(switches::kEnablePluginPlaceholderTesting); | 272 command_line->AppendSwitch(switches::kEnablePluginPlaceholderTesting); |
| 274 command_line->AppendSwitchASCII( | 273 command_line->AppendSwitchASCII( |
| 275 switches::kOverridePluginPowerSaverForTesting, "ignore-list"); | 274 switches::kOverridePluginPowerSaverForTesting, "ignore-list"); |
| 276 | 275 |
| 277 ASSERT_TRUE(ppapi::RegisterPowerSaverTestPlugin(command_line)); | 276 ASSERT_TRUE(ppapi::RegisterPowerSaverTestPlugin(command_line)); |
| 278 } | 277 } |
| 279 | 278 |
| 280 protected: | 279 protected: |
| 281 void LoadHTML(const std::string& html) { | 280 void LoadHTML(const std::string& html) { |
| (...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 595 | 594 |
| 596 IN_PROC_BROWSER_TEST_F(PluginPowerSaverBrowserTest, ZoomIndependent) { | 595 IN_PROC_BROWSER_TEST_F(PluginPowerSaverBrowserTest, ZoomIndependent) { |
| 597 ui_zoom::ZoomController::FromWebContents(GetActiveWebContents()) | 596 ui_zoom::ZoomController::FromWebContents(GetActiveWebContents()) |
| 598 ->SetZoomLevel(4.0); | 597 ->SetZoomLevel(4.0); |
| 599 LoadHTML( | 598 LoadHTML( |
| 600 "<object id='plugin' data='http://otherorigin.com/fake.swf' " | 599 "<object id='plugin' data='http://otherorigin.com/fake.swf' " |
| 601 " type='application/x-ppapi-tests' width='400' height='200'>" | 600 " type='application/x-ppapi-tests' width='400' height='200'>" |
| 602 "</object>"); | 601 "</object>"); |
| 603 VerifyPluginIsThrottled(GetActiveWebContents(), "plugin"); | 602 VerifyPluginIsThrottled(GetActiveWebContents(), "plugin"); |
| 604 } | 603 } |
| OLD | NEW |