Chromium Code Reviews| 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 "base/utf_string_conversions.h" | 5 #include "base/utf_string_conversions.h" |
| 6 #include "chrome/browser/autofill/autofill_profile.h" | 6 #include "chrome/browser/autofill/autofill_profile.h" |
| 7 #include "chrome/browser/sync/profile_sync_service_harness.h" | 7 #include "chrome/browser/sync/profile_sync_service_harness.h" |
| 8 #include "chrome/browser/sync/test/integration/autofill_helper.h" | 8 #include "chrome/browser/sync/test/integration/autofill_helper.h" |
| 9 #include "chrome/browser/sync/test/integration/bookmarks_helper.h" | |
| 9 #include "chrome/browser/sync/test/integration/sync_test.h" | 10 #include "chrome/browser/sync/test/integration/sync_test.h" |
| 10 #include "chrome/browser/webdata/autofill_entry.h" | 11 #include "chrome/browser/webdata/autofill_entry.h" |
| 11 #include "chrome/browser/webdata/autofill_table.h" | 12 #include "chrome/browser/webdata/autofill_table.h" |
| 12 | 13 |
| 13 using autofill_helper::AddKeys; | 14 using autofill_helper::AddKeys; |
| 14 using autofill_helper::AddProfile; | 15 using autofill_helper::AddProfile; |
| 15 using autofill_helper::CreateAutofillProfile; | 16 using autofill_helper::CreateAutofillProfile; |
| 16 using autofill_helper::GetAllKeys; | 17 using autofill_helper::GetAllKeys; |
| 17 using autofill_helper::GetAllProfiles; | 18 using autofill_helper::GetAllProfiles; |
| 18 using autofill_helper::KeysMatch; | 19 using autofill_helper::KeysMatch; |
| 19 using autofill_helper::ProfilesMatch; | 20 using autofill_helper::ProfilesMatch; |
| 20 using autofill_helper::PROFILE_FRASIER; | 21 using autofill_helper::PROFILE_FRASIER; |
| 21 using autofill_helper::PROFILE_HOMER; | 22 using autofill_helper::PROFILE_HOMER; |
| 22 using autofill_helper::PROFILE_MARION; | 23 using autofill_helper::PROFILE_MARION; |
| 23 using autofill_helper::PROFILE_NULL; | 24 using autofill_helper::PROFILE_NULL; |
| 24 using autofill_helper::RemoveKey; | 25 using autofill_helper::RemoveKey; |
| 25 using autofill_helper::RemoveProfile; | 26 using autofill_helper::RemoveProfile; |
| 26 using autofill_helper::UpdateProfile; | 27 using autofill_helper::UpdateProfile; |
| 28 using bookmarks_helper::AddFolder; | |
|
Raghu Simha
2011/12/19 20:50:48
Remove this.
lipalani1
2011/12/19 20:54:01
Done.
| |
| 29 using bookmarks_helper::AddURL; | |
| 30 using bookmarks_helper::IndexedURL; | |
| 31 using bookmarks_helper::IndexedURLTitle; | |
| 32 using bookmarks_helper::SetTitle; | |
|
Raghu Simha
2011/12/19 20:50:48
Remove this.
lipalani1
2011/12/19 20:54:01
Done.
| |
| 27 | 33 |
| 28 class TwoClientAutofillSyncTest : public SyncTest { | 34 class TwoClientAutofillSyncTest : public SyncTest { |
| 29 public: | 35 public: |
| 30 TwoClientAutofillSyncTest() : SyncTest(TWO_CLIENT) {} | 36 TwoClientAutofillSyncTest() : SyncTest(TWO_CLIENT) {count = 0;} |
|
Raghu Simha
2011/12/19 20:50:48
nit: I think the style guide recommends spaces aft
lipalani1
2011/12/19 20:54:01
Done.
| |
| 31 virtual ~TwoClientAutofillSyncTest() {} | 37 virtual ~TwoClientAutofillSyncTest() {} |
| 32 | 38 |
| 39 // We do this so as to make a change that will trigger the autofill to sync. | |
| 40 // By default autofill does not sync unless there is some other change. | |
| 41 void MakeABookmarkChange(int profile) { | |
| 42 AddURL(profile, IndexedURLTitle(count), GURL(IndexedURL(count))); | |
| 43 ++count; | |
| 44 } | |
| 33 private: | 45 private: |
| 46 int count; | |
| 34 DISALLOW_COPY_AND_ASSIGN(TwoClientAutofillSyncTest); | 47 DISALLOW_COPY_AND_ASSIGN(TwoClientAutofillSyncTest); |
| 35 }; | 48 }; |
| 36 | 49 |
| 37 // Flaky, http://crbug.com/102687 | 50 // Flaky, http://crbug.com/102687 |
| 38 IN_PROC_BROWSER_TEST_F(TwoClientAutofillSyncTest, FLAKY_WebDataServiceSanity) { | 51 IN_PROC_BROWSER_TEST_F(TwoClientAutofillSyncTest, FLAKY_WebDataServiceSanity) { |
| 39 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; | 52 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; |
| 40 | 53 |
| 41 // Client0 adds a key. | 54 // Client0 adds a key. |
| 42 std::set<AutofillKey> keys; | 55 std::set<AutofillKey> keys; |
| 43 keys.insert(AutofillKey("name0", "value0")); | 56 keys.insert(AutofillKey("name0", "value0")); |
| (...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 397 AutofillType(EMAIL_ADDRESS), | 410 AutofillType(EMAIL_ADDRESS), |
| 398 exceeds_max_length_string); | 411 exceeds_max_length_string); |
| 399 UpdateProfile(0, | 412 UpdateProfile(0, |
| 400 GetAllProfiles(0)[0]->guid(), | 413 GetAllProfiles(0)[0]->guid(), |
| 401 AutofillType(ADDRESS_HOME_LINE1), | 414 AutofillType(ADDRESS_HOME_LINE1), |
| 402 exceeds_max_length_string); | 415 exceeds_max_length_string); |
| 403 | 416 |
| 404 ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1))); | 417 ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1))); |
| 405 ASSERT_FALSE(ProfilesMatch(0, 1)); | 418 ASSERT_FALSE(ProfilesMatch(0, 1)); |
| 406 } | 419 } |
| OLD | NEW |