| OLD | NEW |
| 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_thread.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" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 class SyncerThreadWhiteboxTest : public testing::Test { | 22 class SyncerThreadWhiteboxTest : public testing::Test { |
| 23 public: | 23 public: |
| 24 virtual void SetUp() { | 24 virtual void SetUp() { |
| 25 syncdb_.SetUp(); | 25 syncdb_.SetUp(); |
| 26 Syncer* syncer = new Syncer(); | 26 Syncer* syncer = new Syncer(); |
| 27 registrar_.reset(MockModelSafeWorkerRegistrar::PassiveBookmarks()); | 27 registrar_.reset(MockModelSafeWorkerRegistrar::PassiveBookmarks()); |
| 28 context_ = new SyncSessionContext(connection_.get(), syncdb_.manager(), | 28 context_ = new SyncSessionContext(connection_.get(), syncdb_.manager(), |
| 29 registrar_.get(), std::vector<SyncEngineEventListener*>()); | 29 registrar_.get(), std::vector<SyncEngineEventListener*>()); |
| 30 context_->set_notifications_enabled(true); | 30 context_->set_notifications_enabled(true); |
| 31 context_->set_account_name("Test"); | 31 context_->set_account_name("Test"); |
| 32 syncer_thread_.reset(new SyncerThread(context_, syncer)); | 32 syncer_thread_.reset( |
| 33 new SyncerThread("TestSyncerThreadWhitebox", context_, syncer)); |
| 33 } | 34 } |
| 34 | 35 |
| 35 virtual void TearDown() { | 36 virtual void TearDown() { |
| 36 syncdb_.TearDown(); | 37 syncdb_.TearDown(); |
| 37 } | 38 } |
| 38 | 39 |
| 39 void SetMode(SyncerThread::Mode mode) { | 40 void SetMode(SyncerThread::Mode mode) { |
| 40 syncer_thread_->mode_ = mode; | 41 syncer_thread_->mode_ = mode; |
| 41 } | 42 } |
| 42 | 43 |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 222 SyncerThread::JobProcessDecision decision = DecideOnJob(job); | 223 SyncerThread::JobProcessDecision decision = DecideOnJob(job); |
| 223 | 224 |
| 224 EXPECT_EQ(decision, SyncerThread::CONTINUE); | 225 EXPECT_EQ(decision, SyncerThread::CONTINUE); |
| 225 } | 226 } |
| 226 | 227 |
| 227 } // namespace browser_sync | 228 } // namespace browser_sync |
| 228 | 229 |
| 229 // SyncerThread won't outlive the test! | 230 // SyncerThread won't outlive the test! |
| 230 DISABLE_RUNNABLE_METHOD_REFCOUNT( | 231 DISABLE_RUNNABLE_METHOD_REFCOUNT( |
| 231 browser_sync::SyncerThreadWhiteboxTest); | 232 browser_sync::SyncerThreadWhiteboxTest); |
| OLD | NEW |