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

Side by Side Diff: chrome/browser/sync/engine/syncer_thread2_whitebox_unittest.cc

Issue 6874018: make new syncer thread the default. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Upload before submit. Created 9 years, 8 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/time.h" 5 #include "base/time.h"
6 #include "chrome/browser/sync/engine/mock_model_safe_workers.h" 6 #include "chrome/browser/sync/engine/mock_model_safe_workers.h"
7 #include "chrome/browser/sync/engine/syncer_thread2.h" 7 #include "chrome/browser/sync/engine/syncer_thread.h"
8 #include "chrome/browser/sync/sessions/sync_session_context.h" 8 #include "chrome/browser/sync/sessions/sync_session_context.h"
9 #include "chrome/browser/sync/sessions/test_util.h" 9 #include "chrome/browser/sync/sessions/test_util.h"
10 #include "chrome/test/sync/engine/mock_connection_manager.h" 10 #include "chrome/test/sync/engine/mock_connection_manager.h"
11 #include "chrome/test/sync/engine/test_directory_setter_upper.h" 11 #include "chrome/test/sync/engine/test_directory_setter_upper.h"
12 #include "testing/gtest/include/gtest/gtest.h" 12 #include "testing/gtest/include/gtest/gtest.h"
13 #include "testing/gmock/include/gmock/gmock.h" 13 #include "testing/gmock/include/gmock/gmock.h"
14 14
15 using base::TimeDelta; 15 using base::TimeDelta;
16 using base::TimeTicks; 16 using base::TimeTicks;
17 17
18 namespace browser_sync { 18 namespace browser_sync {
19 using sessions::SyncSessionContext; 19 using sessions::SyncSessionContext;
20 using browser_sync::Syncer; 20 using browser_sync::Syncer;
21 21
22 namespace s3 {
23
24 class SyncerThread2WhiteboxTest : public testing::Test { 22 class SyncerThread2WhiteboxTest : public testing::Test {
25 public: 23 public:
26 virtual void SetUp() { 24 virtual void SetUp() {
27 syncdb_.SetUp(); 25 syncdb_.SetUp();
28 Syncer* syncer = new Syncer(); 26 Syncer* syncer = new Syncer();
29 registrar_.reset(MockModelSafeWorkerRegistrar::PassiveBookmarks()); 27 registrar_.reset(MockModelSafeWorkerRegistrar::PassiveBookmarks());
30 context_ = new SyncSessionContext(connection_.get(), syncdb_.manager(), 28 context_ = new SyncSessionContext(connection_.get(), syncdb_.manager(),
31 registrar_.get(), std::vector<SyncEngineEventListener*>()); 29 registrar_.get(), std::vector<SyncEngineEventListener*>());
32 context_->set_notifications_enabled(true); 30 context_->set_notifications_enabled(true);
33 context_->set_account_name("Test"); 31 context_->set_account_name("Test");
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 217
220 struct SyncerThread::SyncSessionJob job; 218 struct SyncerThread::SyncSessionJob job;
221 job.purpose = SyncerThread::SyncSessionJob::CONFIGURATION; 219 job.purpose = SyncerThread::SyncSessionJob::CONFIGURATION;
222 job.scheduled_start = TimeTicks::Now(); 220 job.scheduled_start = TimeTicks::Now();
223 job.is_canary_job = true; 221 job.is_canary_job = true;
224 SyncerThread::JobProcessDecision decision = DecideOnJob(job); 222 SyncerThread::JobProcessDecision decision = DecideOnJob(job);
225 223
226 EXPECT_EQ(decision, SyncerThread::CONTINUE); 224 EXPECT_EQ(decision, SyncerThread::CONTINUE);
227 } 225 }
228 226
229
230 } // namespace s3
231 } // namespace browser_sync 227 } // namespace browser_sync
232 228
233 // SyncerThread won't outlive the test! 229 // SyncerThread won't outlive the test!
234 DISABLE_RUNNABLE_METHOD_REFCOUNT( 230 DISABLE_RUNNABLE_METHOD_REFCOUNT(
235 browser_sync::s3::SyncerThread2WhiteboxTest); 231 browser_sync::SyncerThread2WhiteboxTest);
OLDNEW
« no previous file with comments | « chrome/browser/sync/engine/syncer_thread2_unittest.cc ('k') | chrome/browser/sync/engine/syncer_thread_adapter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698