summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpavely <pavely@chromium.org>2015-12-10 11:51:42 -0800
committerCommit bot <commit-bot@chromium.org>2015-12-10 19:52:29 +0000
commit14e9197c285a1edc95dc7e2f314f814fcc0a853f (patch)
treea09d4587d8b7b5a8706b1f9fec8178d39b11fc70
parenta7a845a523c9f2f3c481ec99c0c35646f9e5ea7f (diff)
downloadchromium_src-14e9197c285a1edc95dc7e2f314f814fcc0a853f.zip
chromium_src-14e9197c285a1edc95dc7e2f314f814fcc0a853f.tar.gz
chromium_src-14e9197c285a1edc95dc7e2f314f814fcc0a853f.tar.bz2
[Sync] Enable ProfileSyncServiceAutofillTest.ServerChangeRace
Test was disabled because number of calls to PersonalDataManager::Refresh didn't match expectation. I think this happened because calls to Refresh were posted to UI thread, but test didn't run message loop at the end of the test. BUG=57884 R=zea@chromium.org Review URL: https://codereview.chromium.org/1511333003 Cr-Commit-Position: refs/heads/master@{#364439}
-rw-r--r--chrome/browser/sync/profile_sync_service_autofill_unittest.cc13
1 files changed, 9 insertions, 4 deletions
diff --git a/chrome/browser/sync/profile_sync_service_autofill_unittest.cc b/chrome/browser/sync/profile_sync_service_autofill_unittest.cc
index 256d726..c24d4a4 100644
--- a/chrome/browser/sync/profile_sync_service_autofill_unittest.cc
+++ b/chrome/browser/sync/profile_sync_service_autofill_unittest.cc
@@ -16,7 +16,7 @@
#include "base/location.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
-#include "base/message_loop/message_loop.h"
+#include "base/run_loop.h"
#include "base/strings/string16.h"
#include "base/strings/utf_string_conversions.h"
#include "base/synchronization/waitable_event.h"
@@ -529,7 +529,9 @@ class ProfileSyncServiceAutofillTest
sync_service_->RegisterDataTypeController(CreateDataTypeController(type));
sync_service_->Initialize();
- base::MessageLoop::current()->Run();
+
+ base::RunLoop run_loop;
+ run_loop.Run();
// It's possible this test triggered an unrecoverable error, in which case
// we can't get the sync count.
@@ -1269,8 +1271,7 @@ TEST_F(ProfileSyncServiceAutofillTest, ProcessUserChangeRemoveProfile) {
ASSERT_EQ(0U, new_sync_profiles.size());
}
-// http://crbug.com/57884
-TEST_F(ProfileSyncServiceAutofillTest, DISABLED_ServerChangeRace) {
+TEST_F(ProfileSyncServiceAutofillTest, ServerChangeRace) {
// Once for MergeDataAndStartSyncing() and twice for ProcessSyncChanges(), via
// LoadAutofillData().
EXPECT_CALL(autofill_table_, GetAllAutofillEntries(_)).
@@ -1307,6 +1308,10 @@ TEST_F(ProfileSyncServiceAutofillTest, DISABLED_ServerChangeRace) {
// to clean up.
updater->CreateNewEntryAndWait(MakeAutofillEntry("server2", "entry2", 3));
+ // Let callbacks posted on UI thread execute.
+ base::RunLoop run_loop;
+ run_loop.RunUntilIdle();
+
std::vector<AutofillEntry> sync_entries;
std::vector<AutofillProfile> sync_profiles;
ASSERT_TRUE(GetAutofillEntriesFromSyncDB(&sync_entries, &sync_profiles));