| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 } | 91 } |
| 92 | 92 |
| 93 void DesktopNotificationsTest::SetUp() { | 93 void DesktopNotificationsTest::SetUp() { |
| 94 #if defined(USE_ASH) | 94 #if defined(USE_ASH) |
| 95 WebKit::initialize(webkit_platform_support_.Get()); | 95 WebKit::initialize(webkit_platform_support_.Get()); |
| 96 // MockBalloonCollection retrieves information about the screen on creation. | 96 // MockBalloonCollection retrieves information about the screen on creation. |
| 97 // So it is necessary to make sure the desktop gets created first. | 97 // So it is necessary to make sure the desktop gets created first. |
| 98 ash::Shell::CreateInstance(NULL); | 98 ash::Shell::CreateInstance(NULL); |
| 99 #endif | 99 #endif |
| 100 | 100 |
| 101 browser::RegisterLocalState(&local_state_); | 101 chrome::RegisterLocalState(&local_state_); |
| 102 profile_.reset(new TestingProfile()); | 102 profile_.reset(new TestingProfile()); |
| 103 balloon_collection_ = new MockBalloonCollection(); | 103 balloon_collection_ = new MockBalloonCollection(); |
| 104 ui_manager_.reset(NotificationUIManager::Create(&local_state_, | 104 ui_manager_.reset(NotificationUIManager::Create(&local_state_, |
| 105 balloon_collection_)); | 105 balloon_collection_)); |
| 106 service_.reset(new DesktopNotificationService(profile(), ui_manager_.get())); | 106 service_.reset(new DesktopNotificationService(profile(), ui_manager_.get())); |
| 107 log_output_.clear(); | 107 log_output_.clear(); |
| 108 } | 108 } |
| 109 | 109 |
| 110 void DesktopNotificationsTest::TearDown() { | 110 void DesktopNotificationsTest::TearDown() { |
| 111 service_.reset(NULL); | 111 service_.reset(NULL); |
| (...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 465 } | 465 } |
| 466 | 466 |
| 467 // Now change the position to upper left. Confirm that the X value for the | 467 // Now change the position to upper left. Confirm that the X value for the |
| 468 // balloons gets smaller. | 468 // balloons gets smaller. |
| 469 local_state_.SetInteger(prefs::kDesktopNotificationPosition, | 469 local_state_.SetInteger(prefs::kDesktopNotificationPosition, |
| 470 BalloonCollection::UPPER_LEFT); | 470 BalloonCollection::UPPER_LEFT); |
| 471 | 471 |
| 472 int current_x = (*balloons.begin())->GetPosition().x(); | 472 int current_x = (*balloons.begin())->GetPosition().x(); |
| 473 EXPECT_LT(current_x, last_x); | 473 EXPECT_LT(current_x, last_x); |
| 474 } | 474 } |
| OLD | NEW |