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

Side by Side Diff: components/cronet/android/sample/javatests/src/org/chromium/cronet_sample_apk/CronetSampleTest.java

Issue 1856273002: Change all FlakyTest import to use org.chromium.base.test.util.FlakyTest (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 months 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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.cronet_sample_apk; 5 package org.chromium.cronet_sample_apk;
6 6
7 import android.content.ComponentName; 7 import android.content.ComponentName;
8 import android.content.Intent; 8 import android.content.Intent;
9 import android.net.Uri; 9 import android.net.Uri;
10 import android.os.ConditionVariable; 10 import android.os.ConditionVariable;
11 import android.test.ActivityInstrumentationTestCase2; 11 import android.test.ActivityInstrumentationTestCase2;
12 import android.test.FlakyTest;
13 import android.text.Editable; 12 import android.text.Editable;
14 import android.text.TextWatcher; 13 import android.text.TextWatcher;
15 import android.widget.TextView; 14 import android.widget.TextView;
16 15
16 import org.chromium.base.test.util.FlakyTest;
17 import org.chromium.net.test.EmbeddedTestServer; 17 import org.chromium.net.test.EmbeddedTestServer;
18 18
19 /** 19 /**
20 * Base test class for all CronetSample based tests. 20 * Base test class for all CronetSample based tests.
21 */ 21 */
22 public class CronetSampleTest extends 22 public class CronetSampleTest extends
23 ActivityInstrumentationTestCase2<CronetSampleActivity> { 23 ActivityInstrumentationTestCase2<CronetSampleActivity> {
24 private EmbeddedTestServer mTestServer; 24 private EmbeddedTestServer mTestServer;
25 private String mUrl; 25 private String mUrl;
26 26
(...skipping 11 matching lines...) Expand all
38 38
39 @Override 39 @Override
40 protected void tearDown() throws Exception { 40 protected void tearDown() throws Exception {
41 mTestServer.stopAndDestroyServer(); 41 mTestServer.stopAndDestroyServer();
42 super.tearDown(); 42 super.tearDown();
43 } 43 }
44 44
45 /* 45 /*
46 @SmallTest 46 @SmallTest
47 @Feature({"Cronet"}) 47 @Feature({"Cronet"})
48 https://crbug.com/592444
49 */ 48 */
50 @FlakyTest 49 @FlakyTest(message = "https://crbug.com/592444")
51 public void testLoadUrl() throws Exception { 50 public void testLoadUrl() throws Exception {
52 CronetSampleActivity activity = launchCronetSampleWithUrl(mUrl); 51 CronetSampleActivity activity = launchCronetSampleWithUrl(mUrl);
53 52
54 // Make sure the activity was created as expected. 53 // Make sure the activity was created as expected.
55 assertNotNull(activity); 54 assertNotNull(activity);
56 55
57 // Verify successful fetch. 56 // Verify successful fetch.
58 final TextView textView = (TextView) activity.findViewById(R.id.resultVi ew); 57 final TextView textView = (TextView) activity.findViewById(R.id.resultVi ew);
59 final ConditionVariable done = new ConditionVariable(); 58 final ConditionVariable done = new ConditionVariable();
60 final TextWatcher textWatcher = new TextWatcher() { 59 final TextWatcher textWatcher = new TextWatcher() {
(...skipping 24 matching lines...) Expand all
85 intent.addCategory(Intent.CATEGORY_LAUNCHER); 84 intent.addCategory(Intent.CATEGORY_LAUNCHER);
86 intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); 85 intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
87 intent.setData(Uri.parse(url)); 86 intent.setData(Uri.parse(url));
88 intent.setComponent(new ComponentName( 87 intent.setComponent(new ComponentName(
89 getInstrumentation().getTargetContext(), 88 getInstrumentation().getTargetContext(),
90 CronetSampleActivity.class)); 89 CronetSampleActivity.class));
91 setActivityIntent(intent); 90 setActivityIntent(intent);
92 return getActivity(); 91 return getActivity();
93 } 92 }
94 } 93 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698