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

Unified Diff: sync/notifier/sync_invalidation_listener_unittest.cc

Issue 12094113: Migrate invalidator client IDs out of sync (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix sync_client compile errors Created 7 years, 10 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/sync_invalidation_listener.cc ('k') | sync/tools/null_invalidation_state_tracker.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/notifier/sync_invalidation_listener_unittest.cc
diff --git a/sync/notifier/sync_invalidation_listener_unittest.cc b/sync/notifier/sync_invalidation_listener_unittest.cc
index 4ab5b99e732f0a750896d0185cd6701d01b9965a..37016a880ffe694428e504b307eb88808b80ab42 100644
--- a/sync/notifier/sync_invalidation_listener_unittest.cc
+++ b/sync/notifier/sync_invalidation_listener_unittest.cc
@@ -226,6 +226,10 @@ class SyncInvalidationListenerTest : public testing::Test {
return fake_tracker_.GetMaxVersion(id);
}
+ std::string GetInvalidatorClientId() const {
+ return fake_tracker_.GetInvalidatorClientId();
+ }
+
std::string GetBootstrapData() const {
return fake_tracker_.GetBootstrapData();
}
@@ -300,6 +304,11 @@ class SyncInvalidationListenerTest : public testing::Test {
MakeWeakHandle(fake_tracker_.AsWeakPtr()),
&fake_delegate_);
DCHECK(fake_invalidation_client_);
+
+ // TODO(rlarocque): This is necessary for the deferred write of the client
+ // ID to take place. We can remove this statement when we remove the
+ // WriteInvalidatorClientId test. See crbug.com/124142.
+ message_loop_.RunUntilIdle();
}
void StopClient() {
@@ -326,6 +335,14 @@ class SyncInvalidationListenerTest : public testing::Test {
SyncInvalidationListener client_;
};
+// Verify the client ID is written to the state tracker on client start.
+// TODO(rlarocque): Remove this test when migration code is removed.
+// See crbug.com/124142.
+TEST_F(SyncInvalidationListenerTest, WriteInvalidatorClientId) {
+ // The client is started by the harness, so we don't have to do anything here.
+ EXPECT_EQ(kClientId, GetInvalidatorClientId());
+}
+
// Write a new state to the client. It should propagate to the
// tracker.
TEST_F(SyncInvalidationListenerTest, WriteState) {
« no previous file with comments | « sync/notifier/sync_invalidation_listener.cc ('k') | sync/tools/null_invalidation_state_tracker.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698