| 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 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 252 | 252 |
| 253 class PluginPowerSaverBrowserTest : public InProcessBrowserTest { | 253 class PluginPowerSaverBrowserTest : public InProcessBrowserTest { |
| 254 public: | 254 public: |
| 255 void SetUp() override { | 255 void SetUp() override { |
| 256 EnablePixelOutput(); | 256 EnablePixelOutput(); |
| 257 InProcessBrowserTest::SetUp(); | 257 InProcessBrowserTest::SetUp(); |
| 258 } | 258 } |
| 259 | 259 |
| 260 void SetUpOnMainThread() override { | 260 void SetUpOnMainThread() override { |
| 261 InProcessBrowserTest::SetUpOnMainThread(); | 261 InProcessBrowserTest::SetUpOnMainThread(); |
| 262 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); | 262 ASSERT_TRUE(embedded_test_server()->Start()); |
| 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); | 271 command_line->AppendSwitch(switches::kEnablePluginPowerSaver); |
| 272 command_line->AppendSwitch(switches::kEnablePepperTesting); | 272 command_line->AppendSwitch(switches::kEnablePepperTesting); |
| (...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 595 | 595 |
| 596 IN_PROC_BROWSER_TEST_F(PluginPowerSaverBrowserTest, ZoomIndependent) { | 596 IN_PROC_BROWSER_TEST_F(PluginPowerSaverBrowserTest, ZoomIndependent) { |
| 597 ui_zoom::ZoomController::FromWebContents(GetActiveWebContents()) | 597 ui_zoom::ZoomController::FromWebContents(GetActiveWebContents()) |
| 598 ->SetZoomLevel(4.0); | 598 ->SetZoomLevel(4.0); |
| 599 LoadHTML( | 599 LoadHTML( |
| 600 "<object id='plugin' data='http://otherorigin.com/fake.swf' " | 600 "<object id='plugin' data='http://otherorigin.com/fake.swf' " |
| 601 " type='application/x-ppapi-tests' width='400' height='200'>" | 601 " type='application/x-ppapi-tests' width='400' height='200'>" |
| 602 "</object>"); | 602 "</object>"); |
| 603 VerifyPluginIsThrottled(GetActiveWebContents(), "plugin"); | 603 VerifyPluginIsThrottled(GetActiveWebContents(), "plugin"); |
| 604 } | 604 } |
| OLD | NEW |