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 #include <vector> | 5 #include <vector> |
6 | 6 |
7 #include "testing/gtest/include/gtest/gtest.h" | 7 #include "testing/gtest/include/gtest/gtest.h" |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 public: | 108 public: |
109 TestTypedUrlModelAssociator( | 109 TestTypedUrlModelAssociator( |
110 ProfileSyncService* sync_service, | 110 ProfileSyncService* sync_service, |
111 history::HistoryBackend* history_backend, | 111 history::HistoryBackend* history_backend, |
112 browser_sync::DataTypeErrorHandler* error_handler) : | 112 browser_sync::DataTypeErrorHandler* error_handler) : |
113 TypedUrlModelAssociator(sync_service, history_backend, error_handler) {} | 113 TypedUrlModelAssociator(sync_service, history_backend, error_handler) {} |
114 | 114 |
115 protected: | 115 protected: |
116 // Don't clear error stats - that way we can verify their values in our | 116 // Don't clear error stats - that way we can verify their values in our |
117 // tests. | 117 // tests. |
118 virtual void ClearErrorStats() {} | 118 virtual void ClearErrorStats() OVERRIDE {} |
119 }; | 119 }; |
120 | 120 |
121 void RunOnDBThreadCallback(HistoryBackend* backend, | 121 void RunOnDBThreadCallback(HistoryBackend* backend, |
122 HistoryDBTask* task) { | 122 HistoryDBTask* task) { |
123 task->RunOnDBThread(backend, NULL); | 123 task->RunOnDBThread(backend, NULL); |
124 } | 124 } |
125 | 125 |
126 ACTION_P2(RunTaskOnDBThread, thread, backend) { | 126 ACTION_P2(RunTaskOnDBThread, thread, backend) { |
127 // ScheduleDBTask takes ownership of its task argument, so we | 127 // ScheduleDBTask takes ownership of its task argument, so we |
128 // should, too. | 128 // should, too. |
(...skipping 911 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1040 content::Source<Profile>(&profile_), | 1040 content::Source<Profile>(&profile_), |
1041 content::Details<history::URLsModifiedDetails>(&details)); | 1041 content::Details<history::URLsModifiedDetails>(&details)); |
1042 | 1042 |
1043 history::URLRows new_sync_entries; | 1043 history::URLRows new_sync_entries; |
1044 GetTypedUrlsFromSyncDB(&new_sync_entries); | 1044 GetTypedUrlsFromSyncDB(&new_sync_entries); |
1045 | 1045 |
1046 // We should ignore the localhost urls and left only with http url. | 1046 // We should ignore the localhost urls and left only with http url. |
1047 ASSERT_EQ(1U, new_sync_entries.size()); | 1047 ASSERT_EQ(1U, new_sync_entries.size()); |
1048 EXPECT_TRUE(URLsEqual(updated_url_entry, new_sync_entries[0])); | 1048 EXPECT_TRUE(URLsEqual(updated_url_entry, new_sync_entries[0])); |
1049 } | 1049 } |
OLD | NEW |