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 // TODO(akalin): This file is basically just a unit test for | 5 // TODO(akalin): This file is basically just a unit test for |
6 // BookmarkChangeProcessor. Write unit tests for | 6 // BookmarkChangeProcessor. Write unit tests for |
7 // BookmarkModelAssociator separately. | 7 // BookmarkModelAssociator separately. |
8 | 8 |
9 #include <stack> | 9 #include <stack> |
10 #include <vector> | 10 #include <vector> |
(...skipping 11 matching lines...) Expand all Loading... |
22 #include "chrome/browser/bookmarks/bookmark_model.h" | 22 #include "chrome/browser/bookmarks/bookmark_model.h" |
23 #include "chrome/browser/sync/abstract_profile_sync_service_test.h" | 23 #include "chrome/browser/sync/abstract_profile_sync_service_test.h" |
24 #include "chrome/browser/sync/api/sync_error.h" | 24 #include "chrome/browser/sync/api/sync_error.h" |
25 #include "chrome/browser/sync/engine/syncapi.h" | 25 #include "chrome/browser/sync/engine/syncapi.h" |
26 #include "chrome/browser/sync/glue/bookmark_change_processor.h" | 26 #include "chrome/browser/sync/glue/bookmark_change_processor.h" |
27 #include "chrome/browser/sync/glue/bookmark_model_associator.h" | 27 #include "chrome/browser/sync/glue/bookmark_model_associator.h" |
28 #include "chrome/browser/sync/syncable/directory_manager.h" | 28 #include "chrome/browser/sync/syncable/directory_manager.h" |
29 #include "chrome/common/chrome_switches.h" | 29 #include "chrome/common/chrome_switches.h" |
30 #include "chrome/test/sync/engine/test_id_factory.h" | 30 #include "chrome/test/sync/engine/test_id_factory.h" |
31 #include "chrome/test/sync/engine/test_user_share.h" | 31 #include "chrome/test/sync/engine/test_user_share.h" |
| 32 #include "chrome/test/testing_browser_process_test.h" |
32 #include "chrome/test/testing_profile.h" | 33 #include "chrome/test/testing_profile.h" |
33 #include "content/browser/browser_thread.h" | 34 #include "content/browser/browser_thread.h" |
34 #include "testing/gmock/include/gmock/gmock.h" | 35 #include "testing/gmock/include/gmock/gmock.h" |
35 #include "testing/gtest/include/gtest/gtest.h" | 36 #include "testing/gtest/include/gtest/gtest.h" |
36 | 37 |
37 namespace browser_sync { | 38 namespace browser_sync { |
38 | 39 |
39 namespace { | 40 namespace { |
40 | 41 |
41 using testing::_; | 42 using testing::_; |
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
270 // The change list we construct. | 271 // The change list we construct. |
271 std::vector<sync_api::SyncManager::ChangeRecord> changes_; | 272 std::vector<sync_api::SyncManager::ChangeRecord> changes_; |
272 }; | 273 }; |
273 | 274 |
274 class MockUnrecoverableErrorHandler : public UnrecoverableErrorHandler { | 275 class MockUnrecoverableErrorHandler : public UnrecoverableErrorHandler { |
275 public: | 276 public: |
276 MOCK_METHOD2(OnUnrecoverableError, | 277 MOCK_METHOD2(OnUnrecoverableError, |
277 void(const tracked_objects::Location&, const std::string&)); | 278 void(const tracked_objects::Location&, const std::string&)); |
278 }; | 279 }; |
279 | 280 |
280 class ProfileSyncServiceBookmarkTest : public testing::Test { | 281 class ProfileSyncServiceBookmarkTest : public TestingBrowserProcessTest { |
281 protected: | 282 protected: |
282 enum LoadOption { LOAD_FROM_STORAGE, DELETE_EXISTING_STORAGE }; | 283 enum LoadOption { LOAD_FROM_STORAGE, DELETE_EXISTING_STORAGE }; |
283 enum SaveOption { SAVE_TO_STORAGE, DONT_SAVE_TO_STORAGE }; | 284 enum SaveOption { SAVE_TO_STORAGE, DONT_SAVE_TO_STORAGE }; |
284 | 285 |
285 ProfileSyncServiceBookmarkTest() | 286 ProfileSyncServiceBookmarkTest() |
286 : ui_thread_(BrowserThread::UI, &message_loop_), | 287 : ui_thread_(BrowserThread::UI, &message_loop_), |
287 file_thread_(BrowserThread::FILE, &message_loop_), | 288 file_thread_(BrowserThread::FILE, &message_loop_), |
288 model_(NULL), | 289 model_(NULL), |
289 original_command_line_(*CommandLine::ForCurrentProcess()) { | 290 original_command_line_(*CommandLine::ForCurrentProcess()) { |
290 } | 291 } |
(...skipping 1140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1431 // Make sure we're back in sync. In real life, the user would need | 1432 // Make sure we're back in sync. In real life, the user would need |
1432 // to reauthenticate before this happens, but in the test, authentication | 1433 // to reauthenticate before this happens, but in the test, authentication |
1433 // is sidestepped. | 1434 // is sidestepped. |
1434 ExpectBookmarkModelMatchesTestData(); | 1435 ExpectBookmarkModelMatchesTestData(); |
1435 ExpectModelMatch(); | 1436 ExpectModelMatch(); |
1436 } | 1437 } |
1437 | 1438 |
1438 } // namespace | 1439 } // namespace |
1439 | 1440 |
1440 } // namespace browser_sync | 1441 } // namespace browser_sync |
OLD | NEW |