Chromium Code Reviews| Index: components/cronet/android/test/javatests/src/org/chromium/cronet_test_apk/CronetTestBase.java |
| diff --git a/components/cronet/android/test/javatests/src/org/chromium/cronet_test_apk/CronetTestBase.java b/components/cronet/android/test/javatests/src/org/chromium/cronet_test_apk/CronetTestBase.java |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..b59aa893d4b5201e9b94c1484899c51f9439db2d |
| --- /dev/null |
| +++ b/components/cronet/android/test/javatests/src/org/chromium/cronet_test_apk/CronetTestBase.java |
| @@ -0,0 +1,34 @@ |
| +// Copyright 2014 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +package org.chromium.cronet_test_apk; |
| + |
| +import android.content.ComponentName; |
| +import android.content.Intent; |
| +import android.test.ActivityInstrumentationTestCase2; |
| + |
| +/** |
| + * Base test class for all CronetTest based tests. |
| + */ |
| +public class CronetTestBase extends |
| + ActivityInstrumentationTestCase2<CronetTestActivity> { |
| + |
|
mmenke
2014/09/03 18:02:34
nit: I don't believe blank lines are generally us
|
| + public CronetTestBase() { |
| + super(CronetTestActivity.class); |
| + } |
| + |
| + /** |
| + * Starts the CronetTest activity |
| + */ |
| + protected CronetTestActivity launchCronetTestApp() { |
| + Intent intent = new Intent(Intent.ACTION_MAIN); |
| + intent.addCategory(Intent.CATEGORY_LAUNCHER); |
| + intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); |
| + intent.setComponent(new ComponentName( |
| + getInstrumentation().getTargetContext(), |
| + CronetTestActivity.class)); |
| + setActivityIntent(intent); |
| + return getActivity(); |
| + } |
| +} |