OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/common/desktop_notifications/active_notification_tracker.h" | 5 #include "content/renderer/active_notification_tracker.h" |
6 #include "testing/gtest/include/gtest/gtest.h" | 6 #include "testing/gtest/include/gtest/gtest.h" |
7 | 7 |
8 TEST(ActiveNotificationTrackerTest, TestLookupAndClear) { | 8 TEST(ActiveNotificationTrackerTest, TestLookupAndClear) { |
9 ActiveNotificationTracker tracker; | 9 ActiveNotificationTracker tracker; |
10 | 10 |
11 WebKit::WebNotification notification1; | 11 WebKit::WebNotification notification1; |
12 int id1 = tracker.RegisterNotification(notification1); | 12 int id1 = tracker.RegisterNotification(notification1); |
13 | 13 |
14 WebKit::WebNotification notification2; | 14 WebKit::WebNotification notification2; |
15 int id2 = tracker.RegisterNotification(notification2); | 15 int id2 = tracker.RegisterNotification(notification2); |
16 | 16 |
17 WebKit::WebNotification result; | 17 WebKit::WebNotification result; |
18 tracker.GetNotification(id1, &result); | 18 tracker.GetNotification(id1, &result); |
19 EXPECT_TRUE(result == notification1); | 19 EXPECT_TRUE(result == notification1); |
20 | 20 |
21 tracker.GetNotification(id2, &result); | 21 tracker.GetNotification(id2, &result); |
22 EXPECT_TRUE(result == notification2); | 22 EXPECT_TRUE(result == notification2); |
23 | 23 |
24 tracker.Clear(); | 24 tracker.Clear(); |
25 } | 25 } |
OLD | NEW |