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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 | 85 |
86 DesktopNotificationsTest::DesktopNotificationsTest() | 86 DesktopNotificationsTest::DesktopNotificationsTest() |
87 : ui_thread_(BrowserThread::UI, &message_loop_) { | 87 : ui_thread_(BrowserThread::UI, &message_loop_) { |
88 } | 88 } |
89 | 89 |
90 DesktopNotificationsTest::~DesktopNotificationsTest() { | 90 DesktopNotificationsTest::~DesktopNotificationsTest() { |
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_); | 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 browser::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_)); |
(...skipping 359 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 |