Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(859)

Unified Diff: sync/notifier/invalidator_factory_unittest.cc

Issue 15580002: Make use of InvalidationService (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sync/notifier/invalidator_factory.cc ('k') | sync/notifier/invalidator_registrar.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/notifier/invalidator_factory_unittest.cc
diff --git a/sync/notifier/invalidator_factory_unittest.cc b/sync/notifier/invalidator_factory_unittest.cc
deleted file mode 100644
index 31b95fc49a8a8271b0e4f73764970b19854ca314..0000000000000000000000000000000000000000
--- a/sync/notifier/invalidator_factory_unittest.cc
+++ /dev/null
@@ -1,85 +0,0 @@
-// Copyright (c) 2012 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 "sync/notifier/invalidator_factory.h"
-
-#include "base/command_line.h"
-#include "base/compiler_specific.h"
-#include "base/memory/ref_counted.h"
-#include "base/memory/scoped_ptr.h"
-#include "base/memory/weak_ptr.h"
-#include "base/message_loop.h"
-#include "base/threading/thread.h"
-#include "jingle/notifier/base/notification_method.h"
-#include "jingle/notifier/base/notifier_options.h"
-#include "net/url_request/url_request_test_util.h"
-#include "sync/internal_api/public/base/model_type.h"
-#include "sync/notifier/fake_invalidation_handler.h"
-#include "sync/notifier/invalidation_state_tracker.h"
-#include "sync/notifier/invalidator.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-namespace syncer {
-namespace {
-
-class InvalidatorFactoryTest : public testing::Test {
- protected:
-
- virtual void SetUp() OVERRIDE {
- notifier_options_.request_context_getter =
- new net::TestURLRequestContextGetter(
- message_loop_.message_loop_proxy());
- }
-
- virtual void TearDown() OVERRIDE {
- message_loop_.RunUntilIdle();
- EXPECT_EQ(0, fake_handler_.GetInvalidationCount());
- }
-
- base::MessageLoop message_loop_;
- FakeInvalidationHandler fake_handler_;
- notifier::NotifierOptions notifier_options_;
- scoped_ptr<InvalidatorFactory> factory_;
-};
-
-// Test basic creation of a NonBlockingInvalidationNotifier.
-TEST_F(InvalidatorFactoryTest, Basic) {
- notifier_options_.notification_method = notifier::NOTIFICATION_SERVER;
- InvalidatorFactory factory(
- notifier_options_,
- "test client info",
- base::WeakPtr<InvalidationStateTracker>());
- scoped_ptr<Invalidator> invalidator(factory.CreateInvalidator());
-#if defined(OS_ANDROID)
- ASSERT_FALSE(invalidator.get());
-#else
- ASSERT_TRUE(invalidator.get());
- ObjectIdSet ids = ModelTypeSetToObjectIdSet(ModelTypeSet(syncer::BOOKMARKS));
- invalidator->RegisterHandler(&fake_handler_);
- invalidator->UpdateRegisteredIds(&fake_handler_, ids);
- invalidator->UnregisterHandler(&fake_handler_);
-#endif
-}
-
-// Test basic creation of a P2PNotifier.
-TEST_F(InvalidatorFactoryTest, Basic_P2P) {
- notifier_options_.notification_method = notifier::NOTIFICATION_P2P;
- InvalidatorFactory factory(
- notifier_options_,
- "test client info",
- base::WeakPtr<InvalidationStateTracker>());
- scoped_ptr<Invalidator> invalidator(factory.CreateInvalidator());
-#if defined(OS_ANDROID)
- ASSERT_FALSE(invalidator.get());
-#else
- ASSERT_TRUE(invalidator.get());
- ObjectIdSet ids = ModelTypeSetToObjectIdSet(ModelTypeSet(syncer::BOOKMARKS));
- invalidator->RegisterHandler(&fake_handler_);
- invalidator->UpdateRegisteredIds(&fake_handler_, ids);
- invalidator->UnregisterHandler(&fake_handler_);
-#endif
-}
-
-} // namespace
-} // namespace syncer
« no previous file with comments | « sync/notifier/invalidator_factory.cc ('k') | sync/notifier/invalidator_registrar.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698