Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 package org.chromium.content_shell; | |
| 6 | |
| 7 import android.app.Activity; | |
| 8 import android.content.ComponentName; | |
| 9 import android.content.Intent; | |
| 10 import android.net.Uri; | |
| 11 import android.test.ActivityInstrumentationTestCase2; | |
| 12 | |
| 13 /** | |
| 14 * Base test class for all ContentShell based tests. | |
| 15 */ | |
| 16 public class ContentShellTestBase<T extends Activity> extends ActivityInstrument ationTestCase2<T> { | |
|
Ted C
2012/07/11 22:28:28
why do we need to templatize this base activity?
cjhopman
2012/07/12 18:13:08
Done. I don't know why this was templatized, but I
| |
| 17 | |
| 18 public ContentShellTestBase(Class<T> activityClass) { | |
| 19 super(activityClass); | |
| 20 } | |
| 21 | |
| 22 /** | |
| 23 * Starts the ContentShell activity and loads the given URL. | |
| 24 */ | |
| 25 protected Activity launchContentShellWithUrl(String url) { | |
|
Ted C
2012/07/11 22:28:28
Might as well just return ContentShellActivity sin
cjhopman
2012/07/12 18:13:08
Done.
| |
| 26 Intent intent = new Intent(Intent.ACTION_MAIN); | |
| 27 intent.addCategory(Intent.CATEGORY_LAUNCHER); | |
| 28 intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); | |
| 29 intent.setData(Uri.parse(url)); | |
| 30 intent.setComponent(new ComponentName(getInstrumentation().getTargetCont ext(), | |
| 31 org.chromium.content_shell.ContentShellActivity.class)); | |
| 32 return getInstrumentation().startActivitySync(intent); | |
| 33 } | |
| 34 | |
| 35 } | |
| OLD | NEW |