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

Side by Side Diff: chrome/browser/notifications/desktop_notifications_unittest.cc

Issue 7053041: Add a Create method to DesktopNotificationHandler and stubs for the notification objects. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 9 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/notifications/desktop_notifications_unittest.h" 5 #include "chrome/browser/notifications/desktop_notifications_unittest.h"
6 6
7 #include "base/string_util.h" 7 #include "base/string_util.h"
8 #include "base/utf_string_conversions.h" 8 #include "base/utf_string_conversions.h"
9 #include "chrome/browser/prefs/browser_prefs.h" 9 #include "chrome/browser/prefs/browser_prefs.h"
10 #include "chrome/common/pref_names.h" 10 #include "chrome/common/pref_names.h"
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 : ui_thread_(BrowserThread::UI, &message_loop_) { 78 : ui_thread_(BrowserThread::UI, &message_loop_) {
79 } 79 }
80 80
81 DesktopNotificationsTest::~DesktopNotificationsTest() { 81 DesktopNotificationsTest::~DesktopNotificationsTest() {
82 } 82 }
83 83
84 void DesktopNotificationsTest::SetUp() { 84 void DesktopNotificationsTest::SetUp() {
85 browser::RegisterLocalState(&local_state_); 85 browser::RegisterLocalState(&local_state_);
86 profile_.reset(new TestingProfile()); 86 profile_.reset(new TestingProfile());
87 balloon_collection_ = new MockBalloonCollection(); 87 balloon_collection_ = new MockBalloonCollection();
88 ui_manager_.reset(new NotificationUIManager(&local_state_)); 88 ui_manager_.reset(NotificationUIManager::Create(&local_state_,
89 ui_manager_->Initialize(balloon_collection_); 89 balloon_collection_));
90 balloon_collection_->set_space_change_listener(ui_manager_.get());
91 service_.reset(new DesktopNotificationService(profile(), ui_manager_.get())); 90 service_.reset(new DesktopNotificationService(profile(), ui_manager_.get()));
92 log_output_.clear(); 91 log_output_.clear();
93 } 92 }
94 93
95 void DesktopNotificationsTest::TearDown() { 94 void DesktopNotificationsTest::TearDown() {
96 service_.reset(NULL); 95 service_.reset(NULL);
97 ui_manager_.reset(NULL); 96 ui_manager_.reset(NULL);
98 profile_.reset(NULL); 97 profile_.reset(NULL);
99 } 98 }
100 99
(...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after
436 } 435 }
437 436
438 // Now change the position to upper left. Confirm that the X value for the 437 // Now change the position to upper left. Confirm that the X value for the
439 // balloons gets smaller. 438 // balloons gets smaller.
440 local_state_.SetInteger(prefs::kDesktopNotificationPosition, 439 local_state_.SetInteger(prefs::kDesktopNotificationPosition,
441 BalloonCollection::UPPER_LEFT); 440 BalloonCollection::UPPER_LEFT);
442 441
443 int current_x = (*balloons.begin())->GetPosition().x(); 442 int current_x = (*balloons.begin())->GetPosition().x();
444 EXPECT_LT(current_x, last_x); 443 EXPECT_LT(current_x, last_x);
445 } 444 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698