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

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

Issue 1409163006: Migrating tests to use EmbeddedTestServer (/chrome/browser misc) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 5 years, 1 month 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
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 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/download/download_browsertest.cc ('k') | chrome/browser/download/save_page_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698