OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/command_line.h" | 5 #include "base/command_line.h" |
6 #include "base/message_loop/message_loop.h" | 6 #include "base/message_loop/message_loop.h" |
7 #include "base/path_service.h" | 7 #include "base/path_service.h" |
8 #include "base/run_loop.h" | 8 #include "base/run_loop.h" |
9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
10 #include "chrome/browser/chromeos/profiles/profile_helper.h" | 10 #include "chrome/browser/chromeos/profiles/profile_helper.h" |
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 explicit TestChromeDownloadManagerDelegate(Profile* profile) | 223 explicit TestChromeDownloadManagerDelegate(Profile* profile) |
224 : ChromeDownloadManagerDelegate(profile), opened_(false) {} | 224 : ChromeDownloadManagerDelegate(profile), opened_(false) {} |
225 ~TestChromeDownloadManagerDelegate() override {} | 225 ~TestChromeDownloadManagerDelegate() override {} |
226 | 226 |
227 // ChromeDownloadManagerDelegate override: | 227 // ChromeDownloadManagerDelegate override: |
228 void OpenDownload(content::DownloadItem* item) override { opened_ = true; } | 228 void OpenDownload(content::DownloadItem* item) override { opened_ = true; } |
229 | 229 |
230 // Return if the download is opened. | 230 // Return if the download is opened. |
231 bool opened() const { return opened_; } | 231 bool opened() const { return opened_; } |
232 | 232 |
| 233 protected: |
| 234 // Disable DownloadProtectionService in order to disable content checking. |
| 235 safe_browsing::DownloadProtectionService* GetDownloadProtectionService() |
| 236 override { |
| 237 return nullptr; |
| 238 } |
| 239 |
233 private: | 240 private: |
234 bool opened_; | 241 bool opened_; |
235 }; | 242 }; |
236 | 243 |
237 // Utility method to retrieve a message center. | 244 // Utility method to retrieve a message center. |
238 message_center::MessageCenter* GetMessageCenter() { | 245 message_center::MessageCenter* GetMessageCenter() { |
239 return message_center::MessageCenter::Get(); | 246 return message_center::MessageCenter::Get(); |
240 } | 247 } |
241 | 248 |
242 // Utility method to retrieve a notification object by id. | 249 // Utility method to retrieve a notification object by id. |
(...skipping 992 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1235 EXPECT_EQ(message_center::NOTIFICATION_TYPE_BASE_FORMAT, | 1242 EXPECT_EQ(message_center::NOTIFICATION_TYPE_BASE_FORMAT, |
1236 GetNotification(notification_id_user1)->type()); | 1243 GetNotification(notification_id_user1)->type()); |
1237 EXPECT_EQ(message_center::NOTIFICATION_TYPE_BASE_FORMAT, | 1244 EXPECT_EQ(message_center::NOTIFICATION_TYPE_BASE_FORMAT, |
1238 GetNotification(notification_id_user2_1)->type()); | 1245 GetNotification(notification_id_user2_1)->type()); |
1239 // Normal notifications for user2. | 1246 // Normal notifications for user2. |
1240 EXPECT_EQ(message_center::NOTIFICATION_TYPE_BASE_FORMAT, | 1247 EXPECT_EQ(message_center::NOTIFICATION_TYPE_BASE_FORMAT, |
1241 GetNotification(notification_id_user2_1)->type()); | 1248 GetNotification(notification_id_user2_1)->type()); |
1242 EXPECT_EQ(message_center::NOTIFICATION_TYPE_BASE_FORMAT, | 1249 EXPECT_EQ(message_center::NOTIFICATION_TYPE_BASE_FORMAT, |
1243 GetNotification(notification_id_user2_2)->type()); | 1250 GetNotification(notification_id_user2_2)->type()); |
1244 } | 1251 } |
OLD | NEW |