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

Unified Diff: components/invalidation/invalidator_registrar_unittest.cc

Issue 1146533005: [Sync] InvalidationService shouldn't CHECK when registering ObjectId for more than one handler (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed comments from Bartosz. Created 5 years, 7 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
Index: components/invalidation/invalidator_registrar_unittest.cc
diff --git a/components/invalidation/invalidator_registrar_unittest.cc b/components/invalidation/invalidator_registrar_unittest.cc
index 729415c4da26eb888790eaca414bfae4782c5adb..68863826f251d465d7e761fe7bcc47070e606429 100644
--- a/components/invalidation/invalidator_registrar_unittest.cc
+++ b/components/invalidation/invalidator_registrar_unittest.cc
@@ -33,9 +33,9 @@ class RegistrarInvalidator : public Invalidator {
registrar_.RegisterHandler(handler);
}
- void UpdateRegisteredIds(InvalidationHandler* handler,
+ bool UpdateRegisteredIds(InvalidationHandler* handler,
const ObjectIdSet& ids) override {
- registrar_.UpdateRegisteredIds(handler, ids);
+ return registrar_.UpdateRegisteredIds(handler, ids);
}
void UnregisterHandler(InvalidationHandler* handler) override {
@@ -109,43 +109,6 @@ INSTANTIATE_TYPED_TEST_CASE_P(
RegistrarInvalidatorTest, InvalidatorTest,
RegistrarInvalidatorTestDelegate);
-class InvalidatorRegistrarTest : public testing::Test {};
-
-// Technically the test below can be part of InvalidatorTest, but we
-// want to keep the number of death tests down.
-
-// When we expect a death via CHECK(), we can't match against the
-// CHECK() message since they are removed in official builds.
-
-#if GTEST_HAS_DEATH_TEST
-
-// Multiple registrations by different handlers on the same object ID should
-// cause a CHECK.
-TEST_F(InvalidatorRegistrarTest, MultipleRegistration) {
- const invalidation::ObjectId id1(ipc::invalidation::ObjectSource::TEST, "a");
- const invalidation::ObjectId id2(ipc::invalidation::ObjectSource::TEST, "a");
-
- InvalidatorRegistrar registrar;
-
- FakeInvalidationHandler handler1;
- registrar.RegisterHandler(&handler1);
-
- FakeInvalidationHandler handler2;
- registrar.RegisterHandler(&handler2);
-
- ObjectIdSet ids;
- ids.insert(id1);
- ids.insert(id2);
- registrar.UpdateRegisteredIds(&handler1, ids);
-
- registrar.DetachFromThreadForTest();
- EXPECT_DEATH({ registrar.UpdateRegisteredIds(&handler2, ids); }, "");
-
- registrar.UnregisterHandler(&handler2);
- registrar.UnregisterHandler(&handler1);
-}
-#endif // GTEST_HAS_DEATH_TEST
-
} // namespace
} // namespace syncer
« no previous file with comments | « components/invalidation/invalidator_registrar.cc ('k') | components/invalidation/invalidator_test_template.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698