OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 // This class defines tests that implementations of InvalidationService should | 5 // This class defines tests that implementations of InvalidationService should |
6 // pass in order to be conformant. Here's how you use it to test your | 6 // pass in order to be conformant. Here's how you use it to test your |
7 // implementation. | 7 // implementation. |
8 // | 8 // |
9 // Say your class is called MyInvalidationService. Then you need to define a | 9 // Say your class is called MyInvalidationService. Then you need to define a |
10 // class called MyInvalidationServiceTestDelegate in | 10 // class called MyInvalidationServiceTestDelegate in |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 // InvalidationServiceTest, | 66 // InvalidationServiceTest, |
67 // MyInvalidatorTestDelegate); | 67 // MyInvalidatorTestDelegate); |
68 // | 68 // |
69 // Easy! | 69 // Easy! |
70 | 70 |
71 #ifndef CHROME_BROWSER_INVALIDATION_INVALIDATION_SERVICE_TEST_TEMPLATE_H_ | 71 #ifndef CHROME_BROWSER_INVALIDATION_INVALIDATION_SERVICE_TEST_TEMPLATE_H_ |
72 #define CHROME_BROWSER_INVALIDATION_INVALIDATION_SERVICE_TEST_TEMPLATE_H_ | 72 #define CHROME_BROWSER_INVALIDATION_INVALIDATION_SERVICE_TEST_TEMPLATE_H_ |
73 | 73 |
74 #include "base/basictypes.h" | 74 #include "base/basictypes.h" |
75 #include "base/compiler_specific.h" | 75 #include "base/compiler_specific.h" |
76 #include "components/invalidation/fake_invalidation_handler.h" | |
77 #include "components/invalidation/invalidation_service.h" | 76 #include "components/invalidation/invalidation_service.h" |
78 #include "content/public/test/test_browser_thread_bundle.h" | 77 #include "content/public/test/test_browser_thread_bundle.h" |
79 #include "google/cacheinvalidation/include/types.h" | 78 #include "google/cacheinvalidation/include/types.h" |
80 #include "google/cacheinvalidation/types.pb.h" | 79 #include "google/cacheinvalidation/types.pb.h" |
81 #include "sync/internal_api/public/base/ack_handle.h" | 80 #include "sync/internal_api/public/base/ack_handle.h" |
82 #include "sync/internal_api/public/base/invalidation.h" | 81 #include "sync/internal_api/public/base/invalidation.h" |
83 #include "sync/internal_api/public/base/object_id_invalidation_map_test_util.h" | 82 #include "sync/internal_api/public/base/object_id_invalidation_map_test_util.h" |
| 83 #include "sync/notifier/fake_invalidation_handler.h" |
84 #include "sync/notifier/object_id_invalidation_map.h" | 84 #include "sync/notifier/object_id_invalidation_map.h" |
85 #include "testing/gtest/include/gtest/gtest.h" | 85 #include "testing/gtest/include/gtest/gtest.h" |
86 | 86 |
87 template <typename InvalidatorTestDelegate> | 87 template <typename InvalidatorTestDelegate> |
88 class InvalidationServiceTest : public testing::Test { | 88 class InvalidationServiceTest : public testing::Test { |
89 protected: | 89 protected: |
90 InvalidationServiceTest() | 90 InvalidationServiceTest() |
91 : id1(ipc::invalidation::ObjectSource::CHROME_SYNC, "BOOKMARK"), | 91 : id1(ipc::invalidation::ObjectSource::CHROME_SYNC, "BOOKMARK"), |
92 id2(ipc::invalidation::ObjectSource::CHROME_SYNC, "PREFERENCE"), | 92 id2(ipc::invalidation::ObjectSource::CHROME_SYNC, "PREFERENCE"), |
93 id3(ipc::invalidation::ObjectSource::CHROME_SYNC, "AUTOFILL"), | 93 id3(ipc::invalidation::ObjectSource::CHROME_SYNC, "AUTOFILL"), |
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
381 handler.GetLastRetrievedState()); | 381 handler.GetLastRetrievedState()); |
382 | 382 |
383 invalidator->UnregisterInvalidationHandler(&handler); | 383 invalidator->UnregisterInvalidationHandler(&handler); |
384 } | 384 } |
385 | 385 |
386 REGISTER_TYPED_TEST_CASE_P(InvalidationServiceTest, | 386 REGISTER_TYPED_TEST_CASE_P(InvalidationServiceTest, |
387 Basic, MultipleHandlers, EmptySetUnregisters, | 387 Basic, MultipleHandlers, EmptySetUnregisters, |
388 GetInvalidatorStateAlwaysCurrent); | 388 GetInvalidatorStateAlwaysCurrent); |
389 | 389 |
390 #endif // CHROME_BROWSER_INVALIDATION_INVALIDATION_SERVICE_TEST_TEMPLATE_H_ | 390 #endif // CHROME_BROWSER_INVALIDATION_INVALIDATION_SERVICE_TEST_TEMPLATE_H_ |
OLD | NEW |