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

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

Issue 1155453002: Passing ProfileID instead of Profile* to clarify that profile should not be used for making any cal… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Changes as per review comments. Created 5 years, 6 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/extensions/api/notifications/notifications_api.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 "chrome/browser/download/notification/download_notification_item.h" 5 #include "chrome/browser/download/notification/download_notification_item.h"
6 6
7 #include "base/message_loop/message_loop.h" 7 #include "base/message_loop/message_loop.h"
8 #include "base/run_loop.h" 8 #include "base/run_loop.h"
9 #include "base/test/test_simple_task_runner.h" 9 #include "base/test/test_simple_task_runner.h"
10 #include "base/thread_task_runner_handle.h" 10 #include "base/thread_task_runner_handle.h"
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 } 119 }
120 120
121 const Notification* notification() const { 121 const Notification* notification() const {
122 return ui_manager_->FindById(download_notification_item_->watcher_->id(), 122 return ui_manager_->FindById(download_notification_item_->watcher_->id(),
123 NotificationUIManager::GetProfileID(profile_)); 123 NotificationUIManager::GetProfileID(profile_));
124 } 124 }
125 125
126 size_t NotificationCount() const { 126 size_t NotificationCount() const {
127 return ui_manager_ 127 return ui_manager_
128 ->GetAllIdsByProfileAndSourceOrigin( 128 ->GetAllIdsByProfileAndSourceOrigin(
129 profile_, 129 NotificationUIManager::GetProfileID(profile_),
130 GURL(DownloadNotificationItem::kDownloadNotificationOrigin)) 130 GURL(DownloadNotificationItem::kDownloadNotificationOrigin))
131 .size(); 131 .size();
132 } 132 }
133 133
134 void RemoveNotification() { 134 void RemoveNotification() {
135 ui_manager_->CancelById(download_notification_item_->watcher_->id(), 135 ui_manager_->CancelById(download_notification_item_->watcher_->id(),
136 NotificationUIManager::GetProfileID(profile_)); 136 NotificationUIManager::GetProfileID(profile_));
137 137
138 // Waits, since removing a notification may cause an async job. 138 // Waits, since removing a notification may cause an async job.
139 base::RunLoop().RunUntilIdle(); 139 base::RunLoop().RunUntilIdle();
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
289 289
290 // Checks OnDownloadRemoved(). 290 // Checks OnDownloadRemoved().
291 EXPECT_EQ(0u, delegate_.GetOnDownloadRemovedCallCount()); 291 EXPECT_EQ(0u, delegate_.GetOnDownloadRemovedCallCount());
292 download_item_->NotifyObserversDownloadRemoved(); 292 download_item_->NotifyObserversDownloadRemoved();
293 EXPECT_EQ(1u, delegate_.GetOnDownloadRemovedCallCount()); 293 EXPECT_EQ(1u, delegate_.GetOnDownloadRemovedCallCount());
294 294
295 download_item_.reset(); 295 download_item_.reset();
296 } 296 }
297 297
298 } // namespace test 298 } // namespace test
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/api/notifications/notifications_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698