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

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

Issue 1085993003: Plugin Power Saver: Make posters work right when image is 404 Not Found. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@0263-plugin-power-saver-heuristic-tests
Patch Set: 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 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 "base/command_line.h" 5 #include "base/command_line.h"
6 #include "base/strings/stringprintf.h" 6 #include "base/strings/stringprintf.h"
7 #include "chrome/browser/ui/browser.h" 7 #include "chrome/browser/ui/browser.h"
8 #include "chrome/browser/ui/tabs/tab_strip_model.h" 8 #include "chrome/browser/ui/tabs/tab_strip_model.h"
9 #include "chrome/common/chrome_switches.h" 9 #include "chrome/common/chrome_switches.h"
10 #include "chrome/test/base/in_process_browser_test.h" 10 #include "chrome/test/base/in_process_browser_test.h"
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 108
109 IN_PROC_BROWSER_TEST_F(PluginPowerSaverBrowserTest, LargePluginsUsePosters) { 109 IN_PROC_BROWSER_TEST_F(PluginPowerSaverBrowserTest, LargePluginsUsePosters) {
110 LoadHTML( 110 LoadHTML(
111 "<object id='plugin' type='application/x-ppapi-tests' " 111 "<object id='plugin' type='application/x-ppapi-tests' "
112 " width='400' height='500'>" 112 " width='400' height='500'>"
113 " <param name='poster' value='snapshot1x.png 1x, snapshot2x.png 2x' />" 113 " <param name='poster' value='snapshot1x.png 1x, snapshot2x.png 2x' />"
114 "</object>"); 114 "</object>");
115 EXPECT_TRUE(IsPluginPeripheral("plugin")); 115 EXPECT_TRUE(IsPluginPeripheral("plugin"));
116 } 116 }
117 117
118 IN_PROC_BROWSER_TEST_F(PluginPowerSaverBrowserTest, SmallPluginWithPoster) {
119 LoadHTML(
120 "<object id='plugin' type='application/x-ppapi-tests' "
121 " width='400' height='100'>"
122 " <param name='poster' value='snapshot1x.png 1x, snapshot2x.png 2x' />"
123 "</object>");
124 EXPECT_TRUE(IsPluginPeripheral("plugin"));
125
126 SimulateClickAndAwaitMarkedEssential("plugin", gfx::Point(50, 50));
127 }
128
118 IN_PROC_BROWSER_TEST_F(PluginPowerSaverBrowserTest, OriginWhitelisting) { 129 IN_PROC_BROWSER_TEST_F(PluginPowerSaverBrowserTest, OriginWhitelisting) {
119 LoadHTML( 130 LoadHTML(
120 "<object id='plugin1' data='http://otherorigin.com/fake1.swf' " 131 "<object id='plugin1' data='http://otherorigin.com/fake1.swf' "
121 "type='application/x-ppapi-tests' width='400' height='100'></object>" 132 "type='application/x-ppapi-tests' width='400' height='100'></object>"
122 "<object id='plugin2' data='http://otherorigin.com/fake2.swf' " 133 "<object id='plugin2' data='http://otherorigin.com/fake2.swf' "
123 "type='application/x-ppapi-tests' width='400' height='500'></object>"); 134 "type='application/x-ppapi-tests' width='400' height='500'></object>");
124 EXPECT_FALSE(IsPluginPeripheral("plugin1")); 135 EXPECT_FALSE(IsPluginPeripheral("plugin1"));
125 EXPECT_FALSE(IsPluginPeripheral("plugin2")); 136 EXPECT_FALSE(IsPluginPeripheral("plugin2"));
126 } 137 }
127 138
128 IN_PROC_BROWSER_TEST_F(PluginPowerSaverBrowserTest, LargeCrossOriginObscured) { 139 IN_PROC_BROWSER_TEST_F(PluginPowerSaverBrowserTest, LargeCrossOriginObscured) {
129 LoadHTML( 140 LoadHTML(
130 "<div style='width: 100px; height: 100px; overflow: hidden;'>" 141 "<div style='width: 100px; height: 100px; overflow: hidden;'>"
131 " <object id='plugin' data='http://otherorigin.com/fake.swf' " 142 " <object id='plugin' data='http://otherorigin.com/fake.swf' "
132 " type='application/x-ppapi-tests' width='400' height='500'></object>" 143 " type='application/x-ppapi-tests' width='400' height='500'></object>"
133 "</div>"); 144 "</div>");
134 EXPECT_TRUE(IsPluginPeripheral("plugin")); 145 EXPECT_TRUE(IsPluginPeripheral("plugin"));
135 } 146 }
OLDNEW
« no previous file with comments | « no previous file | chrome/renderer/resources/plugin_placeholders.css » ('j') | chrome/renderer/resources/plugin_placeholders.css » ('J')

Powered by Google App Engine
This is Rietveld 408576698