summaryrefslogtreecommitdiffstats
path: root/content/renderer/active_notification_tracker_unittest.cc
blob: 18a78506506a4d62b766f66b40ed09bdefec9ef6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "content/renderer/active_notification_tracker.h"
#include "testing/gtest/include/gtest/gtest.h"

TEST(ActiveNotificationTrackerTest, TestLookupAndClear) {
  ActiveNotificationTracker tracker;

  WebKit::WebNotification notification1;
  int id1 = tracker.RegisterNotification(notification1);

  WebKit::WebNotification notification2;
  int id2 = tracker.RegisterNotification(notification2);

  WebKit::WebNotification result;
  tracker.GetNotification(id1, &result);
  EXPECT_TRUE(result == notification1);

  tracker.GetNotification(id2, &result);
  EXPECT_TRUE(result == notification2);

  tracker.Clear();
}