Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(230)

Side by Side Diff: chrome/android/javatests/src/org/chromium/chrome/browser/NavigateTest.java

Issue 1519523002: [Android] Support conditional test disabling based on android.os.Build values. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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_TABLET; 7 import static org.chromium.base.test.util.Restriction.RESTRICTION_TYPE_TABLET;
8 8
9 import android.test.FlakyTest; 9 import android.test.FlakyTest;
10 import android.test.suitebuilder.annotation.MediumTest; 10 import android.test.suitebuilder.annotation.MediumTest;
11 import android.test.suitebuilder.annotation.Smoke; 11 import android.test.suitebuilder.annotation.Smoke;
12 import android.text.TextUtils; 12 import android.text.TextUtils;
13 import android.view.KeyEvent; 13 import android.view.KeyEvent;
14 14
15 import org.chromium.base.ThreadUtils; 15 import org.chromium.base.ThreadUtils;
16 import org.chromium.base.test.util.DisabledTest; 16 import org.chromium.base.test.util.DisableIf;
17 import org.chromium.base.test.util.Feature; 17 import org.chromium.base.test.util.Feature;
18 import org.chromium.base.test.util.Restriction; 18 import org.chromium.base.test.util.Restriction;
19 import org.chromium.base.test.util.UrlUtils; 19 import org.chromium.base.test.util.UrlUtils;
20 import org.chromium.chrome.R; 20 import org.chromium.chrome.R;
21 import org.chromium.chrome.browser.omnibox.LocationBarLayout; 21 import org.chromium.chrome.browser.omnibox.LocationBarLayout;
22 import org.chromium.chrome.browser.omnibox.UrlBar; 22 import org.chromium.chrome.browser.omnibox.UrlBar;
23 import org.chromium.chrome.browser.tab.EmptyTabObserver; 23 import org.chromium.chrome.browser.tab.EmptyTabObserver;
24 import org.chromium.chrome.browser.tab.Tab; 24 import org.chromium.chrome.browser.tab.Tab;
25 import org.chromium.chrome.browser.tab.TabObserver; 25 import org.chromium.chrome.browser.tab.TabObserver;
26 import org.chromium.chrome.browser.tabmodel.TabModel; 26 import org.chromium.chrome.browser.tabmodel.TabModel;
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after
348 urls[1], getActivity().getActivityTab().getUrl()); 348 urls[1], getActivity().getActivityTab().getUrl());
349 349
350 singleClickView(getActivity().findViewById(R.id.forward_button)); 350 singleClickView(getActivity().findViewById(R.id.forward_button));
351 UiUtils.settleDownUI(getInstrumentation()); 351 UiUtils.settleDownUI(getInstrumentation());
352 assertEquals(String.format(Locale.US, 352 assertEquals(String.format(Locale.US,
353 "URL mismatch after pressing fwd button for the 2nd time in repetition %d.", i), 353 "URL mismatch after pressing fwd button for the 2nd time in repetition %d.", i),
354 urls[2], getActivity().getActivityTab().getUrl()); 354 urls[2], getActivity().getActivityTab().getUrl());
355 } 355 }
356 } 356 }
357 357
358 @DisabledTest // Fails on android-one: crbug.com/540723 358 @DisableIf.Build(hardware_is = "sprout") // Fails on android-one: crbug.com/ 540723
jbudorick 2015/12/10 15:23:15 There are, unsurprisingly, other tests where this
Yaron 2015/12/11 02:22:16 :( Should we include a message= attribute which ca
jbudorick 2015/12/17 02:08:13 I like this idea, but I'll address how the test ru
Yaron 2015/12/17 15:12:37 Right. So what options do we provide for sheriffs
jbudorick 2015/12/18 17:43:06 Hm, ok.
359 @MediumTest 359 @MediumTest
360 @Feature({"Navigation"}) 360 @Feature({"Navigation"})
361 public void testWindowOpenUrlSpoof() throws Exception { 361 public void testWindowOpenUrlSpoof() throws Exception {
362 TestWebServer webServer = TestWebServer.start(); 362 TestWebServer webServer = TestWebServer.start();
363 try { 363 try {
364 // Make sure that we start with one tab. 364 // Make sure that we start with one tab.
365 final TabModel model = getActivity().getTabModelSelector().getModel( false); 365 final TabModel model = getActivity().getTabModelSelector().getModel( false);
366 366
367 final Semaphore urlServedSemaphore = new Semaphore(0); 367 final Semaphore urlServedSemaphore = new Semaphore(0);
368 Runnable checkAction = new Runnable() { 368 Runnable checkAction = new Runnable() {
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
453 assert false : "Unexpected TimeoutException"; 453 assert false : "Unexpected TimeoutException";
454 } 454 }
455 return null; 455 return null;
456 } 456 }
457 457
458 @Override 458 @Override
459 public void startMainActivity() throws InterruptedException { 459 public void startMainActivity() throws InterruptedException {
460 startMainActivityFromLauncher(); 460 startMainActivityFromLauncher();
461 } 461 }
462 } 462 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698