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

Unified Diff: sync/internal_api/sync_core_proxy_impl_unittest.cc

Issue 351523003: sync: Mass rename of non-blocking sync classes (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: const ref some smart pointers Created 6 years, 6 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/internal_api/sync_core_proxy_impl.cc ('k') | sync/internal_api/sync_manager_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/internal_api/sync_core_proxy_impl_unittest.cc
diff --git a/sync/internal_api/sync_core_proxy_impl_unittest.cc b/sync/internal_api/sync_core_proxy_impl_unittest.cc
deleted file mode 100644
index 25b3d9e9c956d40f43330e1bd5e365b1f63f5cd7..0000000000000000000000000000000000000000
--- a/sync/internal_api/sync_core_proxy_impl_unittest.cc
+++ /dev/null
@@ -1,93 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "base/message_loop/message_loop.h"
-#include "base/message_loop/message_loop_proxy.h"
-#include "base/run_loop.h"
-#include "base/sequenced_task_runner.h"
-#include "sync/engine/non_blocking_type_processor.h"
-#include "sync/internal_api/public/base/model_type.h"
-#include "sync/internal_api/sync_core.h"
-#include "sync/internal_api/sync_core_proxy_impl.h"
-#include "sync/sessions/model_type_registry.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-namespace syncer {
-
-class SyncCoreProxyImplTest : public ::testing::Test {
- public:
- SyncCoreProxyImplTest()
- : sync_task_runner_(base::MessageLoopProxy::current()),
- type_task_runner_(base::MessageLoopProxy::current()),
- core_(new SyncCore(&registry_)),
- core_proxy_(
- sync_task_runner_,
- core_->AsWeakPtr()) {}
-
- // The sync thread could be shut down at any time without warning. This
- // function simulates such an event.
- void DisableSync() {
- core_.reset();
- }
-
- scoped_ptr<SyncCoreProxy> GetProxy() { return core_proxy_.Clone(); }
-
- private:
- base::MessageLoop loop_;
- scoped_refptr<base::SequencedTaskRunner> sync_task_runner_;
- scoped_refptr<base::SequencedTaskRunner> type_task_runner_;
- ModelTypeRegistry registry_;
- scoped_ptr<SyncCore> core_;
- SyncCoreProxyImpl core_proxy_;
-};
-
-// Try to connect a type to a SyncCore that has already shut down.
-TEST_F(SyncCoreProxyImplTest, FailToConnect1) {
- NonBlockingTypeProcessor themes_processor(syncer::THEMES);
- DisableSync();
- themes_processor.Enable(GetProxy());
-
- base::RunLoop run_loop_;
- run_loop_.RunUntilIdle();
- EXPECT_FALSE(themes_processor.IsConnected());
-}
-
-// Try to connect a type to a SyncCore as it shuts down.
-TEST_F(SyncCoreProxyImplTest, FailToConnect2) {
- NonBlockingTypeProcessor themes_processor(syncer::THEMES);
- themes_processor.Enable(GetProxy());
- DisableSync();
-
- base::RunLoop run_loop_;
- run_loop_.RunUntilIdle();
- EXPECT_FALSE(themes_processor.IsConnected());
-}
-
-// Tests the case where the type's processor shuts down first.
-TEST_F(SyncCoreProxyImplTest, TypeDisconnectsFirst) {
- scoped_ptr<NonBlockingTypeProcessor> themes_processor
- (new NonBlockingTypeProcessor(syncer::THEMES));
- themes_processor->Enable(GetProxy());
-
- base::RunLoop run_loop_;
- run_loop_.RunUntilIdle();
-
- EXPECT_TRUE(themes_processor->IsConnected());
- themes_processor.reset();
-}
-
-// Tests the case where the sync thread shuts down first.
-TEST_F(SyncCoreProxyImplTest, SyncDisconnectsFirst) {
- scoped_ptr<NonBlockingTypeProcessor> themes_processor
- (new NonBlockingTypeProcessor(syncer::THEMES));
- themes_processor->Enable(GetProxy());
-
- base::RunLoop run_loop_;
- run_loop_.RunUntilIdle();
-
- EXPECT_TRUE(themes_processor->IsConnected());
- DisableSync();
-}
-
-} // namespace syncer
« no previous file with comments | « sync/internal_api/sync_core_proxy_impl.cc ('k') | sync/internal_api/sync_manager_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698