OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 // Tests for the top plugins to catch regressions in our plugin host code, as | 5 // Tests for the top plugins to catch regressions in our plugin host code, as |
6 // well as in the out of process code. Currently this tests: | 6 // well as in the out of process code. Currently this tests: |
7 // Flash | 7 // Flash |
8 // Real | 8 // Real |
9 // QuickTime | 9 // QuickTime |
10 // Windows Media Player | 10 // Windows Media Player |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 "npswf32.dll" | 131 "npswf32.dll" |
132 #elif defined(OS_MACOSX) | 132 #elif defined(OS_MACOSX) |
133 "Flash Player.plugin" | 133 "Flash Player.plugin" |
134 #elif defined(OS_POSIX) | 134 #elif defined(OS_POSIX) |
135 "libflashplayer.so" | 135 "libflashplayer.so" |
136 #endif | 136 #endif |
137 ; | 137 ; |
138 TestPlugin("flash.html?" + kFlashQuery, action_max_timeout_ms(), false); | 138 TestPlugin("flash.html?" + kFlashQuery, action_max_timeout_ms(), false); |
139 } | 139 } |
140 | 140 |
| 141 class ClickToPlayPluginTest : public PluginTest { |
| 142 public: |
| 143 ClickToPlayPluginTest() { |
| 144 dom_automation_enabled_ = true; |
| 145 } |
| 146 }; |
| 147 |
| 148 TEST_F(ClickToPlayPluginTest, Flash) { |
| 149 scoped_refptr<BrowserProxy> browser(automation()->GetBrowserWindow(0)); |
| 150 ASSERT_TRUE(browser.get()); |
| 151 ASSERT_TRUE(browser->SetDefaultContentSetting(CONTENT_SETTINGS_TYPE_PLUGINS, |
| 152 CONTENT_SETTING_BLOCK)); |
| 153 |
| 154 GURL url = GetTestUrl("flash-clicktoplay.html", true); |
| 155 NavigateToURL(url); |
| 156 |
| 157 scoped_refptr<TabProxy> tab(browser->GetTab(0)); |
| 158 ASSERT_TRUE(tab.get()); |
| 159 |
| 160 ASSERT_TRUE(tab->LoadBlockedPlugins()); |
| 161 |
| 162 WaitForFinish(action_max_timeout_ms(), true); |
| 163 } |
| 164 |
| 165 TEST_F(ClickToPlayPluginTest, FlashDocument) { |
| 166 scoped_refptr<BrowserProxy> browser(automation()->GetBrowserWindow(0)); |
| 167 ASSERT_TRUE(browser.get()); |
| 168 ASSERT_TRUE(browser->SetDefaultContentSetting(CONTENT_SETTINGS_TYPE_PLUGINS, |
| 169 CONTENT_SETTING_BLOCK)); |
| 170 |
| 171 scoped_refptr<TabProxy> tab(browser->GetTab(0)); |
| 172 ASSERT_TRUE(tab.get()); |
| 173 GURL url = GetTestUrl("js-invoker.swf?callback=done", true); |
| 174 NavigateToURL(url); |
| 175 |
| 176 // Inject the callback function into the HTML page generated by the browser. |
| 177 ASSERT_TRUE(tab->ExecuteJavaScript("window.done = function() {" |
| 178 " window.location = \"done.html\";" |
| 179 "}")); |
| 180 |
| 181 ASSERT_TRUE(tab->LoadBlockedPlugins()); |
| 182 |
| 183 WaitForFinish(action_max_timeout_ms(), true); |
| 184 } |
| 185 |
141 #if defined(OS_WIN) | 186 #if defined(OS_WIN) |
142 // Windows only test | 187 // Windows only test |
143 TEST_F(PluginTest, FlashSecurity) { | 188 TEST_F(PluginTest, FlashSecurity) { |
144 TestPlugin("flash.html", action_max_timeout_ms(), false); | 189 TestPlugin("flash.html", action_max_timeout_ms(), false); |
145 } | 190 } |
146 #endif // defined(OS_WIN) | 191 #endif // defined(OS_WIN) |
147 | 192 |
148 #if defined(OS_WIN) | 193 #if defined(OS_WIN) |
149 // TODO(port) Port the following tests to platforms that have the required | 194 // TODO(port) Port the following tests to platforms that have the required |
150 // plugins. | 195 // plugins. |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
298 TEST_F(PluginInstallerDownloadTest, PluginInstallerDownloadPathTest) { | 343 TEST_F(PluginInstallerDownloadTest, PluginInstallerDownloadPathTest) { |
299 MessageLoop loop(MessageLoop::TYPE_IO); | 344 MessageLoop loop(MessageLoop::TYPE_IO); |
300 Start(); | 345 Start(); |
301 loop.Run(); | 346 loop.Run(); |
302 | 347 |
303 EXPECT_TRUE(success()); | 348 EXPECT_TRUE(success()); |
304 EXPECT_TRUE(initial_download_path().BaseName().value() == | 349 EXPECT_TRUE(initial_download_path().BaseName().value() == |
305 final_download_path().BaseName().value()); | 350 final_download_path().BaseName().value()); |
306 } | 351 } |
307 #endif // defined(OS_WIN) | 352 #endif // defined(OS_WIN) |
OLD | NEW |