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 <set> | 5 #include <set> |
6 #include <string> | 6 #include <string> |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
10 | 10 |
(...skipping 1076 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1087 notifier->Notify(chrome::NOTIFICATION_AUTOFILL_PROFILE_CHANGED, | 1087 notifier->Notify(chrome::NOTIFICATION_AUTOFILL_PROFILE_CHANGED, |
1088 content::Source<WebDataService>(web_data_service_.get()), | 1088 content::Source<WebDataService>(web_data_service_.get()), |
1089 content::Details<AutofillProfileChange>(&change)); | 1089 content::Details<AutofillProfileChange>(&change)); |
1090 | 1090 |
1091 std::vector<AutofillProfile> new_sync_profiles; | 1091 std::vector<AutofillProfile> new_sync_profiles; |
1092 ASSERT_TRUE(GetAutofillProfilesFromSyncDBUnderProfileNode( | 1092 ASSERT_TRUE(GetAutofillProfilesFromSyncDBUnderProfileNode( |
1093 &new_sync_profiles)); | 1093 &new_sync_profiles)); |
1094 ASSERT_EQ(0U, new_sync_profiles.size()); | 1094 ASSERT_EQ(0U, new_sync_profiles.size()); |
1095 } | 1095 } |
1096 | 1096 |
1097 TEST_F(ProfileSyncServiceAutofillTest, ServerChangeRace) { | 1097 TEST_F(ProfileSyncServiceAutofillTest, FLAKY_ServerChangeRace) { |
1098 // GetHistoryService() gets called indirectly, but the result is ignored, so | 1098 // GetHistoryService() gets called indirectly, but the result is ignored, so |
1099 // it is safe to return NULL. | 1099 // it is safe to return NULL. |
1100 EXPECT_CALL(profile_, GetHistoryService(_)). | 1100 EXPECT_CALL(profile_, GetHistoryService(_)). |
1101 WillRepeatedly(Return(static_cast<HistoryService*>(NULL))); | 1101 WillRepeatedly(Return(static_cast<HistoryService*>(NULL))); |
1102 // Once for MergeDataAndStartSyncing() and twice for ProcessSyncChanges(), via | 1102 // Once for MergeDataAndStartSyncing() and twice for ProcessSyncChanges(), via |
1103 // LoadAutofillData(). | 1103 // LoadAutofillData(). |
1104 EXPECT_CALL(autofill_table_, GetAllAutofillEntries(_)). | 1104 EXPECT_CALL(autofill_table_, GetAllAutofillEntries(_)). |
1105 Times(3).WillRepeatedly(Return(true)); | 1105 Times(3).WillRepeatedly(Return(true)); |
1106 // On the other hand Autofill and Autocomplete are separated now, so | 1106 // On the other hand Autofill and Autocomplete are separated now, so |
1107 // GetAutofillProfiles() should not be called. | 1107 // GetAutofillProfiles() should not be called. |
(...skipping 30 matching lines...) Expand all Loading... |
1138 std::vector<AutofillEntry> sync_entries; | 1138 std::vector<AutofillEntry> sync_entries; |
1139 std::vector<AutofillProfile> sync_profiles; | 1139 std::vector<AutofillProfile> sync_profiles; |
1140 ASSERT_TRUE(GetAutofillEntriesFromSyncDB(&sync_entries, &sync_profiles)); | 1140 ASSERT_TRUE(GetAutofillEntriesFromSyncDB(&sync_entries, &sync_profiles)); |
1141 EXPECT_EQ(3U, sync_entries.size()); | 1141 EXPECT_EQ(3U, sync_entries.size()); |
1142 EXPECT_EQ(0U, sync_profiles.size()); | 1142 EXPECT_EQ(0U, sync_profiles.size()); |
1143 for (size_t i = 0; i < sync_entries.size(); i++) { | 1143 for (size_t i = 0; i < sync_entries.size(); i++) { |
1144 DVLOG(1) << "Entry " << i << ": " << sync_entries[i].key().name() | 1144 DVLOG(1) << "Entry " << i << ": " << sync_entries[i].key().name() |
1145 << ", " << sync_entries[i].key().value(); | 1145 << ", " << sync_entries[i].key().value(); |
1146 } | 1146 } |
1147 } | 1147 } |
OLD | NEW |