| 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 static org.chromium.chrome.test.util.OmniboxTestUtils.buildSuggestionMap; | 7 import static org.chromium.chrome.test.util.OmniboxTestUtils.buildSuggestionMap; |
| 8 | 8 |
| 9 import android.os.Build; | 9 import android.os.Build; |
| 10 import android.os.SystemClock; | 10 import android.os.SystemClock; |
| (...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 327 } | 327 } |
| 328 | 328 |
| 329 @Test | 329 @Test |
| 330 @MediumTest | 330 @MediumTest |
| 331 @Feature({"Omnibox", "Main"}) | 331 @Feature({"Omnibox", "Main"}) |
| 332 @RetryOnFailure | 332 @RetryOnFailure |
| 333 public void testAutoCompleteAndCorrectionLandscape() | 333 public void testAutoCompleteAndCorrectionLandscape() |
| 334 throws ExecutionException, InterruptedException { | 334 throws ExecutionException, InterruptedException { |
| 335 // Default orientation for tablets is landscape. Default for phones is p
ortrait. | 335 // Default orientation for tablets is landscape. Default for phones is p
ortrait. |
| 336 int requestedOrientation = 1; | 336 int requestedOrientation = 1; |
| 337 if (DeviceFormFactor.isTablet(mActivityTestRule.getActivity())) { | 337 if (DeviceFormFactor.isTablet()) { |
| 338 requestedOrientation = 0; | 338 requestedOrientation = 0; |
| 339 } | 339 } |
| 340 doTestAutoCompleteAndCorrectionForOrientation(requestedOrientation); | 340 doTestAutoCompleteAndCorrectionForOrientation(requestedOrientation); |
| 341 } | 341 } |
| 342 | 342 |
| 343 @Test | 343 @Test |
| 344 @MediumTest | 344 @MediumTest |
| 345 @Feature({"Omnibox", "Main"}) | 345 @Feature({"Omnibox", "Main"}) |
| 346 @RetryOnFailure | 346 @RetryOnFailure |
| 347 public void testAutoCompleteAndCorrectionPortrait() | 347 public void testAutoCompleteAndCorrectionPortrait() |
| 348 throws ExecutionException, InterruptedException { | 348 throws ExecutionException, InterruptedException { |
| 349 // Default orientation for tablets is landscape. Default for phones is p
ortrait. | 349 // Default orientation for tablets is landscape. Default for phones is p
ortrait. |
| 350 int requestedOrientation = 0; | 350 int requestedOrientation = 0; |
| 351 if (DeviceFormFactor.isTablet(mActivityTestRule.getActivity())) { | 351 if (DeviceFormFactor.isTablet()) { |
| 352 requestedOrientation = 1; | 352 requestedOrientation = 1; |
| 353 } | 353 } |
| 354 doTestAutoCompleteAndCorrectionForOrientation(requestedOrientation); | 354 doTestAutoCompleteAndCorrectionForOrientation(requestedOrientation); |
| 355 } | 355 } |
| 356 | 356 |
| 357 private void doTestAutoCompleteAndCorrectionForOrientation( | 357 private void doTestAutoCompleteAndCorrectionForOrientation( |
| 358 int orientation) throws ExecutionException, InterruptedException { | 358 int orientation) throws ExecutionException, InterruptedException { |
| 359 mActivityTestRule.getActivity().setRequestedOrientation(orientation); | 359 mActivityTestRule.getActivity().setRequestedOrientation(orientation); |
| 360 UiUtils.settleDownUI(InstrumentationRegistry.getInstrumentation()); | 360 UiUtils.settleDownUI(InstrumentationRegistry.getInstrumentation()); |
| 361 | 361 |
| (...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 793 | 793 |
| 794 @Before | 794 @Before |
| 795 public void setUp() throws InterruptedException { | 795 public void setUp() throws InterruptedException { |
| 796 if (mActivityTestRule.getName().equals("testsplitPathFromUrlDisplayText"
) | 796 if (mActivityTestRule.getName().equals("testsplitPathFromUrlDisplayText"
) |
| 797 || mActivityTestRule.getName().equals("testDefaultText")) { | 797 || mActivityTestRule.getName().equals("testDefaultText")) { |
| 798 return; | 798 return; |
| 799 } | 799 } |
| 800 mActivityTestRule.startMainActivityOnBlankPage(); | 800 mActivityTestRule.startMainActivityOnBlankPage(); |
| 801 } | 801 } |
| 802 } | 802 } |
| OLD | NEW |