| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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.omnibox; | 5 package org.chromium.chrome.browser.omnibox; |
| 6 | 6 |
| 7 import android.content.ClipData; | 7 import android.content.ClipData; |
| 8 import android.content.ClipboardManager; | 8 import android.content.ClipboardManager; |
| 9 import android.content.Context; | 9 import android.content.Context; |
| 10 import android.content.Intent; | 10 import android.content.Intent; |
| (...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 478 CriteriaHelper.pollUiThread(Criteria.equals("testy", new Callable<String
>() { | 478 CriteriaHelper.pollUiThread(Criteria.equals("testy", new Callable<String
>() { |
| 479 @Override | 479 @Override |
| 480 public String call() { | 480 public String call() { |
| 481 return requestedAutocompleteText.get(); | 481 return requestedAutocompleteText.get(); |
| 482 } | 482 } |
| 483 })); | 483 })); |
| 484 } | 484 } |
| 485 | 485 |
| 486 @SmallTest | 486 @SmallTest |
| 487 @Feature("Omnibox") | 487 @Feature("Omnibox") |
| 488 @RetryOnFailure |
| 488 public void testAutocompleteCorrectlyPerservedOnBatchMode() throws Interrupt
edException { | 489 public void testAutocompleteCorrectlyPerservedOnBatchMode() throws Interrupt
edException { |
| 489 startMainActivityOnBlankPage(); | 490 startMainActivityOnBlankPage(); |
| 490 stubLocationBarAutocomplete(); | 491 stubLocationBarAutocomplete(); |
| 491 | 492 |
| 492 final UrlBar urlBar = getUrlBar(); | 493 final UrlBar urlBar = getUrlBar(); |
| 493 OmniboxTestUtils.toggleUrlBarFocus(urlBar, true); | 494 OmniboxTestUtils.toggleUrlBarFocus(urlBar, true); |
| 494 OmniboxTestUtils.waitForFocusAndKeyboardActive(urlBar, true); | 495 OmniboxTestUtils.waitForFocusAndKeyboardActive(urlBar, true); |
| 495 | 496 |
| 496 // Valid case (cursor at the end of text, single character, matches prev
ious autocomplete). | 497 // Valid case (cursor at the end of text, single character, matches prev
ious autocomplete). |
| 497 setAutocomplete(urlBar, "g", "oogle.com"); | 498 setAutocomplete(urlBar, "g", "oogle.com"); |
| (...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 797 CharSequence text = (clip != null && clip.getItemCount() != 0) | 798 CharSequence text = (clip != null && clip.getItemCount() != 0) |
| 798 ? clip.getItemAt(0).getText() : null; | 799 ? clip.getItemAt(0).getText() : null; |
| 799 return text != null ? text.toString() : null; | 800 return text != null ? text.toString() : null; |
| 800 } | 801 } |
| 801 | 802 |
| 802 @Override | 803 @Override |
| 803 public void startMainActivity() throws InterruptedException { | 804 public void startMainActivity() throws InterruptedException { |
| 804 // Each test will start the activity. | 805 // Each test will start the activity. |
| 805 } | 806 } |
| 806 } | 807 } |
| OLD | NEW |