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

Side by Side Diff: chrome/test/plugin/plugin_test.cpp

Issue 3539002: Add UI test for click-to-play. (Closed) Base URL: git://codf21.jail/chromium.git
Patch Set: move message declaration to bottom of file Created 10 years, 2 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
« no previous file with comments | « chrome/test/data/valgrind/ui_tests.gtest_mac.txt ('k') | chrome/test/ui/npapi_uitest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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)
OLDNEW
« no previous file with comments | « chrome/test/data/valgrind/ui_tests.gtest_mac.txt ('k') | chrome/test/ui/npapi_uitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698