| 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/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
| 8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "chrome/browser/permissions/permissions_browsertest.h" | 10 #include "chrome/browser/permissions/permissions_browsertest.h" |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 EXPECT_EQ(1, prompt_factory()->total_request_count()); | 198 EXPECT_EQ(1, prompt_factory()->total_request_count()); |
| 199 | 199 |
| 200 // Navigate to a second URL to verify it's allowed on all file: URLs. | 200 // Navigate to a second URL to verify it's allowed on all file: URLs. |
| 201 ui_test_utils::NavigateToURL( | 201 ui_test_utils::NavigateToURL( |
| 202 browser(), | 202 browser(), |
| 203 GURL("file://" + test_path.AsUTF8Unsafe() + "/permissions/flash2.html")); | 203 GURL("file://" + test_path.AsUTF8Unsafe() + "/permissions/flash2.html")); |
| 204 EXPECT_TRUE(FeatureUsageSucceeds()); | 204 EXPECT_TRUE(FeatureUsageSucceeds()); |
| 205 } | 205 } |
| 206 | 206 |
| 207 // Failing often. http://crbug.com/706780. | 207 // Failing often. http://crbug.com/706780. |
| 208 #if defined(OS_LINUX) | 208 IN_PROC_BROWSER_TEST_F(FlashPermissionBrowserTest, DISABLED_BlockFileURL) { |
| 209 #define MAYBE_BlockFileURL DISABLED_BlockFileURL | |
| 210 #else | |
| 211 #define MAYBE_BlockFileURL BlockFileURL | |
| 212 #endif | |
| 213 | |
| 214 IN_PROC_BROWSER_TEST_F(FlashPermissionBrowserTest, MAYBE_BlockFileURL) { | |
| 215 base::FilePath test_path; | 209 base::FilePath test_path; |
| 216 PathService::Get(chrome::DIR_TEST_DATA, &test_path); | 210 PathService::Get(chrome::DIR_TEST_DATA, &test_path); |
| 217 ui_test_utils::NavigateToURL( | 211 ui_test_utils::NavigateToURL( |
| 218 browser(), GURL("file://" + test_path.AsUTF8Unsafe() + test_url())); | 212 browser(), GURL("file://" + test_path.AsUTF8Unsafe() + test_url())); |
| 219 CommonFailsIfBlocked(); | 213 CommonFailsIfBlocked(); |
| 220 EXPECT_EQ(1, prompt_factory()->total_request_count()); | 214 EXPECT_EQ(1, prompt_factory()->total_request_count()); |
| 221 | 215 |
| 222 // Navigate to a second URL to verify it's blocked on all file: URLs. | 216 // Navigate to a second URL to verify it's blocked on all file: URLs. |
| 223 ui_test_utils::NavigateToURL( | 217 ui_test_utils::NavigateToURL( |
| 224 browser(), | 218 browser(), |
| 225 GURL("file://" + test_path.AsUTF8Unsafe() + "/permissions/flash2.html")); | 219 GURL("file://" + test_path.AsUTF8Unsafe() + "/permissions/flash2.html")); |
| 226 EXPECT_FALSE(FeatureUsageSucceeds()); | 220 EXPECT_FALSE(FeatureUsageSucceeds()); |
| 227 } | 221 } |
| OLD | NEW |