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/prefs/testing_pref_service.h" | 7 #include "base/prefs/testing_pref_service.h" |
8 #include "base/strings/string_util.h" | 8 #include "base/strings/string_util.h" |
9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
10 #include "chrome/browser/notifications/balloon_notification_ui_manager.h" | 10 #include "chrome/browser/notifications/balloon_notification_ui_manager.h" |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 | 142 |
143 content::ShowDesktopNotificationHostMsgParams | 143 content::ShowDesktopNotificationHostMsgParams |
144 DesktopNotificationsTest::StandardTestNotification() { | 144 DesktopNotificationsTest::StandardTestNotification() { |
145 content::ShowDesktopNotificationHostMsgParams params; | 145 content::ShowDesktopNotificationHostMsgParams params; |
146 params.notification_id = 0; | 146 params.notification_id = 0; |
147 params.origin = GURL("http://www.google.com"); | 147 params.origin = GURL("http://www.google.com"); |
148 params.is_html = false; | 148 params.is_html = false; |
149 params.icon_url = GURL("/icon.png"); | 149 params.icon_url = GURL("/icon.png"); |
150 params.title = ASCIIToUTF16("Title"); | 150 params.title = ASCIIToUTF16("Title"); |
151 params.body = ASCIIToUTF16("Text"); | 151 params.body = ASCIIToUTF16("Text"); |
152 params.direction = WebKit::WebTextDirectionDefault; | 152 params.direction = blink::WebTextDirectionDefault; |
153 return params; | 153 return params; |
154 } | 154 } |
155 | 155 |
156 TEST_F(DesktopNotificationsTest, TestShow) { | 156 TEST_F(DesktopNotificationsTest, TestShow) { |
157 content::ShowDesktopNotificationHostMsgParams params = | 157 content::ShowDesktopNotificationHostMsgParams params = |
158 StandardTestNotification(); | 158 StandardTestNotification(); |
159 params.notification_id = 1; | 159 params.notification_id = 1; |
160 | 160 |
161 EXPECT_TRUE(service_->ShowDesktopNotification( | 161 EXPECT_TRUE(service_->ShowDesktopNotification( |
162 params, 0, 0, DesktopNotificationService::PageNotification)); | 162 params, 0, 0, DesktopNotificationService::PageNotification)); |
(...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
567 } | 567 } |
568 | 568 |
569 // Now change the position to upper left. Confirm that the X value for the | 569 // Now change the position to upper left. Confirm that the X value for the |
570 // balloons gets smaller. | 570 // balloons gets smaller. |
571 local_state_.SetInteger(prefs::kDesktopNotificationPosition, | 571 local_state_.SetInteger(prefs::kDesktopNotificationPosition, |
572 BalloonCollection::UPPER_LEFT); | 572 BalloonCollection::UPPER_LEFT); |
573 | 573 |
574 int current_x = (*balloons.begin())->GetPosition().x(); | 574 int current_x = (*balloons.begin())->GetPosition().x(); |
575 EXPECT_LT(current_x, last_x); | 575 EXPECT_LT(current_x, last_x); |
576 } | 576 } |
OLD | NEW |