OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 package org.chromium.chrome.browser.autofill; | 5 package org.chromium.chrome.browser.autofill; |
6 | 6 |
7 import android.test.suitebuilder.annotation.SmallTest; | 7 import android.test.suitebuilder.annotation.SmallTest; |
8 | 8 |
9 import static org.chromium.base.test.util.ScalableTimeout.scaleTimeout; | 9 import static org.chromium.base.test.util.ScalableTimeout.scaleTimeout; |
10 | 10 |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 public boolean waitForCallback() throws InterruptedException { | 75 public boolean waitForCallback() throws InterruptedException { |
76 return CriteriaHelper.pollForCriteria(new Criteria() { | 76 return CriteriaHelper.pollForCriteria(new Criteria() { |
77 @Override | 77 @Override |
78 public boolean isSatisfied() { | 78 public boolean isSatisfied() { |
79 return mGotPopupSelection.get(); | 79 return mGotPopupSelection.get(); |
80 } | 80 } |
81 }, CALLBACK_TIMEOUT_MS, CHECK_INTERVAL_MS); | 81 }, CALLBACK_TIMEOUT_MS, CHECK_INTERVAL_MS); |
82 } | 82 } |
83 | 83 |
84 @Override | 84 @Override |
85 public void requestHide() { | 85 public void dismissed() { |
86 } | 86 } |
87 } | 87 } |
88 | 88 |
89 private AutofillSuggestion[] createTwoAutofillSuggestionArray() { | 89 private AutofillSuggestion[] createTwoAutofillSuggestionArray() { |
90 return new AutofillSuggestion[] { | 90 return new AutofillSuggestion[] { |
91 new AutofillSuggestion("Sherlock Holmes", "221B Baker Street", 42), | 91 new AutofillSuggestion("Sherlock Holmes", "221B Baker Street", 42), |
92 new AutofillSuggestion("Arthur Dent", "West Country", 43), | 92 new AutofillSuggestion("Arthur Dent", "West Country", 43), |
93 }; | 93 }; |
94 } | 94 } |
95 | 95 |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 assertTrue(openAutofillPopupAndWaitUntilReady(suggestions)); | 136 assertTrue(openAutofillPopupAndWaitUntilReady(suggestions)); |
137 assertEquals(2, mAutofillPopup.getListView().getCount()); | 137 assertEquals(2, mAutofillPopup.getListView().getCount()); |
138 | 138 |
139 TouchCommon touchCommon = new TouchCommon(this); | 139 TouchCommon touchCommon = new TouchCommon(this); |
140 touchCommon.singleClickViewRelative(mAutofillPopup.getListView(), 10, 10
); | 140 touchCommon.singleClickViewRelative(mAutofillPopup.getListView(), 10, 10
); |
141 assertTrue(mMockAutofillCallback.waitForCallback()); | 141 assertTrue(mMockAutofillCallback.waitForCallback()); |
142 | 142 |
143 assertEquals(0, mMockAutofillCallback.mListIndex); | 143 assertEquals(0, mMockAutofillCallback.mListIndex); |
144 } | 144 } |
145 } | 145 } |
OLD | NEW |