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) { |