blob: 18a78506506a4d62b766f66b40ed09bdefec9ef6 [file] [log] [blame]
[email protected]fe136032010-04-08 17:42:361// 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
3// found in the LICENSE file.
4
[email protected]797c3552011-03-17 00:26:185#include "content/renderer/active_notification_tracker.h"
[email protected]fe136032010-04-08 17:42:366#include "testing/gtest/include/gtest/gtest.h"
7
[email protected]8fbbe472010-05-10 18:14:018TEST(ActiveNotificationTrackerTest, TestLookupAndClear) {
[email protected]fe136032010-04-08 17:42:369 ActiveNotificationTracker tracker;
10
11 WebKit::WebNotification notification1;
12 int id1 = tracker.RegisterNotification(notification1);
13
14 WebKit::WebNotification notification2;
15 int id2 = tracker.RegisterNotification(notification2);
16
17 WebKit::WebNotification result;
18 tracker.GetNotification(id1, &result);
19 EXPECT_TRUE(result == notification1);
20
21 tracker.GetNotification(id2, &result);
22 EXPECT_TRUE(result == notification2);
23
24 tracker.Clear();
25}