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; | 5 package org.chromium.chrome.browser; |
6 | 6 |
7 import static org.chromium.base.test.util.Restriction.RESTRICTION_TYPE_NON_LOW_E
ND_DEVICE; | 7 import static org.chromium.base.test.util.Restriction.RESTRICTION_TYPE_NON_LOW_E
ND_DEVICE; |
8 | 8 |
9 import android.content.DialogInterface; | 9 import android.content.DialogInterface; |
10 import android.content.pm.ActivityInfo; | 10 import android.content.pm.ActivityInfo; |
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
324 // Click node in the 1st tab. | 324 // Click node in the 1st tab. |
325 DOMUtils.clickNode(this, getActivity().getActivityTab().getContentViewCo
re(), "input_text"); | 325 DOMUtils.clickNode(this, getActivity().getActivityTab().getContentViewCo
re(), "input_text"); |
326 assertWaitForKeyboardStatus(true); | 326 assertWaitForKeyboardStatus(true); |
327 | 327 |
328 // Close current tab(the 1st tab). | 328 // Close current tab(the 1st tab). |
329 ChromeTabUtils.closeCurrentTab(getInstrumentation(), getActivity()); | 329 ChromeTabUtils.closeCurrentTab(getInstrumentation(), getActivity()); |
330 assertWaitForKeyboardStatus(false); | 330 assertWaitForKeyboardStatus(false); |
331 } | 331 } |
332 | 332 |
333 /** | 333 /** |
| 334 * Verify that opening a new window hides keyboard. |
| 335 */ |
| 336 @MediumTest |
| 337 @Feature({"Android-TabSwitcher"}) |
| 338 @RetryOnFailure |
| 339 public void testHideKeyboardWhenOpeningWindow() throws Exception { |
| 340 mTestServer = EmbeddedTestServer.createAndStartServer(getInstrumentation
().getContext()); |
| 341 // Open a new tab and click an editable node. |
| 342 ChromeTabUtils.fullyLoadUrlInNewTab( |
| 343 getInstrumentation(), getActivity(), mTestServer.getURL(TEST_FIL
E_PATH), false); |
| 344 assertEquals("Failed to click textarea.", true, |
| 345 DOMUtils.clickNode( |
| 346 this, getActivity().getActivityTab().getContentViewCore(
), "textarea")); |
| 347 assertWaitForKeyboardStatus(true); |
| 348 |
| 349 // Click the button to open a new window. |
| 350 assertEquals("Failed to click button.", true, |
| 351 DOMUtils.clickNode( |
| 352 this, getActivity().getActivityTab().getContentViewCore(
), "button")); |
| 353 assertWaitForKeyboardStatus(false); |
| 354 } |
| 355 |
| 356 /** |
334 * Verify that opening a new tab and navigating immediately sets a size on t
he newly created | 357 * Verify that opening a new tab and navigating immediately sets a size on t
he newly created |
335 * renderer. https://crbug.com/434477. | 358 * renderer. https://crbug.com/434477. |
336 * @throws InterruptedException | 359 * @throws InterruptedException |
337 * @throws TimeoutException | 360 * @throws TimeoutException |
338 */ | 361 */ |
339 @SmallTest | 362 @SmallTest |
340 @RetryOnFailure | 363 @RetryOnFailure |
341 public void testNewTabSetsContentViewSize() throws InterruptedException, Tim
eoutException { | 364 public void testNewTabSetsContentViewSize() throws InterruptedException, Tim
eoutException { |
342 ChromeTabUtils.newTabFromMenu(getInstrumentation(), getActivity()); | 365 ChromeTabUtils.newTabFromMenu(getInstrumentation(), getActivity()); |
343 getInstrumentation().waitForIdleSync(); | 366 getInstrumentation().waitForIdleSync(); |
(...skipping 1426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1770 throws InterruptedException { | 1793 throws InterruptedException { |
1771 CriteriaHelper.pollInstrumentationThread( | 1794 CriteriaHelper.pollInstrumentationThread( |
1772 Criteria.equals(expected, new Callable<Boolean>() { | 1795 Criteria.equals(expected, new Callable<Boolean>() { |
1773 @Override | 1796 @Override |
1774 public Boolean call() { | 1797 public Boolean call() { |
1775 return fileToCheck.exists(); | 1798 return fileToCheck.exists(); |
1776 } | 1799 } |
1777 })); | 1800 })); |
1778 } | 1801 } |
1779 } | 1802 } |
OLD | NEW |