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

Unified Diff: chrome/browser/sync/glue/chrome_sync_notification_bridge_unittest.cc

Issue 10824161: [Sync] Avoid unregistering object IDs on shutdown (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Work around brittle unit test Created 8 years, 4 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: chrome/browser/sync/glue/chrome_sync_notification_bridge_unittest.cc
diff --git a/chrome/browser/sync/glue/chrome_sync_notification_bridge_unittest.cc b/chrome/browser/sync/glue/chrome_sync_notification_bridge_unittest.cc
index 991b774d4be1ddb190c653a23d41f8447512d762..ed50b9ea1c778c99fd131d37e77c477ecee6d308 100644
--- a/chrome/browser/sync/glue/chrome_sync_notification_bridge_unittest.cc
+++ b/chrome/browser/sync/glue/chrome_sync_notification_bridge_unittest.cc
@@ -4,6 +4,8 @@
#include "chrome/browser/sync/glue/chrome_sync_notification_bridge.h"
+#include <cstddef>
+
#include "base/compiler_specific.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
@@ -53,6 +55,7 @@ class FakeSyncNotifierObserver : public syncer::SyncNotifierObserver {
expected_payloads_(expected_payloads),
expected_source_(expected_source) {
DCHECK(sync_task_runner_->RunsTasksOnCurrentThread());
+ bridge_->RegisterHandler(this);
const syncer::ObjectIdSet& ids =
syncer::ObjectIdPayloadMapToSet(expected_payloads);
bridge_->UpdateRegisteredIds(this, ids);
@@ -60,7 +63,7 @@ class FakeSyncNotifierObserver : public syncer::SyncNotifierObserver {
virtual ~FakeSyncNotifierObserver() {
DCHECK(sync_task_runner_->RunsTasksOnCurrentThread());
- bridge_->UpdateRegisteredIds(this, syncer::ObjectIdSet());
+ bridge_->UnregisterHandler(this);
}
// SyncNotifierObserver implementation.
@@ -120,6 +123,7 @@ class ChromeSyncNotificationBridgeTest : public testing::Test {
}
virtual void TearDown() OVERRIDE {
+ bridge_->StopForShutdown();
sync_thread_.Stop();
// Must be reset only after the sync thread is stopped.
bridge_.reset();
« no previous file with comments | « chrome/browser/sync/glue/chrome_sync_notification_bridge.cc ('k') | chrome/browser/sync/glue/sync_backend_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698