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

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: Fix rebase bug. 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 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 public: 258 public:
259 ~DownloadNotificationTestBase() override {} 259 ~DownloadNotificationTestBase() override {}
260 260
261 void SetUpCommandLine(base::CommandLine* command_line) override { 261 void SetUpCommandLine(base::CommandLine* command_line) override {
262 // TODO(yoshiki): Remove this after the download notification launches. 262 // TODO(yoshiki): Remove this after the download notification launches.
263 command_line->AppendSwitchASCII(switches::kEnableDownloadNotification, 263 command_line->AppendSwitchASCII(switches::kEnableDownloadNotification,
264 "enabled"); 264 "enabled");
265 } 265 }
266 266
267 void SetUpOnMainThread() override { 267 void SetUpOnMainThread() override {
268 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); 268 ASSERT_TRUE(embedded_test_server()->Start());
269 269
270 content::BrowserThread::PostTask( 270 content::BrowserThread::PostTask(
271 content::BrowserThread::IO, FROM_HERE, 271 content::BrowserThread::IO, FROM_HERE,
272 base::Bind(&net::URLRequestSlowDownloadJob::AddUrlHandler)); 272 base::Bind(&net::URLRequestSlowDownloadJob::AddUrlHandler));
273 } 273 }
274 274
275 content::DownloadManager* GetDownloadManager(Browser* browser) { 275 content::DownloadManager* GetDownloadManager(Browser* browser) {
276 return content::BrowserContext::GetDownloadManager(browser->profile()); 276 return content::BrowserContext::GetDownloadManager(browser->profile());
277 } 277 }
278 }; 278 };
(...skipping 964 matching lines...) Expand 10 before | Expand all | Expand 10 after
1243 EXPECT_EQ(message_center::NOTIFICATION_TYPE_BASE_FORMAT, 1243 EXPECT_EQ(message_center::NOTIFICATION_TYPE_BASE_FORMAT,
1244 GetNotification(notification_id_user1)->type()); 1244 GetNotification(notification_id_user1)->type());
1245 EXPECT_EQ(message_center::NOTIFICATION_TYPE_BASE_FORMAT, 1245 EXPECT_EQ(message_center::NOTIFICATION_TYPE_BASE_FORMAT,
1246 GetNotification(notification_id_user2_1)->type()); 1246 GetNotification(notification_id_user2_1)->type());
1247 // Normal notifications for user2. 1247 // Normal notifications for user2.
1248 EXPECT_EQ(message_center::NOTIFICATION_TYPE_BASE_FORMAT, 1248 EXPECT_EQ(message_center::NOTIFICATION_TYPE_BASE_FORMAT,
1249 GetNotification(notification_id_user2_1)->type()); 1249 GetNotification(notification_id_user2_1)->type());
1250 EXPECT_EQ(message_center::NOTIFICATION_TYPE_BASE_FORMAT, 1250 EXPECT_EQ(message_center::NOTIFICATION_TYPE_BASE_FORMAT,
1251 GetNotification(notification_id_user2_2)->type()); 1251 GetNotification(notification_id_user2_2)->type());
1252 } 1252 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698