OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "sync/notifier/invalidator_factory.h" | 5 #include "sync/notifier/invalidator_factory.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 15 matching lines...) Expand all Loading... |
26 class InvalidatorFactoryTest : public testing::Test { | 26 class InvalidatorFactoryTest : public testing::Test { |
27 protected: | 27 protected: |
28 | 28 |
29 virtual void SetUp() OVERRIDE { | 29 virtual void SetUp() OVERRIDE { |
30 notifier_options_.request_context_getter = | 30 notifier_options_.request_context_getter = |
31 new TestURLRequestContextGetter(message_loop_.message_loop_proxy()); | 31 new TestURLRequestContextGetter(message_loop_.message_loop_proxy()); |
32 } | 32 } |
33 | 33 |
34 virtual void TearDown() OVERRIDE { | 34 virtual void TearDown() OVERRIDE { |
35 message_loop_.RunAllPending(); | 35 message_loop_.RunAllPending(); |
36 EXPECT_EQ(0, fake_handler_.GetNotificationCount()); | 36 EXPECT_EQ(0, fake_handler_.GetInvalidationCount()); |
37 } | 37 } |
38 | 38 |
39 MessageLoop message_loop_; | 39 MessageLoop message_loop_; |
40 FakeInvalidationHandler fake_handler_; | 40 FakeInvalidationHandler fake_handler_; |
41 notifier::NotifierOptions notifier_options_; | 41 notifier::NotifierOptions notifier_options_; |
42 scoped_ptr<InvalidatorFactory> factory_; | 42 scoped_ptr<InvalidatorFactory> factory_; |
43 }; | 43 }; |
44 | 44 |
45 // Test basic creation of a NonBlockingInvalidationNotifier. | 45 // Test basic creation of a NonBlockingInvalidationNotifier. |
46 TEST_F(InvalidatorFactoryTest, Basic) { | 46 TEST_F(InvalidatorFactoryTest, Basic) { |
(...skipping 28 matching lines...) Expand all Loading... |
75 ASSERT_TRUE(invalidator.get()); | 75 ASSERT_TRUE(invalidator.get()); |
76 ObjectIdSet ids = ModelTypeSetToObjectIdSet(ModelTypeSet(syncer::BOOKMARKS)); | 76 ObjectIdSet ids = ModelTypeSetToObjectIdSet(ModelTypeSet(syncer::BOOKMARKS)); |
77 invalidator->RegisterHandler(&fake_handler_); | 77 invalidator->RegisterHandler(&fake_handler_); |
78 invalidator->UpdateRegisteredIds(&fake_handler_, ids); | 78 invalidator->UpdateRegisteredIds(&fake_handler_, ids); |
79 invalidator->UnregisterHandler(&fake_handler_); | 79 invalidator->UnregisterHandler(&fake_handler_); |
80 #endif | 80 #endif |
81 } | 81 } |
82 | 82 |
83 } // namespace | 83 } // namespace |
84 } // namespace syncer | 84 } // namespace syncer |
OLD | NEW |