summaryrefslogtreecommitdiffstats
path: root/content/common/notification_service_unittest.cc
diff options
context:
space:
mode:
Diffstat (limited to 'content/common/notification_service_unittest.cc')
-rw-r--r--content/common/notification_service_unittest.cc50
1 files changed, 25 insertions, 25 deletions
diff --git a/content/common/notification_service_unittest.cc b/content/common/notification_service_unittest.cc
index 3251448..cff4420 100644
--- a/content/common/notification_service_unittest.cc
+++ b/content/common/notification_service_unittest.cc
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "content/common/notification_observer.h"
-#include "content/common/notification_registrar.h"
+#include "content/public/browser/notification_observer.h"
+#include "content/public/browser/notification_registrar.h"
#include "content/common/notification_service.h"
#include "content/public/browser/notification_types.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -13,15 +13,15 @@ namespace {
// Bogus class to act as a NotificationSource for the messages.
class TestSource {};
-class TestObserver : public NotificationObserver {
+class TestObserver : public content::NotificationObserver {
public:
TestObserver() : notification_count_(0) {}
int notification_count() { return notification_count_; }
void Observe(int type,
- const NotificationSource& source,
- const NotificationDetails& details) {
+ const content::NotificationSource& source,
+ const content::NotificationDetails& details) {
++notification_count_;
}
@@ -34,7 +34,7 @@ private:
class NotificationServiceTest : public testing::Test {
protected:
- NotificationRegistrar registrar_;
+ content::NotificationRegistrar registrar_;
};
TEST_F(NotificationServiceTest, Basic) {
@@ -42,10 +42,10 @@ TEST_F(NotificationServiceTest, Basic) {
TestSource other_source;
// Check the equality operators defined for NotificationSource
- EXPECT_TRUE(
- Source<TestSource>(&test_source) == Source<TestSource>(&test_source));
- EXPECT_TRUE(
- Source<TestSource>(&test_source) != Source<TestSource>(&other_source));
+ EXPECT_TRUE(content::Source<TestSource>(&test_source) ==
+ Source<TestSource>(&test_source));
+ EXPECT_TRUE(content::Source<TestSource>(&test_source) !=
+ content::Source<TestSource>(&other_source));
TestObserver all_types_all_sources;
TestObserver idle_all_sources;
@@ -55,7 +55,7 @@ TEST_F(NotificationServiceTest, Basic) {
// Make sure it doesn't freak out when there are no observers.
NotificationService* service = NotificationService::current();
service->Notify(content::NOTIFICATION_IDLE,
- Source<TestSource>(&test_source),
+ content::Source<TestSource>(&test_source),
NotificationService::NoDetails());
registrar_.Add(&all_types_all_sources, content::NOTIFICATION_ALL,
@@ -63,9 +63,9 @@ TEST_F(NotificationServiceTest, Basic) {
registrar_.Add(&idle_all_sources, content::NOTIFICATION_IDLE,
NotificationService::AllSources());
registrar_.Add(&all_types_test_source, content::NOTIFICATION_ALL,
- Source<TestSource>(&test_source));
+ content::Source<TestSource>(&test_source));
registrar_.Add(&idle_test_source, content::NOTIFICATION_IDLE,
- Source<TestSource>(&test_source));
+ content::Source<TestSource>(&test_source));
EXPECT_EQ(0, all_types_all_sources.notification_count());
EXPECT_EQ(0, idle_all_sources.notification_count());
@@ -73,7 +73,7 @@ TEST_F(NotificationServiceTest, Basic) {
EXPECT_EQ(0, idle_test_source.notification_count());
service->Notify(content::NOTIFICATION_IDLE,
- Source<TestSource>(&test_source),
+ content::Source<TestSource>(&test_source),
NotificationService::NoDetails());
EXPECT_EQ(1, all_types_all_sources.notification_count());
@@ -82,7 +82,7 @@ TEST_F(NotificationServiceTest, Basic) {
EXPECT_EQ(1, idle_test_source.notification_count());
service->Notify(content::NOTIFICATION_BUSY,
- Source<TestSource>(&test_source),
+ content::Source<TestSource>(&test_source),
NotificationService::NoDetails());
EXPECT_EQ(2, all_types_all_sources.notification_count());
@@ -91,7 +91,7 @@ TEST_F(NotificationServiceTest, Basic) {
EXPECT_EQ(1, idle_test_source.notification_count());
service->Notify(content::NOTIFICATION_IDLE,
- Source<TestSource>(&other_source),
+ content::Source<TestSource>(&other_source),
NotificationService::NoDetails());
EXPECT_EQ(3, all_types_all_sources.notification_count());
@@ -100,7 +100,7 @@ TEST_F(NotificationServiceTest, Basic) {
EXPECT_EQ(1, idle_test_source.notification_count());
service->Notify(content::NOTIFICATION_BUSY,
- Source<TestSource>(&other_source),
+ content::Source<TestSource>(&other_source),
NotificationService::NoDetails());
EXPECT_EQ(4, all_types_all_sources.notification_count());
@@ -121,7 +121,7 @@ TEST_F(NotificationServiceTest, Basic) {
registrar_.RemoveAll();
service->Notify(content::NOTIFICATION_IDLE,
- Source<TestSource>(&test_source),
+ content::Source<TestSource>(&test_source),
NotificationService::NoDetails());
EXPECT_EQ(5, all_types_all_sources.notification_count());
@@ -138,28 +138,28 @@ TEST_F(NotificationServiceTest, MultipleRegistration) {
NotificationService* service = NotificationService::current();
registrar_.Add(&idle_test_source, content::NOTIFICATION_IDLE,
- Source<TestSource>(&test_source));
+ content::Source<TestSource>(&test_source));
registrar_.Add(&idle_test_source, content::NOTIFICATION_ALL,
- Source<TestSource>(&test_source));
+ content::Source<TestSource>(&test_source));
service->Notify(content::NOTIFICATION_IDLE,
- Source<TestSource>(&test_source),
+ content::Source<TestSource>(&test_source),
NotificationService::NoDetails());
EXPECT_EQ(2, idle_test_source.notification_count());
registrar_.Remove(&idle_test_source, content::NOTIFICATION_IDLE,
- Source<TestSource>(&test_source));
+ content::Source<TestSource>(&test_source));
service->Notify(content::NOTIFICATION_IDLE,
- Source<TestSource>(&test_source),
+ content::Source<TestSource>(&test_source),
NotificationService::NoDetails());
EXPECT_EQ(3, idle_test_source.notification_count());
registrar_.Remove(&idle_test_source, content::NOTIFICATION_ALL,
- Source<TestSource>(&test_source));
+ content::Source<TestSource>(&test_source));
service->Notify(content::NOTIFICATION_IDLE,
- Source<TestSource>(&test_source),
+ content::Source<TestSource>(&test_source),
NotificationService::NoDetails());
EXPECT_EQ(3, idle_test_source.notification_count());
}