OLD | NEW |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |