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_arg_list.h" | 12 #include "chrome/browser/sync/js_arg_list.h" |
13 #include "chrome/browser/sync/js_event_details.h" | 13 #include "chrome/browser/sync/js_event_details.h" |
14 #include "chrome/browser/sync/js_test_util.h" | 14 #include "chrome/browser/sync/js_test_util.h" |
15 #include "chrome/browser/sync/profile_sync_factory_mock.h" | 15 #include "chrome/browser/sync/profile_sync_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/net/gaia/gaia_constants.h" | 17 #include "chrome/common/net/gaia/gaia_constants.h" |
18 #include "chrome/common/pref_names.h" | 18 #include "chrome/common/pref_names.h" |
| 19 #include "chrome/test/testing_browser_process_test.h" |
19 #include "chrome/test/testing_pref_service.h" | 20 #include "chrome/test/testing_pref_service.h" |
20 #include "chrome/test/testing_profile.h" | 21 #include "chrome/test/testing_profile.h" |
21 #include "content/browser/browser_thread.h" | 22 #include "content/browser/browser_thread.h" |
22 #include "testing/gmock/include/gmock/gmock.h" | 23 #include "testing/gmock/include/gmock/gmock.h" |
23 #include "testing/gtest/include/gtest/gtest.h" | 24 #include "testing/gtest/include/gtest/gtest.h" |
24 | 25 |
25 // TODO(akalin): Add tests here that exercise the whole | 26 // TODO(akalin): Add tests here that exercise the whole |
26 // ProfileSyncService/SyncBackendHost stack while mocking out as | 27 // ProfileSyncService/SyncBackendHost stack while mocking out as |
27 // little as possible. | 28 // little as possible. |
28 | 29 |
29 namespace browser_sync { | 30 namespace browser_sync { |
30 | 31 |
31 namespace { | 32 namespace { |
32 | 33 |
33 using testing::_; | 34 using testing::_; |
34 using testing::AnyNumber; | 35 using testing::AnyNumber; |
35 using testing::AtLeast; | 36 using testing::AtLeast; |
36 using testing::AtMost; | 37 using testing::AtMost; |
37 using testing::Return; | 38 using testing::Return; |
38 using testing::StrictMock; | 39 using testing::StrictMock; |
39 | 40 |
40 class ProfileSyncServiceTest : public testing::Test { | 41 class ProfileSyncServiceTest : public TestingBrowserProcessTest { |
41 protected: | 42 protected: |
42 ProfileSyncServiceTest() | 43 ProfileSyncServiceTest() |
43 : ui_thread_(BrowserThread::UI, &ui_loop_), | 44 : ui_thread_(BrowserThread::UI, &ui_loop_), |
44 io_thread_(BrowserThread::IO) {} | 45 io_thread_(BrowserThread::IO) {} |
45 | 46 |
46 virtual ~ProfileSyncServiceTest() {} | 47 virtual ~ProfileSyncServiceTest() {} |
47 | 48 |
48 virtual void SetUp() { | 49 virtual void SetUp() { |
49 base::Thread::Options options; | 50 base::Thread::Options options; |
50 options.message_loop_type = MessageLoop::TYPE_IO; | 51 options.message_loop_type = MessageLoop::TYPE_IO; |
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
380 // This will still exist, but the text should have changed. | 381 // This will still exist, but the text should have changed. |
381 ASSERT_TRUE(file_util::PathExists(sync_file2)); | 382 ASSERT_TRUE(file_util::PathExists(sync_file2)); |
382 std::string file2text; | 383 std::string file2text; |
383 ASSERT_TRUE(file_util::ReadFileToString(sync_file2, &file2text)); | 384 ASSERT_TRUE(file_util::ReadFileToString(sync_file2, &file2text)); |
384 ASSERT_NE(file2text.compare(nonsense2), 0); | 385 ASSERT_NE(file2text.compare(nonsense2), 0); |
385 } | 386 } |
386 | 387 |
387 } // namespace | 388 } // namespace |
388 | 389 |
389 } // namespace browser_sync | 390 } // namespace browser_sync |
OLD | NEW |