OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // Disable everything on windows only. http://crbug.com/306144 | 5 // Disable everything on windows only. http://crbug.com/306144 |
6 #ifndef OS_WIN | 6 #ifndef OS_WIN |
7 | 7 |
8 #include <algorithm> | 8 #include <algorithm> |
9 | 9 |
10 #include "base/files/file_util.h" | 10 #include "base/files/file_util.h" |
(...skipping 4006 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4017 // TODO(benjhayden) Test that the shelf is shown for download() both with and | 4017 // TODO(benjhayden) Test that the shelf is shown for download() both with and |
4018 // without a WebContents. | 4018 // without a WebContents. |
4019 | 4019 |
4020 void OnDangerPromptCreated(DownloadDangerPrompt* prompt) { | 4020 void OnDangerPromptCreated(DownloadDangerPrompt* prompt) { |
4021 prompt->InvokeActionForTesting(DownloadDangerPrompt::ACCEPT); | 4021 prompt->InvokeActionForTesting(DownloadDangerPrompt::ACCEPT); |
4022 } | 4022 } |
4023 | 4023 |
4024 #if defined(OS_MACOSX) | 4024 #if defined(OS_MACOSX) |
4025 // Flakily triggers and assert on Mac. | 4025 // Flakily triggers and assert on Mac. |
4026 // http://crbug.com/180759 | 4026 // http://crbug.com/180759 |
| 4027 #define MAYBE_DownloadExtensionTest_AcceptDanger DISABLED_DownloadExtensionTest_
AcceptDanger |
| 4028 #else |
4027 #define MAYBE_DownloadExtensionTest_AcceptDanger DownloadExtensionTest_AcceptDan
ger | 4029 #define MAYBE_DownloadExtensionTest_AcceptDanger DownloadExtensionTest_AcceptDan
ger |
4028 #else | |
4029 #define MAYBE_DownloadExtensionTest_AcceptDanger DISABLED_DownloadExtensionTest_
AcceptDanger | |
4030 #endif | 4030 #endif |
4031 IN_PROC_BROWSER_TEST_F(DownloadExtensionTest, | 4031 IN_PROC_BROWSER_TEST_F(DownloadExtensionTest, |
4032 MAYBE_DownloadExtensionTest_AcceptDanger) { | 4032 MAYBE_DownloadExtensionTest_AcceptDanger) { |
4033 // Download a file that will be marked dangerous; click the browser action | 4033 // Download a file that will be marked dangerous; click the browser action |
4034 // button; the browser action poup will call acceptDanger(); when the | 4034 // button; the browser action poup will call acceptDanger(); when the |
4035 // DownloadDangerPrompt is created, pretend that the user clicks the Accept | 4035 // DownloadDangerPrompt is created, pretend that the user clicks the Accept |
4036 // button; wait until the download completes. | 4036 // button; wait until the download completes. |
4037 LoadExtension("downloads_split"); | 4037 LoadExtension("downloads_split"); |
4038 scoped_ptr<base::Value> result(RunFunctionAndReturnResult( | 4038 scoped_ptr<base::Value> result(RunFunctionAndReturnResult( |
4039 new DownloadsDownloadFunction(), | 4039 new DownloadsDownloadFunction(), |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4155 EXPECT_EQ(downloads::FILENAME_CONFLICT_ACTION_PROMPT, conflict_action); | 4155 EXPECT_EQ(downloads::FILENAME_CONFLICT_ACTION_PROMPT, conflict_action); |
4156 EXPECT_FALSE(warnings.empty()); | 4156 EXPECT_FALSE(warnings.empty()); |
4157 EXPECT_EQ(Warning::kDownloadFilenameConflict, | 4157 EXPECT_EQ(Warning::kDownloadFilenameConflict, |
4158 warnings.begin()->warning_type()); | 4158 warnings.begin()->warning_type()); |
4159 EXPECT_EQ("incumbent", warnings.begin()->extension_id()); | 4159 EXPECT_EQ("incumbent", warnings.begin()->extension_id()); |
4160 } | 4160 } |
4161 | 4161 |
4162 } // namespace extensions | 4162 } // namespace extensions |
4163 | 4163 |
4164 #endif // http://crbug.com/3061144 | 4164 #endif // http://crbug.com/3061144 |
OLD | NEW |