| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/callback.h" | 9 #include "base/callback.h" |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| 11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
| 12 #include "base/message_loop.h" | 12 #include "base/message_loop.h" |
| 13 #include "base/synchronization/waitable_event.h" | 13 #include "base/synchronization/waitable_event.h" |
| 14 #include "base/test/test_timeouts.h" | 14 #include "base/test/test_timeouts.h" |
| 15 #include "base/tracked_objects.h" | 15 #include "base/tracked_objects.h" |
| 16 #include "chrome/browser/sync/engine/model_safe_worker.h" | |
| 17 #include "chrome/browser/sync/glue/change_processor_mock.h" | 16 #include "chrome/browser/sync/glue/change_processor_mock.h" |
| 18 #include "chrome/browser/sync/glue/data_type_controller_mock.h" | 17 #include "chrome/browser/sync/glue/data_type_controller_mock.h" |
| 19 #include "chrome/browser/sync/glue/model_associator_mock.h" | 18 #include "chrome/browser/sync/glue/model_associator_mock.h" |
| 20 #include "chrome/browser/sync/glue/non_frontend_data_type_controller.h" | 19 #include "chrome/browser/sync/glue/non_frontend_data_type_controller.h" |
| 21 #include "chrome/browser/sync/glue/non_frontend_data_type_controller_mock.h" | 20 #include "chrome/browser/sync/glue/non_frontend_data_type_controller_mock.h" |
| 22 #include "chrome/browser/sync/profile_sync_components_factory_mock.h" | 21 #include "chrome/browser/sync/profile_sync_components_factory_mock.h" |
| 23 #include "chrome/browser/sync/profile_sync_service_mock.h" | 22 #include "chrome/browser/sync/profile_sync_service_mock.h" |
| 24 #include "chrome/test/base/profile_mock.h" | 23 #include "chrome/test/base/profile_mock.h" |
| 25 #include "content/test/test_browser_thread.h" | 24 #include "content/test/test_browser_thread.h" |
| 25 #include "sync/engine/model_safe_worker.h" |
| 26 | 26 |
| 27 using base::WaitableEvent; | 27 using base::WaitableEvent; |
| 28 using browser_sync::ChangeProcessorMock; | 28 using browser_sync::ChangeProcessorMock; |
| 29 using browser_sync::DataTypeController; | 29 using browser_sync::DataTypeController; |
| 30 using browser_sync::GROUP_DB; | 30 using browser_sync::GROUP_DB; |
| 31 using browser_sync::NonFrontendDataTypeController; | 31 using browser_sync::NonFrontendDataTypeController; |
| 32 using browser_sync::NonFrontendDataTypeControllerMock; | 32 using browser_sync::NonFrontendDataTypeControllerMock; |
| 33 using browser_sync::ModelAssociatorMock; | 33 using browser_sync::ModelAssociatorMock; |
| 34 using browser_sync::StartCallbackMock; | 34 using browser_sync::StartCallbackMock; |
| 35 using content::BrowserThread; | 35 using content::BrowserThread; |
| (...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 380 // This should cause non_frontend_dtc_->Stop() to be called. | 380 // This should cause non_frontend_dtc_->Stop() to be called. |
| 381 BrowserThread::PostTask(BrowserThread::DB, FROM_HERE, | 381 BrowserThread::PostTask(BrowserThread::DB, FROM_HERE, |
| 382 base::Bind( | 382 base::Bind( |
| 383 &NonFrontendDataTypeControllerFake::OnUnrecoverableError, | 383 &NonFrontendDataTypeControllerFake::OnUnrecoverableError, |
| 384 non_frontend_dtc_.get(), | 384 non_frontend_dtc_.get(), |
| 385 FROM_HERE, | 385 FROM_HERE, |
| 386 std::string("Test"))); | 386 std::string("Test"))); |
| 387 WaitForDTC(); | 387 WaitForDTC(); |
| 388 EXPECT_EQ(DataTypeController::NOT_RUNNING, non_frontend_dtc_->state()); | 388 EXPECT_EQ(DataTypeController::NOT_RUNNING, non_frontend_dtc_->state()); |
| 389 } | 389 } |
| OLD | NEW |