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 android.content.Intent; | 7 import android.content.Intent; |
8 import android.net.Uri; | 8 import android.net.Uri; |
9 import android.os.Bundle; | 9 import android.os.Bundle; |
10 import android.os.Environment; | 10 import android.os.Environment; |
11 import android.provider.Browser; | 11 import android.provider.Browser; |
12 import android.test.FlakyTest; | |
13 import android.test.suitebuilder.annotation.LargeTest; | 12 import android.test.suitebuilder.annotation.LargeTest; |
14 import android.test.suitebuilder.annotation.MediumTest; | 13 import android.test.suitebuilder.annotation.MediumTest; |
15 import android.text.TextUtils; | 14 import android.text.TextUtils; |
16 import android.view.ContextMenu; | 15 import android.view.ContextMenu; |
17 import android.view.View; | 16 import android.view.View; |
18 | 17 |
19 import junit.framework.Assert; | 18 import junit.framework.Assert; |
20 | 19 |
21 import org.chromium.base.BaseSwitches; | 20 import org.chromium.base.BaseSwitches; |
22 import org.chromium.base.ThreadUtils; | 21 import org.chromium.base.ThreadUtils; |
23 import org.chromium.base.test.util.CommandLineFlags; | 22 import org.chromium.base.test.util.CommandLineFlags; |
24 import org.chromium.base.test.util.Feature; | 23 import org.chromium.base.test.util.Feature; |
24 import org.chromium.base.test.util.FlakyTest; | |
25 import org.chromium.chrome.R; | 25 import org.chromium.chrome.R; |
26 import org.chromium.chrome.browser.tab.EmptyTabObserver; | 26 import org.chromium.chrome.browser.tab.EmptyTabObserver; |
27 import org.chromium.chrome.browser.tab.Tab; | 27 import org.chromium.chrome.browser.tab.Tab; |
28 import org.chromium.chrome.browser.tabmodel.TabModelUtils; | 28 import org.chromium.chrome.browser.tabmodel.TabModelUtils; |
29 import org.chromium.chrome.test.ChromeTabbedActivityTestBase; | 29 import org.chromium.chrome.test.ChromeTabbedActivityTestBase; |
30 import org.chromium.chrome.test.MultiActivityTestBase; | 30 import org.chromium.chrome.test.MultiActivityTestBase; |
31 import org.chromium.chrome.test.util.ApplicationTestUtils; | 31 import org.chromium.chrome.test.util.ApplicationTestUtils; |
32 import org.chromium.chrome.test.util.ChromeTabUtils; | 32 import org.chromium.chrome.test.util.ChromeTabUtils; |
33 import org.chromium.content.browser.test.util.Criteria; | 33 import org.chromium.content.browser.test.util.Criteria; |
34 import org.chromium.content.browser.test.util.CriteriaHelper; | 34 import org.chromium.content.browser.test.util.CriteriaHelper; |
(...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
491 } | 491 } |
492 | 492 |
493 /** | 493 /** |
494 * Tests that a tab is not reused when launched from the same app as an alre ady opened tab and | 494 * Tests that a tab is not reused when launched from the same app as an alre ady opened tab and |
495 * when the user has entered text in the page. | 495 * when the user has entered text in the page. |
496 * @throws InterruptedException | 496 * @throws InterruptedException |
497 */ | 497 */ |
498 /** | 498 /** |
499 * @LargeTest | 499 * @LargeTest |
500 * @Feature({"Navigation"}) | 500 * @Feature({"Navigation"}) |
501 * Bug 6467101 | |
502 */ | 501 */ |
503 @FlakyTest | 502 @FlakyTest(message = "http://crbug.com/6467101") |
gone
2016/04/08 00:16:17
This is a buganizer bug.
| |
504 public void testNewTabWhenPageEdited() throws InterruptedException, TimeoutE xception { | 503 public void testNewTabWhenPageEdited() throws InterruptedException, TimeoutE xception { |
505 startMainActivityFromLauncher(); | 504 startMainActivityFromLauncher(); |
506 | 505 |
507 String url1 = mTestServer.getURL("/chrome/test/data/android/google.html" ); | 506 String url1 = mTestServer.getURL("/chrome/test/data/android/google.html" ); |
508 String url2 = mTestServer.getURL("/chrome/test/data/android/about.html") ; | 507 String url2 = mTestServer.getURL("/chrome/test/data/android/about.html") ; |
509 | 508 |
510 // Launch a first URL from an app. | 509 // Launch a first URL from an app. |
511 launchUrlFromExternalApp(url1, EXTERNAL_APP_1_ID, false); | 510 launchUrlFromExternalApp(url1, EXTERNAL_APP_1_ID, false); |
512 | 511 |
513 // Focus the text-field and type something. | 512 // Focus the text-field and type something. |
(...skipping 25 matching lines...) Expand all Loading... | |
539 private ContextMenu mContextMenu; | 538 private ContextMenu mContextMenu; |
540 | 539 |
541 @Override | 540 @Override |
542 public void onContextMenuShown(Tab tab, ContextMenu menu) { | 541 public void onContextMenuShown(Tab tab, ContextMenu menu) { |
543 mContextMenu = menu; | 542 mContextMenu = menu; |
544 } | 543 } |
545 } | 544 } |
546 | 545 |
547 /** | 546 /** |
548 * Catches regressions for https://crbug.com/495877. | 547 * Catches regressions for https://crbug.com/495877. |
549 * Flakiness reported in https://crbug.com/571030 | |
550 */ | 548 */ |
551 @FlakyTest | 549 @FlakyTest(message = "https://crbug.com/571030") |
552 @MediumTest | 550 @MediumTest |
553 @CommandLineFlags.Add(BaseSwitches.ENABLE_LOW_END_DEVICE_MODE) | 551 @CommandLineFlags.Add(BaseSwitches.ENABLE_LOW_END_DEVICE_MODE) |
554 public void testBackgroundSvelteTabIsSelectedAfterClosingExternalTab() throw s Exception { | 552 public void testBackgroundSvelteTabIsSelectedAfterClosingExternalTab() throw s Exception { |
555 // Start up Chrome and immediately close its tab -- it gets in the way. | 553 // Start up Chrome and immediately close its tab -- it gets in the way. |
556 startMainActivityFromLauncher(); | 554 startMainActivityFromLauncher(); |
557 ThreadUtils.runOnUiThreadBlocking(new Runnable() { | 555 ThreadUtils.runOnUiThreadBlocking(new Runnable() { |
558 @Override | 556 @Override |
559 public void run() { | 557 public void run() { |
560 TabModelUtils.closeTabByIndex(getActivity().getCurrentTabModel() , 0); | 558 TabModelUtils.closeTabByIndex(getActivity().getCurrentTabModel() , 0); |
561 } | 559 } |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
666 | 664 |
667 String url = "http://googleweblight.com/?lite_url=chrome/test/data/andro id/about.html"; | 665 String url = "http://googleweblight.com/?lite_url=chrome/test/data/andro id/about.html"; |
668 | 666 |
669 // Launch a first URL from an app. | 667 // Launch a first URL from an app. |
670 launchUrlFromExternalApp(url, url, EXTERNAL_APP_1_ID, false, null); | 668 launchUrlFromExternalApp(url, url, EXTERNAL_APP_1_ID, false, null); |
671 | 669 |
672 assertEquals("Selected tab is not on the right URL.", | 670 assertEquals("Selected tab is not on the right URL.", |
673 url, getActivity().getActivityTab().getUrl()); | 671 url, getActivity().getActivityTab().getUrl()); |
674 } | 672 } |
675 } | 673 } |
OLD | NEW |