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.os.Environment; | |
10 import android.test.MoreAsserts; | 9 import android.test.MoreAsserts; |
11 import android.test.suitebuilder.annotation.LargeTest; | 10 import android.test.suitebuilder.annotation.LargeTest; |
12 | 11 |
13 import org.chromium.base.ThreadUtils; | 12 import org.chromium.base.ThreadUtils; |
14 import org.chromium.base.test.util.DisabledTest; | 13 import org.chromium.base.test.util.DisabledTest; |
15 import org.chromium.base.test.util.Feature; | 14 import org.chromium.base.test.util.Feature; |
16 import org.chromium.base.test.util.FlakyTest; | 15 import org.chromium.base.test.util.FlakyTest; |
17 import org.chromium.base.test.util.Restriction; | 16 import org.chromium.base.test.util.Restriction; |
18 import org.chromium.base.test.util.RetryOnFailure; | 17 import org.chromium.base.test.util.RetryOnFailure; |
19 import org.chromium.chrome.browser.prerender.ExternalPrerenderHandler; | 18 import org.chromium.chrome.browser.prerender.ExternalPrerenderHandler; |
(...skipping 11 matching lines...) Expand all Loading... |
31 * | 30 * |
32 * Tests are disabled on low-end devices. These only support one renderer for pe
rformance reasons. | 31 * Tests are disabled on low-end devices. These only support one renderer for pe
rformance reasons. |
33 */ | 32 */ |
34 public class PrerenderTest extends ChromeTabbedActivityTestBase { | 33 public class PrerenderTest extends ChromeTabbedActivityTestBase { |
35 | 34 |
36 private EmbeddedTestServer mTestServer; | 35 private EmbeddedTestServer mTestServer; |
37 | 36 |
38 @Override | 37 @Override |
39 protected void setUp() throws Exception { | 38 protected void setUp() throws Exception { |
40 super.setUp(); | 39 super.setUp(); |
41 mTestServer = EmbeddedTestServer.createAndStartFileServer( | 40 mTestServer = EmbeddedTestServer.createAndStartServer(getInstrumentation
().getContext()); |
42 getInstrumentation().getContext(), Environment.getExternalStorag
eDirectory()); | |
43 } | 41 } |
44 | 42 |
45 @Override | 43 @Override |
46 protected void tearDown() throws Exception { | 44 protected void tearDown() throws Exception { |
47 mTestServer.stopAndDestroyServer(); | 45 mTestServer.stopAndDestroyServer(); |
48 super.tearDown(); | 46 super.tearDown(); |
49 } | 47 } |
50 | 48 |
51 /** | 49 /** |
52 * We are using Autocomplete Action Predictor to decide whether or not to pr
erender. | 50 * We are using Autocomplete Action Predictor to decide whether or not to pr
erender. |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 handler.cancelCurrentPrerender(); | 142 handler.cancelCurrentPrerender(); |
145 } | 143 } |
146 }); | 144 }); |
147 } | 145 } |
148 | 146 |
149 @Override | 147 @Override |
150 public void startMainActivity() throws InterruptedException { | 148 public void startMainActivity() throws InterruptedException { |
151 startMainActivityOnBlankPage(); | 149 startMainActivityOnBlankPage(); |
152 } | 150 } |
153 } | 151 } |
OLD | NEW |