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