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 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
270 public: | 270 public: |
271 ~DownloadNotificationTestBase() override {} | 271 ~DownloadNotificationTestBase() override {} |
272 | 272 |
273 void SetUpCommandLine(base::CommandLine* command_line) override { | 273 void SetUpCommandLine(base::CommandLine* command_line) override { |
274 // TODO(yoshiki): Remove this after the download notification launches. | 274 // TODO(yoshiki): Remove this after the download notification launches. |
275 command_line->AppendSwitchASCII(switches::kEnableDownloadNotification, | 275 command_line->AppendSwitchASCII(switches::kEnableDownloadNotification, |
276 "enabled"); | 276 "enabled"); |
277 } | 277 } |
278 | 278 |
279 void SetUpOnMainThread() override { | 279 void SetUpOnMainThread() override { |
280 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); | 280 ASSERT_TRUE(embedded_test_server()->Start()); |
281 | 281 |
282 content::BrowserThread::PostTask( | 282 content::BrowserThread::PostTask( |
283 content::BrowserThread::IO, FROM_HERE, | 283 content::BrowserThread::IO, FROM_HERE, |
284 base::Bind(&net::URLRequestSlowDownloadJob::AddUrlHandler)); | 284 base::Bind(&net::URLRequestSlowDownloadJob::AddUrlHandler)); |
285 | 285 |
286 GetMessageCenter()->DisableTimersForTest(); | 286 GetMessageCenter()->DisableTimersForTest(); |
287 } | 287 } |
288 | 288 |
289 content::DownloadManager* GetDownloadManager(Browser* browser) { | 289 content::DownloadManager* GetDownloadManager(Browser* browser) { |
290 return content::BrowserContext::GetDownloadManager(browser->profile()); | 290 return content::BrowserContext::GetDownloadManager(browser->profile()); |
(...skipping 975 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1266 EXPECT_EQ(message_center::NOTIFICATION_TYPE_BASE_FORMAT, | 1266 EXPECT_EQ(message_center::NOTIFICATION_TYPE_BASE_FORMAT, |
1267 GetNotification(notification_id_user1)->type()); | 1267 GetNotification(notification_id_user1)->type()); |
1268 EXPECT_EQ(message_center::NOTIFICATION_TYPE_BASE_FORMAT, | 1268 EXPECT_EQ(message_center::NOTIFICATION_TYPE_BASE_FORMAT, |
1269 GetNotification(notification_id_user2_1)->type()); | 1269 GetNotification(notification_id_user2_1)->type()); |
1270 // Normal notifications for user2. | 1270 // Normal notifications for user2. |
1271 EXPECT_EQ(message_center::NOTIFICATION_TYPE_BASE_FORMAT, | 1271 EXPECT_EQ(message_center::NOTIFICATION_TYPE_BASE_FORMAT, |
1272 GetNotification(notification_id_user2_1)->type()); | 1272 GetNotification(notification_id_user2_1)->type()); |
1273 EXPECT_EQ(message_center::NOTIFICATION_TYPE_BASE_FORMAT, | 1273 EXPECT_EQ(message_center::NOTIFICATION_TYPE_BASE_FORMAT, |
1274 GetNotification(notification_id_user2_2)->type()); | 1274 GetNotification(notification_id_user2_2)->type()); |
1275 } | 1275 } |
OLD | NEW |