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/file_util.h" | 5 #include "base/file_util.h" |
6 #include "base/memory/scoped_ptr.h" | 6 #include "base/memory/scoped_ptr.h" |
7 #include "base/message_loop.h" | 7 #include "base/message_loop.h" |
8 #include "base/values.h" | 8 #include "base/values.h" |
9 #include "chrome/browser/net/gaia/token_service.h" | 9 #include "chrome/browser/net/gaia/token_service.h" |
10 #include "chrome/browser/sync/glue/bookmark_data_type_controller.h" | 10 #include "chrome/browser/sync/glue/bookmark_data_type_controller.h" |
11 #include "chrome/browser/sync/glue/data_type_controller.h" | 11 #include "chrome/browser/sync/glue/data_type_controller.h" |
12 #include "chrome/browser/sync/js/js_arg_list.h" | 12 #include "chrome/browser/sync/js/js_arg_list.h" |
13 #include "chrome/browser/sync/js/js_event_details.h" | 13 #include "chrome/browser/sync/js/js_event_details.h" |
14 #include "chrome/browser/sync/js/js_test_util.h" | 14 #include "chrome/browser/sync/js/js_test_util.h" |
15 #include "chrome/browser/sync/profile_sync_factory_mock.h" | 15 #include "chrome/browser/sync/profile_sync_components_factory_mock.h" |
16 #include "chrome/browser/sync/test_profile_sync_service.h" | 16 #include "chrome/browser/sync/test_profile_sync_service.h" |
17 #include "chrome/common/chrome_version_info.h" | 17 #include "chrome/common/chrome_version_info.h" |
18 #include "chrome/common/net/gaia/gaia_constants.h" | 18 #include "chrome/common/net/gaia/gaia_constants.h" |
19 #include "chrome/common/pref_names.h" | 19 #include "chrome/common/pref_names.h" |
20 #include "chrome/test/base/testing_pref_service.h" | 20 #include "chrome/test/base/testing_pref_service.h" |
21 #include "chrome/test/base/testing_profile.h" | 21 #include "chrome/test/base/testing_profile.h" |
22 #include "content/test/test_browser_thread.h" | 22 #include "content/test/test_browser_thread.h" |
23 #include "testing/gmock/include/gmock/gmock.h" | 23 #include "testing/gmock/include/gmock/gmock.h" |
24 #include "testing/gtest/include/gtest/gtest.h" | 24 #include "testing/gtest/include/gtest/gtest.h" |
25 #include "webkit/glue/user_agent.h" | 25 #include "webkit/glue/user_agent.h" |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 } | 115 } |
116 | 116 |
117 MessageLoop ui_loop_; | 117 MessageLoop ui_loop_; |
118 // Needed by |service_|. | 118 // Needed by |service_|. |
119 content::TestBrowserThread ui_thread_; | 119 content::TestBrowserThread ui_thread_; |
120 // Needed by |service| and |profile_|'s request context. | 120 // Needed by |service| and |profile_|'s request context. |
121 content::TestBrowserThread io_thread_; | 121 content::TestBrowserThread io_thread_; |
122 | 122 |
123 scoped_ptr<TestProfileSyncService> service_; | 123 scoped_ptr<TestProfileSyncService> service_; |
124 scoped_ptr<TestingProfile> profile_; | 124 scoped_ptr<TestingProfile> profile_; |
125 ProfileSyncFactoryMock factory_; | 125 ProfileSyncComponentsFactoryMock factory_; |
126 }; | 126 }; |
127 | 127 |
128 TEST_F(ProfileSyncServiceTest, InitialState) { | 128 TEST_F(ProfileSyncServiceTest, InitialState) { |
129 service_.reset(new TestProfileSyncService(&factory_, profile_.get(), | 129 service_.reset(new TestProfileSyncService(&factory_, profile_.get(), |
130 "", true, NULL)); | 130 "", true, NULL)); |
131 EXPECT_TRUE( | 131 EXPECT_TRUE( |
132 service_->sync_service_url().spec() == | 132 service_->sync_service_url().spec() == |
133 ProfileSyncService::kSyncServerUrl || | 133 ProfileSyncService::kSyncServerUrl || |
134 service_->sync_service_url().spec() == | 134 service_->sync_service_url().spec() == |
135 ProfileSyncService::kDevServerUrl); | 135 ProfileSyncService::kDevServerUrl); |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
324 // The backend is not ready. Ensure the PSS knows this. | 324 // The backend is not ready. Ensure the PSS knows this. |
325 EXPECT_FALSE(service_->sync_initialized()); | 325 EXPECT_FALSE(service_->sync_initialized()); |
326 | 326 |
327 // Ensure we will be prepared to initialize a fresh DB next time. | 327 // Ensure we will be prepared to initialize a fresh DB next time. |
328 EXPECT_FALSE(service_->HasSyncSetupCompleted()); | 328 EXPECT_FALSE(service_->HasSyncSetupCompleted()); |
329 } | 329 } |
330 | 330 |
331 } // namespace | 331 } // namespace |
332 | 332 |
333 } // namespace browser_sync | 333 } // namespace browser_sync |
OLD | NEW |