Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(382)

Side by Side Diff: chrome/browser/autofill/autofill_browsertest.cc

Issue 13912016: [Autofill] Handle the Tab Key in the new UI (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Switch to ObserverList and AddTest Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 <string> 5 #include <string>
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/memory/ref_counted.h" 9 #include "base/memory/ref_counted.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 569 matching lines...) Expand 10 before | Expand all | Expand 10 after
580 // form. 580 // form.
581 SendKeyToPopupAndWait(ui::VKEY_DOWN); 581 SendKeyToPopupAndWait(ui::VKEY_DOWN);
582 582
583 // Press Enter to accept the autofill suggestions. 583 // Press Enter to accept the autofill suggestions.
584 SendKeyToPopupAndWait(ui::VKEY_RETURN); 584 SendKeyToPopupAndWait(ui::VKEY_RETURN);
585 585
586 // The form should be filled. 586 // The form should be filled.
587 ExpectFilledTestForm(); 587 ExpectFilledTestForm();
588 } 588 }
589 589
590 IN_PROC_BROWSER_TEST_F(AutofillTest, AutofillSelectViaTab) {
591 CreateTestProfile();
592
593 // Load the test page.
594 ASSERT_NO_FATAL_FAILURE(ui_test_utils::NavigateToURL(browser(),
595 GURL(std::string(kDataURIPrefix) + kTestFormString)));
596
597 // Focus a fillable field.
598 FocusFirstNameField();
599
600 // Press the down arrow to initiate Autofill and wait for the popup to be
601 // shown.
602 SendKeyToPageAndWait(ui::VKEY_DOWN);
603
604 // Press the down arrow to select the suggestion and preview the autofilled
605 // form.
606 SendKeyToPopupAndWait(ui::VKEY_DOWN);
607
608 // Press tab to accept the autofill suggestions.
609 SendKeyToPopupAndWait(ui::VKEY_TAB);
610
611 // The form should be filled.
612 ExpectFilledTestForm();
613 }
614
590 // http://crbug.com/150084 615 // http://crbug.com/150084
591 #if defined(OS_MACOSX) 616 #if defined(OS_MACOSX)
592 #define MAYBE_OnChangeAfterAutofill OnChangeAfterAutofill 617 #define MAYBE_OnChangeAfterAutofill OnChangeAfterAutofill
593 #else 618 #else
594 #define MAYBE_OnChangeAfterAutofill FLAKY_OnChangeAfterAutofill 619 #define MAYBE_OnChangeAfterAutofill FLAKY_OnChangeAfterAutofill
595 #endif 620 #endif
596 // Test that a JavaScript onchange event is fired after auto-filling a form. 621 // Test that a JavaScript onchange event is fired after auto-filling a form.
597 IN_PROC_BROWSER_TEST_F(AutofillTest, MAYBE_OnChangeAfterAutofill) { 622 IN_PROC_BROWSER_TEST_F(AutofillTest, MAYBE_OnChangeAfterAutofill) {
598 CreateTestProfile(); 623 CreateTestProfile();
599 624
(...skipping 1116 matching lines...) Expand 10 before | Expand all | Expand 10 after
1716 IN_PROC_BROWSER_TEST_F(AutofillTest, 1741 IN_PROC_BROWSER_TEST_F(AutofillTest,
1717 DISABLED_MergeAggregatedDuplicatedProfiles) { 1742 DISABLED_MergeAggregatedDuplicatedProfiles) {
1718 int num_of_profiles = 1743 int num_of_profiles =
1719 AggregateProfilesIntoAutofillPrefs("dataset_no_address.txt"); 1744 AggregateProfilesIntoAutofillPrefs("dataset_no_address.txt");
1720 1745
1721 ASSERT_GT(num_of_profiles, 1746 ASSERT_GT(num_of_profiles,
1722 static_cast<int>(personal_data_manager()->GetProfiles().size())); 1747 static_cast<int>(personal_data_manager()->GetProfiles().size()));
1723 } 1748 }
1724 1749
1725 } // namespace autofill 1750 } // namespace autofill
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698