| 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; |
| 11 import android.test.suitebuilder.annotation.SmallTest; | 11 import android.test.suitebuilder.annotation.SmallTest; |
| 12 import android.text.Editable; | 12 import android.text.Editable; |
| 13 import android.text.TextUtils; | 13 import android.text.TextUtils; |
| 14 import android.view.KeyEvent; | 14 import android.view.KeyEvent; |
| 15 import android.view.inputmethod.BaseInputConnection; | 15 import android.view.inputmethod.BaseInputConnection; |
| 16 | 16 |
| 17 import org.chromium.base.ThreadUtils; | 17 import org.chromium.base.ThreadUtils; |
| 18 import org.chromium.base.test.util.Feature; | 18 import org.chromium.base.test.util.Feature; |
| 19 import org.chromium.base.test.util.RetryOnFailure; |
| 19 import org.chromium.chrome.R; | 20 import org.chromium.chrome.R; |
| 20 import org.chromium.chrome.browser.ChromeActivity; | 21 import org.chromium.chrome.browser.ChromeActivity; |
| 21 import org.chromium.chrome.browser.profiles.Profile; | 22 import org.chromium.chrome.browser.profiles.Profile; |
| 22 import org.chromium.chrome.test.ChromeActivityTestCaseBase; | 23 import org.chromium.chrome.test.ChromeActivityTestCaseBase; |
| 23 import org.chromium.chrome.test.util.OmniboxTestUtils; | 24 import org.chromium.chrome.test.util.OmniboxTestUtils; |
| 24 import org.chromium.chrome.test.util.OmniboxTestUtils.StubAutocompleteController
; | 25 import org.chromium.chrome.test.util.OmniboxTestUtils.StubAutocompleteController
; |
| 25 import org.chromium.content.browser.test.util.CallbackHelper; | 26 import org.chromium.content.browser.test.util.CallbackHelper; |
| 26 import org.chromium.content.browser.test.util.Criteria; | 27 import org.chromium.content.browser.test.util.Criteria; |
| 27 import org.chromium.content.browser.test.util.CriteriaHelper; | 28 import org.chromium.content.browser.test.util.CriteriaHelper; |
| 28 import org.chromium.content.browser.test.util.KeyUtils; | 29 import org.chromium.content.browser.test.util.KeyUtils; |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 return getAutocompleteState(urlBar, new Runnable() { | 144 return getAutocompleteState(urlBar, new Runnable() { |
| 144 @Override | 145 @Override |
| 145 public void run() { | 146 public void run() { |
| 146 urlBar.setSelection(selectionStart, selectionEnd); | 147 urlBar.setSelection(selectionStart, selectionEnd); |
| 147 } | 148 } |
| 148 }); | 149 }); |
| 149 } | 150 } |
| 150 | 151 |
| 151 @SmallTest | 152 @SmallTest |
| 152 @Feature({"Omnibox"}) | 153 @Feature({"Omnibox"}) |
| 154 @RetryOnFailure |
| 153 public void testRefocusing() throws InterruptedException { | 155 public void testRefocusing() throws InterruptedException { |
| 154 startMainActivityOnBlankPage(); | 156 startMainActivityOnBlankPage(); |
| 155 UrlBar urlBar = getUrlBar(); | 157 UrlBar urlBar = getUrlBar(); |
| 156 assertFalse(OmniboxTestUtils.doesUrlBarHaveFocus(urlBar)); | 158 assertFalse(OmniboxTestUtils.doesUrlBarHaveFocus(urlBar)); |
| 157 OmniboxTestUtils.checkUrlBarRefocus(urlBar, 5); | 159 OmniboxTestUtils.checkUrlBarRefocus(urlBar, 5); |
| 158 } | 160 } |
| 159 | 161 |
| 160 @SmallTest | 162 @SmallTest |
| 161 @Feature({"Omnibox"}) | 163 @Feature({"Omnibox"}) |
| 164 @RetryOnFailure |
| 162 public void testAutocompleteUpdatedOnSetText() throws InterruptedException { | 165 public void testAutocompleteUpdatedOnSetText() throws InterruptedException { |
| 163 startMainActivityOnBlankPage(); | 166 startMainActivityOnBlankPage(); |
| 164 stubLocationBarAutocomplete(); | 167 stubLocationBarAutocomplete(); |
| 165 final UrlBar urlBar = getUrlBar(); | 168 final UrlBar urlBar = getUrlBar(); |
| 166 OmniboxTestUtils.toggleUrlBarFocus(urlBar, true); | 169 OmniboxTestUtils.toggleUrlBarFocus(urlBar, true); |
| 167 | 170 |
| 168 // Verify that setting a new string will clear the autocomplete. | 171 // Verify that setting a new string will clear the autocomplete. |
| 169 setTextAndVerifyNoAutocomplete(urlBar, "test"); | 172 setTextAndVerifyNoAutocomplete(urlBar, "test"); |
| 170 setAutocomplete(urlBar, "test", "ing is fun"); | 173 setAutocomplete(urlBar, "test", "ing is fun"); |
| 171 setTextAndVerifyNoAutocomplete(urlBar, "new string"); | 174 setTextAndVerifyNoAutocomplete(urlBar, "new string"); |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 234 | 237 |
| 235 autocompleteHelper.waitForCallback(0); | 238 autocompleteHelper.waitForCallback(0); |
| 236 assertEquals("Prevent inline autocomplete", | 239 assertEquals("Prevent inline autocomplete", |
| 237 expectedPreventInline, didPreventInlineAutocomplete.get()); | 240 expectedPreventInline, didPreventInlineAutocomplete.get()); |
| 238 assertEquals("Requested autocomplete text", | 241 assertEquals("Requested autocomplete text", |
| 239 expectedRequestedAutocompleteText, requestedAutocompleteText.get
()); | 242 expectedRequestedAutocompleteText, requestedAutocompleteText.get
()); |
| 240 } | 243 } |
| 241 | 244 |
| 242 @SmallTest | 245 @SmallTest |
| 243 @Feature({"Omnibox"}) | 246 @Feature({"Omnibox"}) |
| 247 @RetryOnFailure |
| 244 public void testAutocompleteUpdatedOnSelection() | 248 public void testAutocompleteUpdatedOnSelection() |
| 245 throws InterruptedException, TimeoutException { | 249 throws InterruptedException, TimeoutException { |
| 246 startMainActivityOnBlankPage(); | 250 startMainActivityOnBlankPage(); |
| 247 stubLocationBarAutocomplete(); | 251 stubLocationBarAutocomplete(); |
| 248 | 252 |
| 249 final UrlBar urlBar = getUrlBar(); | 253 final UrlBar urlBar = getUrlBar(); |
| 250 OmniboxTestUtils.toggleUrlBarFocus(urlBar, true); | 254 OmniboxTestUtils.toggleUrlBarFocus(urlBar, true); |
| 251 | 255 |
| 252 // Verify that setting a selection before the autocomplete clears it. | 256 // Verify that setting a selection before the autocomplete clears it. |
| 253 verifySelectionState("test", "ing is fun", 1, 1, false, "test", "test",
true, "test"); | 257 verifySelectionState("test", "ing is fun", 1, 1, false, "test", "test",
true, "test"); |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 343 assertFalse("Inline autocomplete incorrectly prevented.", | 347 assertFalse("Inline autocomplete incorrectly prevented.", |
| 344 didPreventInlineAutocomplete.get()); | 348 didPreventInlineAutocomplete.get()); |
| 345 } | 349 } |
| 346 | 350 |
| 347 /** | 351 /** |
| 348 * Ensure that if the user deletes just the inlined autocomplete text that t
he suggestions are | 352 * Ensure that if the user deletes just the inlined autocomplete text that t
he suggestions are |
| 349 * regenerated. | 353 * regenerated. |
| 350 */ | 354 */ |
| 351 @SmallTest | 355 @SmallTest |
| 352 @Feature({"Omnibox"}) | 356 @Feature({"Omnibox"}) |
| 357 @RetryOnFailure |
| 353 public void testSuggestionsUpdatedWhenDeletingInlineAutocomplete() | 358 public void testSuggestionsUpdatedWhenDeletingInlineAutocomplete() |
| 354 throws InterruptedException, TimeoutException { | 359 throws InterruptedException, TimeoutException { |
| 355 startMainActivityOnBlankPage(); | 360 startMainActivityOnBlankPage(); |
| 356 | 361 |
| 357 stubLocationBarAutocomplete(); | 362 stubLocationBarAutocomplete(); |
| 358 final UrlBar urlBar = getUrlBar(); | 363 final UrlBar urlBar = getUrlBar(); |
| 359 OmniboxTestUtils.toggleUrlBarFocus(urlBar, true); | 364 OmniboxTestUtils.toggleUrlBarFocus(urlBar, true); |
| 360 | 365 |
| 361 setTextAndVerifyNoAutocomplete(urlBar, "test"); | 366 setTextAndVerifyNoAutocomplete(urlBar, "test"); |
| 362 setAutocomplete(urlBar, "test", "ing"); | 367 setAutocomplete(urlBar, "test", "ing"); |
| (...skipping 22 matching lines...) Expand all Loading... |
| 385 } | 390 } |
| 386 })); | 391 })); |
| 387 | 392 |
| 388 autocompleteHelper.waitForCallback(0); | 393 autocompleteHelper.waitForCallback(0); |
| 389 assertTrue("Inline autocomplete incorrectly allowed after delete.", | 394 assertTrue("Inline autocomplete incorrectly allowed after delete.", |
| 390 didPreventInlineAutocomplete.get()); | 395 didPreventInlineAutocomplete.get()); |
| 391 } | 396 } |
| 392 | 397 |
| 393 @SmallTest | 398 @SmallTest |
| 394 @Feature({"Omnibox"}) | 399 @Feature({"Omnibox"}) |
| 400 @RetryOnFailure |
| 395 public void testSelectionChangesIgnoredInBatchMode() throws InterruptedExcep
tion { | 401 public void testSelectionChangesIgnoredInBatchMode() throws InterruptedExcep
tion { |
| 396 startMainActivityOnBlankPage(); | 402 startMainActivityOnBlankPage(); |
| 397 stubLocationBarAutocomplete(); | 403 stubLocationBarAutocomplete(); |
| 398 final UrlBar urlBar = getUrlBar(); | 404 final UrlBar urlBar = getUrlBar(); |
| 399 OmniboxTestUtils.toggleUrlBarFocus(urlBar, true); | 405 OmniboxTestUtils.toggleUrlBarFocus(urlBar, true); |
| 400 | 406 |
| 401 setTextAndVerifyNoAutocomplete(urlBar, "test"); | 407 setTextAndVerifyNoAutocomplete(urlBar, "test"); |
| 402 setAutocomplete(urlBar, "test", "ing is fun"); | 408 setAutocomplete(urlBar, "test", "ing is fun"); |
| 403 | 409 |
| 404 ThreadUtils.runOnUiThreadBlocking(new Runnable() { | 410 ThreadUtils.runOnUiThreadBlocking(new Runnable() { |
| (...skipping 17 matching lines...) Expand all Loading... |
| 422 // Ensure that after batch mode has ended that the autocomplete is clear
ed due to the | 428 // Ensure that after batch mode has ended that the autocomplete is clear
ed due to the |
| 423 // invalid selection range. | 429 // invalid selection range. |
| 424 state = getAutocompleteState(urlBar, null); | 430 state = getAutocompleteState(urlBar, null); |
| 425 assertFalse(state.hasAutocomplete); | 431 assertFalse(state.hasAutocomplete); |
| 426 assertEquals("test", state.textWithoutAutocomplete); | 432 assertEquals("test", state.textWithoutAutocomplete); |
| 427 assertEquals("test", state.textWithAutocomplete); | 433 assertEquals("test", state.textWithAutocomplete); |
| 428 } | 434 } |
| 429 | 435 |
| 430 @SmallTest | 436 @SmallTest |
| 431 @Feature({"Omnibox"}) | 437 @Feature({"Omnibox"}) |
| 438 @RetryOnFailure |
| 432 public void testBatchModeChangesTriggerCorrectSuggestions() throws Interrupt
edException { | 439 public void testBatchModeChangesTriggerCorrectSuggestions() throws Interrupt
edException { |
| 433 startMainActivityOnBlankPage(); | 440 startMainActivityOnBlankPage(); |
| 434 | 441 |
| 435 final AtomicReference<String> requestedAutocompleteText = new AtomicRefe
rence<String>(); | 442 final AtomicReference<String> requestedAutocompleteText = new AtomicRefe
rence<String>(); |
| 436 final StubAutocompleteController controller = new StubAutocompleteContro
ller() { | 443 final StubAutocompleteController controller = new StubAutocompleteContro
ller() { |
| 437 @Override | 444 @Override |
| 438 public void start(Profile profile, String url, String text, int curs
orPosition, | 445 public void start(Profile profile, String url, String text, int curs
orPosition, |
| 439 boolean preventInlineAutocomplete) { | 446 boolean preventInlineAutocomplete) { |
| 440 requestedAutocompleteText.set(text); | 447 requestedAutocompleteText.set(text); |
| 441 } | 448 } |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 536 urlBar.setText("googl"); | 543 urlBar.setText("googl"); |
| 537 urlBar.setSelection(5); | 544 urlBar.setSelection(5); |
| 538 urlBar.endBatchEdit(); | 545 urlBar.endBatchEdit(); |
| 539 } | 546 } |
| 540 }); | 547 }); |
| 541 assertFalse(state.hasAutocomplete); | 548 assertFalse(state.hasAutocomplete); |
| 542 } | 549 } |
| 543 | 550 |
| 544 @SmallTest | 551 @SmallTest |
| 545 @Feature("Omnibox") | 552 @Feature("Omnibox") |
| 553 @RetryOnFailure |
| 546 public void testAutocompleteSpanClearedOnNonMatchingCommitText() throws Inte
rruptedException { | 554 public void testAutocompleteSpanClearedOnNonMatchingCommitText() throws Inte
rruptedException { |
| 547 startMainActivityOnBlankPage(); | 555 startMainActivityOnBlankPage(); |
| 548 | 556 |
| 549 stubLocationBarAutocomplete(); | 557 stubLocationBarAutocomplete(); |
| 550 | 558 |
| 551 final UrlBar urlBar = getUrlBar(); | 559 final UrlBar urlBar = getUrlBar(); |
| 552 OmniboxTestUtils.toggleUrlBarFocus(urlBar, true); | 560 OmniboxTestUtils.toggleUrlBarFocus(urlBar, true); |
| 553 OmniboxTestUtils.waitForFocusAndKeyboardActive(urlBar, true); | 561 OmniboxTestUtils.waitForFocusAndKeyboardActive(urlBar, true); |
| 554 | 562 |
| 555 setTextAndVerifyNoAutocomplete(urlBar, "a"); | 563 setTextAndVerifyNoAutocomplete(urlBar, "a"); |
| (...skipping 12 matching lines...) Expand all Loading... |
| 568 CriteriaHelper.pollUiThread(Criteria.equals("al", new Callable<String>()
{ | 576 CriteriaHelper.pollUiThread(Criteria.equals("al", new Callable<String>()
{ |
| 569 @Override | 577 @Override |
| 570 public String call() { | 578 public String call() { |
| 571 return urlBar.getText().toString(); | 579 return urlBar.getText().toString(); |
| 572 } | 580 } |
| 573 })); | 581 })); |
| 574 } | 582 } |
| 575 | 583 |
| 576 @SmallTest | 584 @SmallTest |
| 577 @Feature({"Omnibox"}) | 585 @Feature({"Omnibox"}) |
| 586 @RetryOnFailure |
| 578 public void testAutocompleteUpdatedOnDefocus() throws InterruptedException { | 587 public void testAutocompleteUpdatedOnDefocus() throws InterruptedException { |
| 579 startMainActivityOnBlankPage(); | 588 startMainActivityOnBlankPage(); |
| 580 stubLocationBarAutocomplete(); | 589 stubLocationBarAutocomplete(); |
| 581 final UrlBar urlBar = getUrlBar(); | 590 final UrlBar urlBar = getUrlBar(); |
| 582 OmniboxTestUtils.toggleUrlBarFocus(urlBar, true); | 591 OmniboxTestUtils.toggleUrlBarFocus(urlBar, true); |
| 583 | 592 |
| 584 // Verify that defocusing the UrlBar clears the autocomplete. | 593 // Verify that defocusing the UrlBar clears the autocomplete. |
| 585 setTextAndVerifyNoAutocomplete(urlBar, "test"); | 594 setTextAndVerifyNoAutocomplete(urlBar, "test"); |
| 586 setAutocomplete(urlBar, "test", "ing is fun"); | 595 setAutocomplete(urlBar, "test", "ing is fun"); |
| 587 OmniboxTestUtils.toggleUrlBarFocus(urlBar, false); | 596 OmniboxTestUtils.toggleUrlBarFocus(urlBar, false); |
| 588 AutocompleteState state = getAutocompleteState(urlBar, null); | 597 AutocompleteState state = getAutocompleteState(urlBar, null); |
| 589 assertFalse(state.hasAutocomplete); | 598 assertFalse(state.hasAutocomplete); |
| 590 } | 599 } |
| 591 | 600 |
| 592 @SmallTest | 601 @SmallTest |
| 593 @Feature({"Omnibox"}) | 602 @Feature({"Omnibox"}) |
| 603 @RetryOnFailure |
| 594 public void testAutocompleteClearedOnComposition() | 604 public void testAutocompleteClearedOnComposition() |
| 595 throws InterruptedException, ExecutionException { | 605 throws InterruptedException, ExecutionException { |
| 596 startMainActivityOnBlankPage(); | 606 startMainActivityOnBlankPage(); |
| 597 stubLocationBarAutocomplete(); | 607 stubLocationBarAutocomplete(); |
| 598 final UrlBar urlBar = getUrlBar(); | 608 final UrlBar urlBar = getUrlBar(); |
| 599 OmniboxTestUtils.toggleUrlBarFocus(urlBar, true); | 609 OmniboxTestUtils.toggleUrlBarFocus(urlBar, true); |
| 600 OmniboxTestUtils.waitForFocusAndKeyboardActive(urlBar, true); | 610 OmniboxTestUtils.waitForFocusAndKeyboardActive(urlBar, true); |
| 601 | 611 |
| 602 setTextAndVerifyNoAutocomplete(urlBar, "test"); | 612 setTextAndVerifyNoAutocomplete(urlBar, "test"); |
| 603 setAutocomplete(urlBar, "test", "ing is fun"); | 613 setAutocomplete(urlBar, "test", "ing is fun"); |
| 604 | 614 |
| 605 assertNotNull(urlBar.mInputConnection); | 615 assertNotNull(urlBar.mInputConnection); |
| 606 AutocompleteState state = getAutocompleteState(urlBar, new Runnable() { | 616 AutocompleteState state = getAutocompleteState(urlBar, new Runnable() { |
| 607 @Override | 617 @Override |
| 608 public void run() { | 618 public void run() { |
| 609 urlBar.mInputConnection.setComposingText("ing compose", 4); | 619 urlBar.mInputConnection.setComposingText("ing compose", 4); |
| 610 } | 620 } |
| 611 }); | 621 }); |
| 612 assertFalse(state.hasAutocomplete); | 622 assertFalse(state.hasAutocomplete); |
| 613 | 623 |
| 614 Editable urlText = getUrlBarText(urlBar); | 624 Editable urlText = getUrlBarText(urlBar); |
| 615 assertEquals("testing compose", urlText.toString()); | 625 assertEquals("testing compose", urlText.toString()); |
| 616 // TODO(tedchoc): Investigate why this fails on x86. | 626 // TODO(tedchoc): Investigate why this fails on x86. |
| 617 //assertEquals(4, BaseInputConnection.getComposingSpanStart(urlText)); | 627 //assertEquals(4, BaseInputConnection.getComposingSpanStart(urlText)); |
| 618 //assertEquals(15, BaseInputConnection.getComposingSpanEnd(urlText)); | 628 //assertEquals(15, BaseInputConnection.getComposingSpanEnd(urlText)); |
| 619 } | 629 } |
| 620 | 630 |
| 621 @SmallTest | 631 @SmallTest |
| 622 @Feature("Omnibox") | 632 @Feature("Omnibox") |
| 633 @RetryOnFailure |
| 623 public void testDelayedCompositionCorrectedWithAutocomplete() | 634 public void testDelayedCompositionCorrectedWithAutocomplete() |
| 624 throws InterruptedException, ExecutionException { | 635 throws InterruptedException, ExecutionException { |
| 625 startMainActivityOnBlankPage(); | 636 startMainActivityOnBlankPage(); |
| 626 stubLocationBarAutocomplete(); | 637 stubLocationBarAutocomplete(); |
| 627 | 638 |
| 628 final UrlBar urlBar = getUrlBar(); | 639 final UrlBar urlBar = getUrlBar(); |
| 629 OmniboxTestUtils.toggleUrlBarFocus(urlBar, true); | 640 OmniboxTestUtils.toggleUrlBarFocus(urlBar, true); |
| 630 OmniboxTestUtils.waitForFocusAndKeyboardActive(urlBar, true); | 641 OmniboxTestUtils.waitForFocusAndKeyboardActive(urlBar, true); |
| 631 | 642 |
| 632 assertNotNull(urlBar.mInputConnection); | 643 assertNotNull(urlBar.mInputConnection); |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 727 assertEquals(BaseInputConnection.getComposingSpanStart(urlText), 10); | 738 assertEquals(BaseInputConnection.getComposingSpanStart(urlText), 10); |
| 728 assertEquals(BaseInputConnection.getComposingSpanEnd(urlText), 22); | 739 assertEquals(BaseInputConnection.getComposingSpanEnd(urlText), 22); |
| 729 } | 740 } |
| 730 | 741 |
| 731 /** | 742 /** |
| 732 * Test to verify the omnibox can take focus during startup before native li
braries have | 743 * Test to verify the omnibox can take focus during startup before native li
braries have |
| 733 * loaded. | 744 * loaded. |
| 734 */ | 745 */ |
| 735 @SmallTest | 746 @SmallTest |
| 736 @Feature({"Omnibox"}) | 747 @Feature({"Omnibox"}) |
| 748 @RetryOnFailure |
| 737 public void testFocusingOnStartup() throws InterruptedException { | 749 public void testFocusingOnStartup() throws InterruptedException { |
| 738 Intent intent = new Intent(Intent.ACTION_MAIN); | 750 Intent intent = new Intent(Intent.ACTION_MAIN); |
| 739 intent.addCategory(Intent.CATEGORY_LAUNCHER); | 751 intent.addCategory(Intent.CATEGORY_LAUNCHER); |
| 740 prepareUrlIntent(intent, "about:blank"); | 752 prepareUrlIntent(intent, "about:blank"); |
| 741 startActivityCompletely(intent); | 753 startActivityCompletely(intent); |
| 742 | 754 |
| 743 UrlBar urlBar = getUrlBar(); | 755 UrlBar urlBar = getUrlBar(); |
| 744 assertNotNull(urlBar); | 756 assertNotNull(urlBar); |
| 745 OmniboxTestUtils.toggleUrlBarFocus(urlBar, true); | 757 OmniboxTestUtils.toggleUrlBarFocus(urlBar, true); |
| 746 OmniboxTestUtils.waitForFocusAndKeyboardActive(urlBar, true); | 758 OmniboxTestUtils.waitForFocusAndKeyboardActive(urlBar, true); |
| 747 } | 759 } |
| 748 | 760 |
| 749 @SmallTest | 761 @SmallTest |
| 750 @Feature({"Omnibox"}) | 762 @Feature({"Omnibox"}) |
| 763 @RetryOnFailure |
| 751 public void testCopyHuge() throws InterruptedException { | 764 public void testCopyHuge() throws InterruptedException { |
| 752 startMainActivityWithURL(HUGE_URL); | 765 startMainActivityWithURL(HUGE_URL); |
| 753 OmniboxTestUtils.toggleUrlBarFocus(getUrlBar(), true); | 766 OmniboxTestUtils.toggleUrlBarFocus(getUrlBar(), true); |
| 754 assertEquals(HUGE_URL, copyUrlToClipboard(android.R.id.copy)); | 767 assertEquals(HUGE_URL, copyUrlToClipboard(android.R.id.copy)); |
| 755 } | 768 } |
| 756 | 769 |
| 757 @SmallTest | 770 @SmallTest |
| 758 @Feature({"Omnibox"}) | 771 @Feature({"Omnibox"}) |
| 759 public void testCutHuge() throws InterruptedException { | 772 public void testCutHuge() throws InterruptedException { |
| 760 startMainActivityWithURL(HUGE_URL); | 773 startMainActivityWithURL(HUGE_URL); |
| (...skipping 23 matching lines...) Expand all Loading... |
| 784 CharSequence text = (clip != null && clip.getItemCount() != 0) | 797 CharSequence text = (clip != null && clip.getItemCount() != 0) |
| 785 ? clip.getItemAt(0).getText() : null; | 798 ? clip.getItemAt(0).getText() : null; |
| 786 return text != null ? text.toString() : null; | 799 return text != null ? text.toString() : null; |
| 787 } | 800 } |
| 788 | 801 |
| 789 @Override | 802 @Override |
| 790 public void startMainActivity() throws InterruptedException { | 803 public void startMainActivity() throws InterruptedException { |
| 791 // Each test will start the activity. | 804 // Each test will start the activity. |
| 792 } | 805 } |
| 793 } | 806 } |
| OLD | NEW |