| 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 "testing/gtest/include/gtest/gtest.h" | 5 #include "testing/gtest/include/gtest/gtest.h" |
| 6 | 6 |
| 7 #include "base/callback.h" | 7 #include "base/callback.h" |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
| 10 #include "base/task.h" | 10 #include "base/task.h" |
| 11 #include "base/test/test_timeouts.h" | 11 #include "base/test/test_timeouts.h" |
| 12 #include "base/tracked_objects.h" | 12 #include "base/tracked_objects.h" |
| 13 #include "base/synchronization/waitable_event.h" | 13 #include "base/synchronization/waitable_event.h" |
| 14 #include "chrome/browser/sync/engine/model_safe_worker.h" | 14 #include "chrome/browser/sync/engine/model_safe_worker.h" |
| 15 #include "chrome/browser/sync/glue/change_processor_mock.h" | 15 #include "chrome/browser/sync/glue/change_processor_mock.h" |
| 16 #include "chrome/browser/sync/glue/non_frontend_data_type_controller.h" | 16 #include "chrome/browser/sync/glue/non_frontend_data_type_controller.h" |
| 17 #include "chrome/browser/sync/glue/non_frontend_data_type_controller_mock.h" | 17 #include "chrome/browser/sync/glue/non_frontend_data_type_controller_mock.h" |
| 18 #include "chrome/browser/sync/glue/model_associator_mock.h" | 18 #include "chrome/browser/sync/glue/model_associator_mock.h" |
| 19 #include "chrome/browser/sync/profile_sync_factory_mock.h" | 19 #include "chrome/browser/sync/profile_sync_factory_mock.h" |
| 20 #include "chrome/browser/sync/profile_sync_service_mock.h" | 20 #include "chrome/browser/sync/profile_sync_service_mock.h" |
| 21 #include "chrome/test/base/profile_mock.h" | 21 #include "chrome/test/base/profile_mock.h" |
| 22 #include "chrome/test/testing_browser_process_test.h" | 22 #include "chrome/test/base/testing_browser_process_test.h" |
| 23 #include "content/browser/browser_thread.h" | 23 #include "content/browser/browser_thread.h" |
| 24 | 24 |
| 25 using base::WaitableEvent; | 25 using base::WaitableEvent; |
| 26 using browser_sync::ChangeProcessorMock; | 26 using browser_sync::ChangeProcessorMock; |
| 27 using browser_sync::DataTypeController; | 27 using browser_sync::DataTypeController; |
| 28 using browser_sync::GROUP_DB; | 28 using browser_sync::GROUP_DB; |
| 29 using browser_sync::NonFrontendDataTypeController; | 29 using browser_sync::NonFrontendDataTypeController; |
| 30 using browser_sync::NonFrontendDataTypeControllerMock; | 30 using browser_sync::NonFrontendDataTypeControllerMock; |
| 31 using browser_sync::ModelAssociatorMock; | 31 using browser_sync::ModelAssociatorMock; |
| 32 using testing::_; | 32 using testing::_; |
| (...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 385 // This should cause non_frontend_dtc_->Stop() to be called. | 385 // This should cause non_frontend_dtc_->Stop() to be called. |
| 386 BrowserThread::PostTask(BrowserThread::DB, FROM_HERE, | 386 BrowserThread::PostTask(BrowserThread::DB, FROM_HERE, |
| 387 NewRunnableMethod( | 387 NewRunnableMethod( |
| 388 non_frontend_dtc_.get(), | 388 non_frontend_dtc_.get(), |
| 389 &NonFrontendDataTypeControllerFake::OnUnrecoverableError, | 389 &NonFrontendDataTypeControllerFake::OnUnrecoverableError, |
| 390 FROM_HERE, | 390 FROM_HERE, |
| 391 std::string("Test"))); | 391 std::string("Test"))); |
| 392 WaitForDTC(); | 392 WaitForDTC(); |
| 393 EXPECT_EQ(DataTypeController::NOT_RUNNING, non_frontend_dtc_->state()); | 393 EXPECT_EQ(DataTypeController::NOT_RUNNING, non_frontend_dtc_->state()); |
| 394 } | 394 } |
| OLD | NEW |