OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 <list> | 5 #include <list> |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 class NonBlockingDataTypeControllerTest : public testing::Test { | 121 class NonBlockingDataTypeControllerTest : public testing::Test { |
122 public: | 122 public: |
123 NonBlockingDataTypeControllerTest() | 123 NonBlockingDataTypeControllerTest() |
124 : type_sync_proxy_(syncer::DICTIONARY), | 124 : type_sync_proxy_(syncer::DICTIONARY), |
125 model_thread_(new base::TestSimpleTaskRunner()), | 125 model_thread_(new base::TestSimpleTaskRunner()), |
126 sync_thread_(new base::TestSimpleTaskRunner()), | 126 sync_thread_(new base::TestSimpleTaskRunner()), |
127 controller_(syncer::DICTIONARY, true), | 127 controller_(syncer::DICTIONARY, true), |
128 mock_context_proxy_(&mock_sync_context_, model_thread_, sync_thread_), | 128 mock_context_proxy_(&mock_sync_context_, model_thread_, sync_thread_), |
129 auto_run_tasks_(true) {} | 129 auto_run_tasks_(true) {} |
130 | 130 |
131 virtual ~NonBlockingDataTypeControllerTest() {} | 131 ~NonBlockingDataTypeControllerTest() override {} |
132 | 132 |
133 // Connects the sync type proxy to the NonBlockingDataTypeController. | 133 // Connects the sync type proxy to the NonBlockingDataTypeController. |
134 void InitTypeSyncProxy() { | 134 void InitTypeSyncProxy() { |
135 controller_.InitializeType(model_thread_, | 135 controller_.InitializeType(model_thread_, |
136 type_sync_proxy_.AsWeakPtrForUI()); | 136 type_sync_proxy_.AsWeakPtrForUI()); |
137 if (auto_run_tasks_) { | 137 if (auto_run_tasks_) { |
138 RunAllTasks(); | 138 RunAllTasks(); |
139 } | 139 } |
140 } | 140 } |
141 | 141 |
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
431 // disables sittin in its queue. Let's allow it to process them. | 431 // disables sittin in its queue. Let's allow it to process them. |
432 RunQueuedSyncThreadTasks(); | 432 RunQueuedSyncThreadTasks(); |
433 | 433 |
434 // Let the model thread process any messages from the sync thread. | 434 // Let the model thread process any messages from the sync thread. |
435 RunQueuedModelThreadTasks(); | 435 RunQueuedModelThreadTasks(); |
436 EXPECT_TRUE(type_sync_proxy_.IsPreferred()); | 436 EXPECT_TRUE(type_sync_proxy_.IsPreferred()); |
437 EXPECT_TRUE(type_sync_proxy_.IsConnected()); | 437 EXPECT_TRUE(type_sync_proxy_.IsConnected()); |
438 } | 438 } |
439 | 439 |
440 } // namespace sync_driver | 440 } // namespace sync_driver |
OLD | NEW |