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

Side by Side Diff: chrome/browser/plugins/plugin_power_saver_browsertest.cc

Issue 2356053002: [HBD] Only use Plugin Content Settings for Flash. (Closed)
Patch Set: fix Created 4 years, 2 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
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 <stdint.h> 5 #include <stdint.h>
6 #include <string> 6 #include <string>
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/stl_util.h" 10 #include "base/stl_util.h"
(...skipping 13 matching lines...) Expand all
24 #include "content/public/browser/readback_types.h" 24 #include "content/public/browser/readback_types.h"
25 #include "content/public/browser/render_frame_host.h" 25 #include "content/public/browser/render_frame_host.h"
26 #include "content/public/browser/render_view_host.h" 26 #include "content/public/browser/render_view_host.h"
27 #include "content/public/browser/render_widget_host.h" 27 #include "content/public/browser/render_widget_host.h"
28 #include "content/public/common/content_switches.h" 28 #include "content/public/common/content_switches.h"
29 #include "content/public/test/browser_test_utils.h" 29 #include "content/public/test/browser_test_utils.h"
30 #include "content/public/test/ppapi_test_utils.h" 30 #include "content/public/test/ppapi_test_utils.h"
31 #include "net/test/embedded_test_server/embedded_test_server.h" 31 #include "net/test/embedded_test_server/embedded_test_server.h"
32 #include "net/test/embedded_test_server/http_request.h" 32 #include "net/test/embedded_test_server/http_request.h"
33 #include "net/test/embedded_test_server/http_response.h" 33 #include "net/test/embedded_test_server/http_response.h"
34 #include "ppapi/shared_impl/ppapi_switches.h"
35 #include "third_party/WebKit/public/web/WebInputEvent.h" 34 #include "third_party/WebKit/public/web/WebInputEvent.h"
36 #include "third_party/skia/include/core/SkBitmap.h" 35 #include "third_party/skia/include/core/SkBitmap.h"
37 #include "ui/base/window_open_disposition.h" 36 #include "ui/base/window_open_disposition.h"
38 #include "ui/display/display.h" 37 #include "ui/display/display.h"
39 #include "ui/display/display_switches.h" 38 #include "ui/display/display_switches.h"
40 #include "ui/display/screen.h" 39 #include "ui/display/screen.h"
41 #include "ui/gfx/codec/png_codec.h" 40 #include "ui/gfx/codec/png_codec.h"
42 #include "ui/gfx/geometry/point.h" 41 #include "ui/gfx/geometry/point.h"
43 42
44 namespace { 43 namespace {
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
267 InProcessBrowserTest::SetUpOnMainThread(); 266 InProcessBrowserTest::SetUpOnMainThread();
268 ASSERT_TRUE(embedded_test_server()->Start()); 267 ASSERT_TRUE(embedded_test_server()->Start());
269 268
270 embedded_test_server()->ServeFilesFromDirectory( 269 embedded_test_server()->ServeFilesFromDirectory(
271 ui_test_utils::GetTestFilePath( 270 ui_test_utils::GetTestFilePath(
272 base::FilePath(FILE_PATH_LITERAL("plugin_power_saver")), 271 base::FilePath(FILE_PATH_LITERAL("plugin_power_saver")),
273 base::FilePath())); 272 base::FilePath()));
274 } 273 }
275 274
276 void SetUpCommandLine(base::CommandLine* command_line) override { 275 void SetUpCommandLine(base::CommandLine* command_line) override {
277 command_line->AppendSwitch(switches::kEnablePepperTesting);
278 command_line->AppendSwitch(switches::kEnablePluginPlaceholderTesting); 276 command_line->AppendSwitch(switches::kEnablePluginPlaceholderTesting);
279 command_line->AppendSwitchASCII(
280 switches::kOverridePluginPowerSaverForTesting, "ignore-list");
281
282 ASSERT_TRUE(ppapi::RegisterPowerSaverTestPlugin(command_line)); 277 ASSERT_TRUE(ppapi::RegisterPowerSaverTestPlugin(command_line));
283 278
284 // Allows us to use the same reference image on HiDPI/Retina displays. 279 // Allows us to use the same reference image on HiDPI/Retina displays.
285 command_line->AppendSwitchASCII(switches::kForceDeviceScaleFactor, "1"); 280 command_line->AppendSwitchASCII(switches::kForceDeviceScaleFactor, "1");
286 281
287 // The pixel tests run more reliably in software mode. 282 // The pixel tests run more reliably in software mode.
288 if (PixelTestsEnabled()) 283 if (PixelTestsEnabled())
289 command_line->AppendSwitch(switches::kDisableGpu); 284 command_line->AppendSwitch(switches::kDisableGpu);
290 } 285 }
291 286
(...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after
739 "<object id='tiny_cross_origin_1' data='http://a.com/fake.swf' " 734 "<object id='tiny_cross_origin_1' data='http://a.com/fake.swf' "
740 " type='application/x-ppapi-tests' width='3' height='3'>" 735 " type='application/x-ppapi-tests' width='3' height='3'>"
741 "</object>" 736 "</object>"
742 "<object id='tiny_cross_origin_2' data='http://a.com/fake.swf' " 737 "<object id='tiny_cross_origin_2' data='http://a.com/fake.swf' "
743 " type='application/x-ppapi-tests' width='1' height='1'>" 738 " type='application/x-ppapi-tests' width='1' height='1'>"
744 "</object>"); 739 "</object>");
745 740
746 VerifyPluginMarkedEssential(GetActiveWebContents(), "tiny_cross_origin_1"); 741 VerifyPluginMarkedEssential(GetActiveWebContents(), "tiny_cross_origin_1");
747 VerifyPluginMarkedEssential(GetActiveWebContents(), "tiny_cross_origin_2"); 742 VerifyPluginMarkedEssential(GetActiveWebContents(), "tiny_cross_origin_2");
748 } 743 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698