summaryrefslogtreecommitdiffstats
path: root/sync/internal_api/sync_manager_impl_unittest.cc
diff options
context:
space:
mode:
authorhaitaol@chromium.org <haitaol@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-07-31 01:31:55 +0000
committerhaitaol@chromium.org <haitaol@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-07-31 01:31:55 +0000
commit93dcabfb6d0d60e2c4a2bed38cd4803303c9a377 (patch)
tree240e9b1419d01ed7cb3b4f0486d18e760c231381 /sync/internal_api/sync_manager_impl_unittest.cc
parent496552ef030bd2eec4c072c6b3d7ba84f38c80d4 (diff)
downloadchromium_src-93dcabfb6d0d60e2c4a2bed38cd4803303c9a377.zip
chromium_src-93dcabfb6d0d60e2c4a2bed38cd4803303c9a377.tar.gz
chromium_src-93dcabfb6d0d60e2c4a2bed38cd4803303c9a377.tar.bz2
Lock-free shutdown of profile sync service. Changes include:
* Disconnect non-frontend processor/associator to stop accessing directory so that sync backend can be shut down without waiting. * Change non-frontend controller so that creation/destruction of processor/associator doesn't depend on valid controller. So scoped wait on stopping controller can be removed. * Move sync thread to PSS. It's created when starting first backend and destroyed on last browser thread. BUG=19757 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=210333 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=210955 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=213642 Review URL: https://chromiumcodereview.appspot.com/16770005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@214500 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'sync/internal_api/sync_manager_impl_unittest.cc')
-rw-r--r--sync/internal_api/sync_manager_impl_unittest.cc15
1 files changed, 8 insertions, 7 deletions
diff --git a/sync/internal_api/sync_manager_impl_unittest.cc b/sync/internal_api/sync_manager_impl_unittest.cc
index 51144b6..06bc783 100644
--- a/sync/internal_api/sync_manager_impl_unittest.cc
+++ b/sync/internal_api/sync_manager_impl_unittest.cc
@@ -68,9 +68,8 @@
#include "sync/test/engine/fake_sync_scheduler.h"
#include "sync/test/engine/test_id_factory.h"
#include "sync/test/fake_encryptor.h"
-#include "sync/test/fake_extensions_activity_monitor.h"
#include "sync/util/cryptographer.h"
-#include "sync/util/extensions_activity_monitor.h"
+#include "sync/util/extensions_activity.h"
#include "sync/util/test_unrecoverable_error_handler.h"
#include "sync/util/time.h"
#include "testing/gmock/include/gmock/gmock.h"
@@ -800,6 +799,8 @@ class SyncManagerTest : public testing::Test,
void SetUp() {
ASSERT_TRUE(temp_dir_.CreateUniqueTempDir());
+ extensions_activity_ = new ExtensionsActivity();
+
SyncCredentials credentials;
credentials.email = "foo@bar.com";
credentials.sync_token = "sometoken";
@@ -823,15 +824,16 @@ class SyncManagerTest : public testing::Test,
false,
scoped_ptr<HttpPostProviderFactory>(new TestHttpPostProviderFactory()),
workers,
- &extensions_activity_monitor_,
+ extensions_activity_.get(),
this,
credentials,
"fake_invalidator_client_id",
std::string(),
std::string(), // bootstrap tokens
- scoped_ptr<InternalComponentsFactory>(GetFactory()),
+ scoped_ptr<InternalComponentsFactory>(GetFactory()).get(),
&encryptor_,
- &handler_,
+ scoped_ptr<UnrecoverableErrorHandler>(
+ new TestUnrecoverableErrorHandler).Pass(),
NULL,
false);
@@ -1010,11 +1012,10 @@ class SyncManagerTest : public testing::Test,
base::ScopedTempDir temp_dir_;
// Sync Id's for the roots of the enabled datatypes.
std::map<ModelType, int64> type_roots_;
- FakeExtensionsActivityMonitor extensions_activity_monitor_;
+ scoped_refptr<ExtensionsActivity> extensions_activity_;
protected:
FakeEncryptor encryptor_;
- TestUnrecoverableErrorHandler handler_;
SyncManagerImpl sync_manager_;
WeakHandle<JsBackend> js_backend_;
StrictMock<SyncManagerObserverMock> manager_observer_;