| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 #include "base/base_switches.h" | 5 #include "base/base_switches.h" |
| 6 #include "base/command_line.h" | 6 #include "base/command_line.h" |
| 7 #include "base/path_service.h" | 7 #include "base/path_service.h" |
| 8 #include "chrome/browser/permissions/permissions_browsertest.h" | 8 #include "chrome/browser/permissions/permissions_browsertest.h" |
| 9 #include "chrome/browser/ui/website_settings/mock_permission_prompt_factory.h" | 9 #include "chrome/browser/ui/website_settings/mock_permission_prompt_factory.h" |
| 10 #include "chrome/common/chrome_paths.h" | 10 #include "chrome/common/chrome_paths.h" |
| 11 #include "chrome/test/base/ui_test_utils.h" | 11 #include "chrome/test/base/ui_test_utils.h" |
| 12 #include "components/variations/variations_switches.h" | 12 #include "components/variations/variations_switches.h" |
| 13 #include "content/public/browser/web_contents.h" | 13 #include "content/public/browser/web_contents.h" |
| 14 #include "content/public/common/content_switches.h" | 14 #include "content/public/common/content_switches.h" |
| 15 #include "content/public/test/browser_test_utils.h" | 15 #include "content/public/test/browser_test_utils.h" |
| 16 #include "content/public/test/ppapi_test_utils.h" | 16 #include "content/public/test/ppapi_test_utils.h" |
| 17 #include "third_party/WebKit/public/web/WebInputEvent.h" | 17 #include "third_party/WebKit/public/platform/WebInputEvent.h" |
| 18 #include "url/gurl.h" | 18 #include "url/gurl.h" |
| 19 | 19 |
| 20 class FlashPermissionBrowserTest : public PermissionsBrowserTest { | 20 class FlashPermissionBrowserTest : public PermissionsBrowserTest { |
| 21 public: | 21 public: |
| 22 FlashPermissionBrowserTest() | 22 FlashPermissionBrowserTest() |
| 23 : PermissionsBrowserTest("/permissions/flash.html") {} | 23 : PermissionsBrowserTest("/permissions/flash.html") {} |
| 24 ~FlashPermissionBrowserTest() override {} | 24 ~FlashPermissionBrowserTest() override {} |
| 25 | 25 |
| 26 // PermissionsBrowserTest | 26 // PermissionsBrowserTest |
| 27 void SetUpCommandLine(base::CommandLine* command_line) override { | 27 void SetUpCommandLine(base::CommandLine* command_line) override { |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 browser(), GURL("file://" + test_path.AsUTF8Unsafe() + test_url())); | 131 browser(), GURL("file://" + test_path.AsUTF8Unsafe() + test_url())); |
| 132 CommonFailsIfBlocked(); | 132 CommonFailsIfBlocked(); |
| 133 EXPECT_EQ(1, prompt_factory()->total_request_count()); | 133 EXPECT_EQ(1, prompt_factory()->total_request_count()); |
| 134 | 134 |
| 135 // Navigate to a second URL to verify it's blocked on all file: URLs. | 135 // Navigate to a second URL to verify it's blocked on all file: URLs. |
| 136 ui_test_utils::NavigateToURL( | 136 ui_test_utils::NavigateToURL( |
| 137 browser(), | 137 browser(), |
| 138 GURL("file://" + test_path.AsUTF8Unsafe() + "/permissions/flash2.html")); | 138 GURL("file://" + test_path.AsUTF8Unsafe() + "/permissions/flash2.html")); |
| 139 EXPECT_FALSE(FeatureUsageSucceeds()); | 139 EXPECT_FALSE(FeatureUsageSucceeds()); |
| 140 } | 140 } |
| OLD | NEW |