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 <deque> | 5 #include <deque> |
6 #include <string> | 6 #include <string> |
7 | 7 |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/callback.h" | 9 #include "base/callback.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 OnMessageCenterChanged(); | 105 OnMessageCenterChanged(); |
106 } | 106 } |
107 | 107 |
108 virtual void OnNotificationUpdated( | 108 virtual void OnNotificationUpdated( |
109 const std::string& notification_id) OVERRIDE { | 109 const std::string& notification_id) OVERRIDE { |
110 OnMessageCenterChanged(); | 110 OnMessageCenterChanged(); |
111 } | 111 } |
112 | 112 |
113 void OnMessageCenterChanged() { | 113 void OnMessageCenterChanged() { |
114 notification_received_ = true; | 114 notification_received_ = true; |
115 if (message_loop_runner_) | 115 if (message_loop_runner_.get()) |
116 message_loop_runner_->Quit(); | 116 message_loop_runner_->Quit(); |
117 } | 117 } |
118 | 118 |
119 bool notification_received_; | 119 bool notification_received_; |
120 scoped_refptr<content::MessageLoopRunner> message_loop_runner_; | 120 scoped_refptr<content::MessageLoopRunner> message_loop_runner_; |
121 | 121 |
122 DISALLOW_COPY_AND_ASSIGN(MessageCenterChangeObserver); | 122 DISALLOW_COPY_AND_ASSIGN(MessageCenterChangeObserver); |
123 }; | 123 }; |
124 | 124 |
125 class NotificationBalloonChangeObserver | 125 class NotificationBalloonChangeObserver |
(...skipping 831 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
957 const std::deque<Balloon*>& balloons = GetActiveBalloons(); | 957 const std::deque<Balloon*>& balloons = GetActiveBalloons(); |
958 ASSERT_EQ(1U, balloons.size()); | 958 ASSERT_EQ(1U, balloons.size()); |
959 Balloon* balloon = balloons[0]; | 959 Balloon* balloon = balloons[0]; |
960 const Notification& notification = balloon->notification(); | 960 const Notification& notification = balloon->notification(); |
961 GURL EXPECTED_ICON_URL = test_server()->GetURL(kExpectedIconUrl); | 961 GURL EXPECTED_ICON_URL = test_server()->GetURL(kExpectedIconUrl); |
962 EXPECT_EQ(EXPECTED_ICON_URL, notification.icon_url()); | 962 EXPECT_EQ(EXPECTED_ICON_URL, notification.icon_url()); |
963 EXPECT_EQ(ASCIIToUTF16("Title2"), notification.title()); | 963 EXPECT_EQ(ASCIIToUTF16("Title2"), notification.title()); |
964 EXPECT_EQ(ASCIIToUTF16("Body2"), notification.body()); | 964 EXPECT_EQ(ASCIIToUTF16("Body2"), notification.body()); |
965 } | 965 } |
966 } | 966 } |
OLD | NEW |