Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(223)

Side by Side Diff: chrome/browser/download/notification/download_notification_browsertest.cc

Issue 1348683003: enable download protection on CrOS (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: disable download protection in test Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/safe_browsing/download_protection_service.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 NULL;
asanka 2015/10/21 13:53:21 Nit: nullptr instead of NULL.
Jialiu Lin 2015/10/21 20:14:55 Done.
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 976 matching lines...) Expand 10 before | Expand all | Expand 10 after
1219 EXPECT_EQ(message_center::NOTIFICATION_TYPE_BASE_FORMAT, 1226 EXPECT_EQ(message_center::NOTIFICATION_TYPE_BASE_FORMAT,
1220 GetNotification(notification_id_user1)->type()); 1227 GetNotification(notification_id_user1)->type());
1221 EXPECT_EQ(message_center::NOTIFICATION_TYPE_BASE_FORMAT, 1228 EXPECT_EQ(message_center::NOTIFICATION_TYPE_BASE_FORMAT,
1222 GetNotification(notification_id_user2_1)->type()); 1229 GetNotification(notification_id_user2_1)->type());
1223 // Normal notifications for user2. 1230 // Normal notifications for user2.
1224 EXPECT_EQ(message_center::NOTIFICATION_TYPE_BASE_FORMAT, 1231 EXPECT_EQ(message_center::NOTIFICATION_TYPE_BASE_FORMAT,
1225 GetNotification(notification_id_user2_1)->type()); 1232 GetNotification(notification_id_user2_1)->type());
1226 EXPECT_EQ(message_center::NOTIFICATION_TYPE_BASE_FORMAT, 1233 EXPECT_EQ(message_center::NOTIFICATION_TYPE_BASE_FORMAT,
1227 GetNotification(notification_id_user2_2)->type()); 1234 GetNotification(notification_id_user2_2)->type());
1228 } 1235 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/safe_browsing/download_protection_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698