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

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 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 123
124 IN_PROC_BROWSER_TEST_F(PluginPowerSaverBrowserTest, LargePluginsUsePosters) { 124 IN_PROC_BROWSER_TEST_F(PluginPowerSaverBrowserTest, LargePluginsUsePosters) {
125 LoadHTML( 125 LoadHTML(
126 "<object id='plugin' type='application/x-ppapi-tests' " 126 "<object id='plugin' type='application/x-ppapi-tests' "
127 " width='400' height='500'>" 127 " width='400' height='500'>"
128 " <param name='poster' value='snapshot1x.png 1x, snapshot2x.png 2x' />" 128 " <param name='poster' value='snapshot1x.png 1x, snapshot2x.png 2x' />"
129 "</object>"); 129 "</object>");
130 EXPECT_TRUE(IsPluginPeripheral("plugin")); 130 EXPECT_TRUE(IsPluginPeripheral("plugin"));
131 } 131 }
132 132
133 IN_PROC_BROWSER_TEST_F(PluginPowerSaverBrowserTest, SmallPluginWithPoster) {
134 LoadHTML(
135 "<object id='plugin' type='application/x-ppapi-tests' "
136 " width='400' height='100'>"
137 " <param name='poster' value='snapshot1x.png 1x, snapshot2x.png 2x' />"
138 "</object>");
139 EXPECT_TRUE(IsPluginPeripheral("plugin"));
140
141 SimulateClickAndAwaitMarkedEssential("plugin", gfx::Point(50, 50));
142 }
143
133 IN_PROC_BROWSER_TEST_F(PluginPowerSaverBrowserTest, OriginWhitelisting) { 144 IN_PROC_BROWSER_TEST_F(PluginPowerSaverBrowserTest, OriginWhitelisting) {
134 LoadHTML( 145 LoadHTML(
135 "<object id='plugin1' data='http://otherorigin.com/fake1.swf' " 146 "<object id='plugin1' data='http://otherorigin.com/fake1.swf' "
136 "type='application/x-ppapi-tests' width='400' height='100'></object>" 147 "type='application/x-ppapi-tests' width='400' height='100'></object>"
137 "<object id='plugin2' data='http://otherorigin.com/fake2.swf' " 148 "<object id='plugin2' data='http://otherorigin.com/fake2.swf' "
138 "type='application/x-ppapi-tests' width='400' height='500'></object>"); 149 "type='application/x-ppapi-tests' width='400' height='500'></object>");
139 EXPECT_FALSE(IsPluginPeripheral("plugin1")); 150 EXPECT_FALSE(IsPluginPeripheral("plugin1"));
140 EXPECT_FALSE(IsPluginPeripheral("plugin2")); 151 EXPECT_FALSE(IsPluginPeripheral("plugin2"));
141 } 152 }
142 153
143 IN_PROC_BROWSER_TEST_F(PluginPowerSaverBrowserTest, LargeCrossOriginObscured) { 154 IN_PROC_BROWSER_TEST_F(PluginPowerSaverBrowserTest, LargeCrossOriginObscured) {
144 LoadHTML( 155 LoadHTML(
145 "<div style='width: 100px; height: 100px; overflow: hidden;'>" 156 "<div style='width: 100px; height: 100px; overflow: hidden;'>"
146 " <object id='plugin' data='http://otherorigin.com/fake.swf' " 157 " <object id='plugin' data='http://otherorigin.com/fake.swf' "
147 " type='application/x-ppapi-tests' width='400' height='500'></object>" 158 " type='application/x-ppapi-tests' width='400' height='500'></object>"
148 "</div>"); 159 "</div>");
149 EXPECT_TRUE(IsPluginPeripheral("plugin")); 160 EXPECT_TRUE(IsPluginPeripheral("plugin"));
150 } 161 }
OLDNEW
« no previous file with comments | « no previous file | chrome/renderer/resources/plugin_placeholders.css » ('j') | chrome/renderer/resources/plugin_poster.html » ('J')

Powered by Google App Engine
This is Rietveld 408576698