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 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 } |
OLD | NEW |