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

Unified Diff: chrome/browser/plugins/flash_permission_browsertest.cc

Issue 2385033002: Hookup the plugin placeholder to the Flash permission prompt (Closed)
Patch Set: Hookup the plugin placeholder to the Flash permission prompt Created 4 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
Index: chrome/browser/plugins/flash_permission_browsertest.cc
diff --git a/chrome/browser/plugins/flash_permission_browsertest.cc b/chrome/browser/plugins/flash_permission_browsertest.cc
index cbcd035629b95e16c8c936642e109becf37a428d..0ad9efd9f0e241171a547e8f8b0729596b815cca 100644
--- a/chrome/browser/plugins/flash_permission_browsertest.cc
+++ b/chrome/browser/plugins/flash_permission_browsertest.cc
@@ -9,7 +9,9 @@
#include "chrome/common/chrome_features.h"
#include "chrome/test/base/ui_test_utils.h"
#include "content/public/browser/web_contents.h"
+#include "content/public/test/browser_test_utils.h"
#include "content/public/test/ppapi_test_utils.h"
+#include "third_party/WebKit/public/web/WebInputEvent.h"
class FlashPermissionBrowserTest : public PermissionsBrowserTest {
public:
@@ -37,7 +39,11 @@ class FlashPermissionBrowserTest : public PermissionsBrowserTest {
// Flash won't be enabled until the page is refreshed.
ui_test_utils::NavigateToURL(browser(),
GetWebContents()->GetLastCommittedURL());
- return RunScriptReturnBool("flashIsEnabled();");
+ // If either flash with or without fallback content runs successfully it
+ // indicates the feature is at least partly working, which could imply a
+ // faulty permission.
+ return RunScriptReturnBool("flashIsEnabled();") ||
+ RunScriptReturnBool("flashIsEnabledForPluginWithoutFallack();");
}
base::test::ScopedFeatureList feature_list_;
@@ -68,3 +74,17 @@ IN_PROC_BROWSER_TEST_F(FlashPermissionBrowserTest, TriggerPromptViaNewWindow) {
EXPECT_EQ(1, prompt_factory()->total_request_count());
EXPECT_TRUE(FeatureUsageSucceeds());
}
+
+IN_PROC_BROWSER_TEST_F(FlashPermissionBrowserTest,
+ TriggerPromptViaPluginPlaceholder) {
+ EXPECT_EQ(0, prompt_factory()->total_request_count());
+ EXPECT_FALSE(FeatureUsageSucceeds());
+ prompt_factory()->set_response_type(PermissionRequestManager::ACCEPT_ALL);
+ // We need to simulate a mouse click to trigger the placeholder to prompt.
+ content::SimulateMouseClickAt(GetWebContents(), 0 /* modifiers */,
+ blink::WebMouseEvent::Button::Left,
+ gfx::Point(50, 50));
+ EXPECT_TRUE(FeatureUsageSucceeds());
+
+ EXPECT_EQ(1, prompt_factory()->total_request_count());
+}

Powered by Google App Engine
This is Rietveld 408576698