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

Unified 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 side-by-side diff with in-line comments
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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/plugin/plugin_test.cpp
diff --git a/chrome/test/plugin/plugin_test.cpp b/chrome/test/plugin/plugin_test.cpp
index cc93c459421ba5a7e17e7111db11bd80065260e4..a0afffad66c16c4360cf2faa9553d03b9c9674f8 100644
--- a/chrome/test/plugin/plugin_test.cpp
+++ b/chrome/test/plugin/plugin_test.cpp
@@ -138,6 +138,51 @@ TEST_F(PluginTest, Flash) {
TestPlugin("flash.html?" + kFlashQuery, action_max_timeout_ms(), false);
}
+class ClickToPlayPluginTest : public PluginTest {
+ public:
+ ClickToPlayPluginTest() {
+ dom_automation_enabled_ = true;
+ }
+};
+
+TEST_F(ClickToPlayPluginTest, Flash) {
+ scoped_refptr<BrowserProxy> browser(automation()->GetBrowserWindow(0));
+ ASSERT_TRUE(browser.get());
+ ASSERT_TRUE(browser->SetDefaultContentSetting(CONTENT_SETTINGS_TYPE_PLUGINS,
+ CONTENT_SETTING_BLOCK));
+
+ GURL url = GetTestUrl("flash-clicktoplay.html", true);
+ NavigateToURL(url);
+
+ scoped_refptr<TabProxy> tab(browser->GetTab(0));
+ ASSERT_TRUE(tab.get());
+
+ ASSERT_TRUE(tab->LoadBlockedPlugins());
+
+ WaitForFinish(action_max_timeout_ms(), true);
+}
+
+TEST_F(ClickToPlayPluginTest, FlashDocument) {
+ scoped_refptr<BrowserProxy> browser(automation()->GetBrowserWindow(0));
+ ASSERT_TRUE(browser.get());
+ ASSERT_TRUE(browser->SetDefaultContentSetting(CONTENT_SETTINGS_TYPE_PLUGINS,
+ CONTENT_SETTING_BLOCK));
+
+ scoped_refptr<TabProxy> tab(browser->GetTab(0));
+ ASSERT_TRUE(tab.get());
+ GURL url = GetTestUrl("js-invoker.swf?callback=done", true);
+ NavigateToURL(url);
+
+ // Inject the callback function into the HTML page generated by the browser.
+ ASSERT_TRUE(tab->ExecuteJavaScript("window.done = function() {"
+ " window.location = \"done.html\";"
+ "}"));
+
+ ASSERT_TRUE(tab->LoadBlockedPlugins());
+
+ WaitForFinish(action_max_timeout_ms(), true);
+}
+
#if defined(OS_WIN)
// Windows only test
TEST_F(PluginTest, FlashSecurity) {
« 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