| 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 <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 1067 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1078 ASSERT_TRUE(item.get()); | 1078 ASSERT_TRUE(item.get()); |
| 1079 | 1079 |
| 1080 std::unique_ptr<base::Value> result( | 1080 std::unique_ptr<base::Value> result( |
| 1081 RunFunctionAndReturnResult(new DownloadsSearchFunction(), "[{}]")); | 1081 RunFunctionAndReturnResult(new DownloadsSearchFunction(), "[{}]")); |
| 1082 ASSERT_TRUE(result.get()); | 1082 ASSERT_TRUE(result.get()); |
| 1083 base::ListValue* result_list = NULL; | 1083 base::ListValue* result_list = NULL; |
| 1084 ASSERT_TRUE(result->GetAsList(&result_list)); | 1084 ASSERT_TRUE(result->GetAsList(&result_list)); |
| 1085 ASSERT_EQ(1UL, result_list->GetSize()); | 1085 ASSERT_EQ(1UL, result_list->GetSize()); |
| 1086 } | 1086 } |
| 1087 | 1087 |
| 1088 #if !defined(OS_CHROMEOS) |
| 1089 IN_PROC_BROWSER_TEST_F(DownloadExtensionTest, |
| 1090 DownloadsShowFunction) { |
| 1091 ScopedCancellingItem item(CreateSlowTestDownload()); |
| 1092 ASSERT_TRUE(item.get()); |
| 1093 |
| 1094 RunFunction(new DownloadsShowFunction(), DownloadItemIdAsArgList(item.get())); |
| 1095 } |
| 1096 |
| 1097 IN_PROC_BROWSER_TEST_F(DownloadExtensionTest, |
| 1098 DownloadsShowDefaultFolderFunction) { |
| 1099 ScopedCancellingItem item(CreateSlowTestDownload()); |
| 1100 ASSERT_TRUE(item.get()); |
| 1101 |
| 1102 RunFunction(new DownloadsShowDefaultFolderFunction(), |
| 1103 DownloadItemIdAsArgList(item.get())); |
| 1104 } |
| 1105 |
| 1106 IN_PROC_BROWSER_TEST_F(DownloadExtensionTest, |
| 1107 DownloadsDragFunction) { |
| 1108 ScopedCancellingItem item(CreateSlowTestDownload()); |
| 1109 ASSERT_TRUE(item.get()); |
| 1110 |
| 1111 RunFunction(new DownloadsDragFunction(), DownloadItemIdAsArgList(item.get())); |
| 1112 } |
| 1113 #endif |
| 1114 |
| 1115 |
| 1088 // Test the |filenameRegex| parameter for search(). | 1116 // Test the |filenameRegex| parameter for search(). |
| 1089 IN_PROC_BROWSER_TEST_F(DownloadExtensionTest, | 1117 IN_PROC_BROWSER_TEST_F(DownloadExtensionTest, |
| 1090 DownloadExtensionTest_SearchFilenameRegex) { | 1118 DownloadExtensionTest_SearchFilenameRegex) { |
| 1091 const HistoryDownloadInfo kHistoryInfo[] = { | 1119 const HistoryDownloadInfo kHistoryInfo[] = { |
| 1092 { FILE_PATH_LITERAL("foobar"), | 1120 { FILE_PATH_LITERAL("foobar"), |
| 1093 DownloadItem::COMPLETE, | 1121 DownloadItem::COMPLETE, |
| 1094 content::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS }, | 1122 content::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS }, |
| 1095 { FILE_PATH_LITERAL("baz"), | 1123 { FILE_PATH_LITERAL("baz"), |
| 1096 DownloadItem::COMPLETE, | 1124 DownloadItem::COMPLETE, |
| 1097 content::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS } | 1125 content::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS } |
| (...skipping 3181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4279 EXPECT_EQ(downloads::FILENAME_CONFLICT_ACTION_PROMPT, conflict_action); | 4307 EXPECT_EQ(downloads::FILENAME_CONFLICT_ACTION_PROMPT, conflict_action); |
| 4280 EXPECT_FALSE(warnings.empty()); | 4308 EXPECT_FALSE(warnings.empty()); |
| 4281 EXPECT_EQ(Warning::kDownloadFilenameConflict, | 4309 EXPECT_EQ(Warning::kDownloadFilenameConflict, |
| 4282 warnings.begin()->warning_type()); | 4310 warnings.begin()->warning_type()); |
| 4283 EXPECT_EQ("incumbent", warnings.begin()->extension_id()); | 4311 EXPECT_EQ("incumbent", warnings.begin()->extension_id()); |
| 4284 } | 4312 } |
| 4285 | 4313 |
| 4286 } // namespace extensions | 4314 } // namespace extensions |
| 4287 | 4315 |
| 4288 #endif // http://crbug.com/306144 | 4316 #endif // http://crbug.com/306144 |
| OLD | NEW |