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 "components/sync_driver/ui_data_type_controller.h" | 5 #include "components/sync_driver/ui_data_type_controller.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "base/tracked_objects.h" | 10 #include "base/tracked_objects.h" |
11 #include "components/sync_driver/data_type_controller_mock.h" | 11 #include "components/sync_driver/data_type_controller_mock.h" |
12 #include "components/sync_driver/fake_generic_change_processor.h" | 12 #include "components/sync_driver/fake_generic_change_processor.h" |
13 #include "sync/api/attachments/attachment_service_impl.h" | 13 #include "sync/api/attachments/attachment_service_impl.h" |
14 #include "sync/api/fake_syncable_service.h" | 14 #include "sync/api/fake_syncable_service.h" |
15 #include "testing/gtest/include/gtest/gtest.h" | 15 #include "testing/gtest/include/gtest/gtest.h" |
16 | 16 |
17 using testing::_; | 17 using testing::_; |
18 using testing::InvokeWithoutArgs; | 18 using testing::InvokeWithoutArgs; |
19 using testing::Return; | 19 using testing::Return; |
20 | 20 |
21 namespace browser_sync { | 21 namespace sync_driver { |
22 namespace { | 22 namespace { |
23 | 23 |
24 // TODO(zea): Expand this to make the dtc type paramterizable. This will let us | 24 // TODO(zea): Expand this to make the dtc type paramterizable. This will let us |
25 // test the basic functionality of all UIDataTypeControllers. We'll need to have | 25 // test the basic functionality of all UIDataTypeControllers. We'll need to have |
26 // intelligent default values for the methods queried in the dependent services | 26 // intelligent default values for the methods queried in the dependent services |
27 // (e.g. those queried in StartModels). | 27 // (e.g. those queried in StartModels). |
28 class SyncUIDataTypeControllerTest : public testing::Test, | 28 class SyncUIDataTypeControllerTest : public testing::Test, |
29 public SyncApiComponentFactory { | 29 public SyncApiComponentFactory { |
30 public: | 30 public: |
31 SyncUIDataTypeControllerTest() | 31 SyncUIDataTypeControllerTest() |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 Start(); | 197 Start(); |
198 EXPECT_TRUE(syncable_service_.syncing()); | 198 EXPECT_TRUE(syncable_service_.syncing()); |
199 preference_dtc_->OnSingleDatatypeUnrecoverableError(FROM_HERE, "Test"); | 199 preference_dtc_->OnSingleDatatypeUnrecoverableError(FROM_HERE, "Test"); |
200 PumpLoop(); | 200 PumpLoop(); |
201 EXPECT_EQ(DataTypeController::NOT_RUNNING, preference_dtc_->state()); | 201 EXPECT_EQ(DataTypeController::NOT_RUNNING, preference_dtc_->state()); |
202 EXPECT_TRUE(disable_callback_invoked_); | 202 EXPECT_TRUE(disable_callback_invoked_); |
203 EXPECT_FALSE(syncable_service_.syncing()); | 203 EXPECT_FALSE(syncable_service_.syncing()); |
204 } | 204 } |
205 | 205 |
206 } // namespace | 206 } // namespace |
207 } // namespace browser_sync | 207 } // namespace sync_driver |
OLD | NEW |