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 "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 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 | 141 |
142 IN_PROC_BROWSER_TEST_F(PluginPowerSaverBrowserTest, LargePluginsUsePosters) { | 142 IN_PROC_BROWSER_TEST_F(PluginPowerSaverBrowserTest, LargePluginsUsePosters) { |
143 LoadHTML( | 143 LoadHTML( |
144 "<object id='plugin' type='application/x-ppapi-tests' " | 144 "<object id='plugin' type='application/x-ppapi-tests' " |
145 " width='400' height='500'>" | 145 " width='400' height='500'>" |
146 " <param name='poster' value='snapshot1x.png 1x, snapshot2x.png 2x' />" | 146 " <param name='poster' value='snapshot1x.png 1x, snapshot2x.png 2x' />" |
147 "</object>"); | 147 "</object>"); |
148 EXPECT_TRUE(IsPluginPeripheral("plugin")); | 148 EXPECT_TRUE(IsPluginPeripheral("plugin")); |
149 } | 149 } |
150 | 150 |
| 151 IN_PROC_BROWSER_TEST_F(PluginPowerSaverBrowserTest, SmallPluginWithPoster) { |
| 152 LoadHTML( |
| 153 "<object id='plugin' type='application/x-ppapi-tests' " |
| 154 " width='400' height='100'>" |
| 155 " <param name='poster' value='snapshot1x.png 1x, snapshot2x.png 2x' />" |
| 156 "</object>"); |
| 157 EXPECT_TRUE(IsPluginPeripheral("plugin")); |
| 158 |
| 159 SimulateClickAndAwaitMarkedEssential("plugin", gfx::Point(50, 50)); |
| 160 } |
| 161 |
151 IN_PROC_BROWSER_TEST_F(PluginPowerSaverBrowserTest, OriginWhitelisting) { | 162 IN_PROC_BROWSER_TEST_F(PluginPowerSaverBrowserTest, OriginWhitelisting) { |
152 LoadHTML( | 163 LoadHTML( |
153 "<object id='plugin1' data='http://otherorigin.com/fake1.swf' " | 164 "<object id='plugin1' data='http://otherorigin.com/fake1.swf' " |
154 "type='application/x-ppapi-tests' width='400' height='100'></object>" | 165 "type='application/x-ppapi-tests' width='400' height='100'></object>" |
155 "<object id='plugin2' data='http://otherorigin.com/fake2.swf' " | 166 "<object id='plugin2' data='http://otherorigin.com/fake2.swf' " |
156 "type='application/x-ppapi-tests' width='400' height='500'></object>"); | 167 "type='application/x-ppapi-tests' width='400' height='500'></object>"); |
157 EXPECT_FALSE(IsPluginPeripheral("plugin1")); | 168 EXPECT_FALSE(IsPluginPeripheral("plugin1")); |
158 EXPECT_FALSE(IsPluginPeripheral("plugin2")); | 169 EXPECT_FALSE(IsPluginPeripheral("plugin2")); |
159 } | 170 } |
160 | 171 |
161 IN_PROC_BROWSER_TEST_F(PluginPowerSaverBrowserTest, LargeCrossOriginObscured) { | 172 IN_PROC_BROWSER_TEST_F(PluginPowerSaverBrowserTest, LargeCrossOriginObscured) { |
162 LoadHTML( | 173 LoadHTML( |
163 "<div style='width: 100px; height: 100px; overflow: hidden;'>" | 174 "<div style='width: 100px; height: 100px; overflow: hidden;'>" |
164 " <object id='plugin' data='http://otherorigin.com/fake.swf' " | 175 " <object id='plugin' data='http://otherorigin.com/fake.swf' " |
165 " type='application/x-ppapi-tests' width='400' height='500'></object>" | 176 " type='application/x-ppapi-tests' width='400' height='500'></object>" |
166 "</div>"); | 177 "</div>"); |
167 EXPECT_TRUE(IsPluginPeripheral("plugin")); | 178 EXPECT_TRUE(IsPluginPeripheral("plugin")); |
168 } | 179 } |
OLD | NEW |