| 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 // History unit tests come in two flavors: | 5 // History unit tests come in two flavors: |
| 6 // | 6 // |
| 7 // 1. The more complicated style is that the unit test creates a full history | 7 // 1. The more complicated style is that the unit test creates a full history |
| 8 // service. This spawns a background thread for the history backend, and | 8 // service. This spawns a background thread for the history backend, and |
| 9 // all communication is asynchronous. This is useful for testing more | 9 // all communication is asynchronous. This is useful for testing more |
| 10 // complicated things or end-to-end behavior. | 10 // complicated things or end-to-end behavior. |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 #include "base/macros.h" | 27 #include "base/macros.h" |
| 28 #include "base/message_loop/message_loop.h" | 28 #include "base/message_loop/message_loop.h" |
| 29 #include "base/run_loop.h" | 29 #include "base/run_loop.h" |
| 30 #include "base/single_thread_task_runner.h" | 30 #include "base/single_thread_task_runner.h" |
| 31 #include "base/strings/utf_string_conversions.h" | 31 #include "base/strings/utf_string_conversions.h" |
| 32 #include "base/threading/thread_task_runner_handle.h" | 32 #include "base/threading/thread_task_runner_handle.h" |
| 33 #include "components/history/core/browser/history_database_params.h" | 33 #include "components/history/core/browser/history_database_params.h" |
| 34 #include "components/history/core/browser/history_db_task.h" | 34 #include "components/history/core/browser/history_db_task.h" |
| 35 #include "components/history/core/test/database_test_utils.h" | 35 #include "components/history/core/test/database_test_utils.h" |
| 36 #include "components/history/core/test/test_history_database.h" | 36 #include "components/history/core/test/test_history_database.h" |
| 37 #include "sync/api/attachments/attachment_id.h" | 37 #include "components/sync/api/attachments/attachment_id.h" |
| 38 #include "sync/api/fake_sync_change_processor.h" | 38 #include "components/sync/api/fake_sync_change_processor.h" |
| 39 #include "sync/api/sync_change.h" | 39 #include "components/sync/api/sync_change.h" |
| 40 #include "sync/api/sync_change_processor.h" | 40 #include "components/sync/api/sync_change_processor.h" |
| 41 #include "sync/api/sync_change_processor_wrapper_for_test.h" | 41 #include "components/sync/api/sync_change_processor_wrapper_for_test.h" |
| 42 #include "sync/api/sync_error.h" | 42 #include "components/sync/api/sync_error.h" |
| 43 #include "sync/api/sync_error_factory.h" | 43 #include "components/sync/api/sync_error_factory.h" |
| 44 #include "sync/api/sync_merge_result.h" | 44 #include "components/sync/api/sync_merge_result.h" |
| 45 #include "sync/internal_api/public/attachments/attachment_service_proxy_for_test
.h" | 45 #include "components/sync/core/attachments/attachment_service_proxy_for_test.h" |
| 46 #include "sync/protocol/history_delete_directive_specifics.pb.h" | 46 #include "components/sync/protocol/history_delete_directive_specifics.pb.h" |
| 47 #include "sync/protocol/sync.pb.h" | 47 #include "components/sync/protocol/sync.pb.h" |
| 48 #include "testing/gtest/include/gtest/gtest.h" | 48 #include "testing/gtest/include/gtest/gtest.h" |
| 49 | 49 |
| 50 namespace history { | 50 namespace history { |
| 51 | 51 |
| 52 class HistoryServiceTest : public testing::Test { | 52 class HistoryServiceTest : public testing::Test { |
| 53 public: | 53 public: |
| 54 HistoryServiceTest() : query_url_success_(false) {} | 54 HistoryServiceTest() : query_url_success_(false) {} |
| 55 | 55 |
| 56 ~HistoryServiceTest() override {} | 56 ~HistoryServiceTest() override {} |
| 57 | 57 |
| (...skipping 804 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 862 // Expect two sync changes for deleting processed directives. | 862 // Expect two sync changes for deleting processed directives. |
| 863 const syncer::SyncChangeList& sync_changes = change_processor.changes(); | 863 const syncer::SyncChangeList& sync_changes = change_processor.changes(); |
| 864 ASSERT_EQ(2u, sync_changes.size()); | 864 ASSERT_EQ(2u, sync_changes.size()); |
| 865 EXPECT_EQ(syncer::SyncChange::ACTION_DELETE, sync_changes[0].change_type()); | 865 EXPECT_EQ(syncer::SyncChange::ACTION_DELETE, sync_changes[0].change_type()); |
| 866 EXPECT_EQ(1, syncer::SyncDataRemote(sync_changes[0].sync_data()).GetId()); | 866 EXPECT_EQ(1, syncer::SyncDataRemote(sync_changes[0].sync_data()).GetId()); |
| 867 EXPECT_EQ(syncer::SyncChange::ACTION_DELETE, sync_changes[1].change_type()); | 867 EXPECT_EQ(syncer::SyncChange::ACTION_DELETE, sync_changes[1].change_type()); |
| 868 EXPECT_EQ(2, syncer::SyncDataRemote(sync_changes[1].sync_data()).GetId()); | 868 EXPECT_EQ(2, syncer::SyncDataRemote(sync_changes[1].sync_data()).GetId()); |
| 869 } | 869 } |
| 870 | 870 |
| 871 } // namespace history | 871 } // namespace history |
| OLD | NEW |