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/synchronization/waitable_event.h" | 5 #include "base/synchronization/waitable_event.h" |
6 #include "base/test/test_timeouts.h" | 6 #include "base/test/test_timeouts.h" |
7 #include "chrome/browser/sync/engine/mock_model_safe_workers.h" | 7 #include "chrome/browser/sync/engine/mock_model_safe_workers.h" |
8 #include "chrome/browser/sync/engine/configure_reason.h" | 8 #include "chrome/browser/sync/engine/configure_reason.h" |
9 #include "chrome/browser/sync/engine/syncer.h" | 9 #include "chrome/browser/sync/engine/syncer.h" |
10 #include "chrome/browser/sync/engine/syncer_thread.h" | 10 #include "chrome/browser/sync/engine/syncer_thread.h" |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 syncer_ = new MockSyncer(); | 63 syncer_ = new MockSyncer(); |
64 delay_ = NULL; | 64 delay_ = NULL; |
65 registrar_.reset(MockModelSafeWorkerRegistrar::PassiveForTypes( | 65 registrar_.reset(MockModelSafeWorkerRegistrar::PassiveForTypes( |
66 model_types)); | 66 model_types)); |
67 connection_.reset(new MockConnectionManager(syncdb_.manager(), "Test")); | 67 connection_.reset(new MockConnectionManager(syncdb_.manager(), "Test")); |
68 connection_->SetServerReachable(); | 68 connection_->SetServerReachable(); |
69 context_ = new SyncSessionContext(connection_.get(), syncdb_.manager(), | 69 context_ = new SyncSessionContext(connection_.get(), syncdb_.manager(), |
70 registrar_.get(), std::vector<SyncEngineEventListener*>()); | 70 registrar_.get(), std::vector<SyncEngineEventListener*>()); |
71 context_->set_notifications_enabled(true); | 71 context_->set_notifications_enabled(true); |
72 context_->set_account_name("Test"); | 72 context_->set_account_name("Test"); |
73 syncer_thread_.reset(new SyncerThread(context_, syncer_)); | 73 syncer_thread_.reset( |
| 74 new SyncerThread("TestSyncerThread", context_, syncer_)); |
74 } | 75 } |
75 | 76 |
76 SyncerThread* syncer_thread() { return syncer_thread_.get(); } | 77 SyncerThread* syncer_thread() { return syncer_thread_.get(); } |
77 MockSyncer* syncer() { return syncer_; } | 78 MockSyncer* syncer() { return syncer_; } |
78 MockDelayProvider* delay() { return delay_; } | 79 MockDelayProvider* delay() { return delay_; } |
79 MockConnectionManager* connection() { return connection_.get(); } | 80 MockConnectionManager* connection() { return connection_.get(); } |
80 TimeDelta zero() { return TimeDelta::FromSeconds(0); } | 81 TimeDelta zero() { return TimeDelta::FromSeconds(0); } |
81 TimeDelta timeout() { | 82 TimeDelta timeout() { |
82 return TimeDelta::FromMilliseconds(TestTimeouts::action_timeout_ms()); | 83 return TimeDelta::FromMilliseconds(TestTimeouts::action_timeout_ms()); |
83 } | 84 } |
(...skipping 840 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
924 FlushLastTask(&done); | 925 FlushLastTask(&done); |
925 syncer_thread()->Stop(); | 926 syncer_thread()->Stop(); |
926 | 927 |
927 EXPECT_TRUE(expected == context()->previous_session_routing_info()); | 928 EXPECT_TRUE(expected == context()->previous_session_routing_info()); |
928 } | 929 } |
929 | 930 |
930 } // namespace browser_sync | 931 } // namespace browser_sync |
931 | 932 |
932 // SyncerThread won't outlive the test! | 933 // SyncerThread won't outlive the test! |
933 DISABLE_RUNNABLE_METHOD_REFCOUNT(browser_sync::SyncerThreadTest); | 934 DISABLE_RUNNABLE_METHOD_REFCOUNT(browser_sync::SyncerThreadTest); |
OLD | NEW |