| 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.content.ComponentName; |
| 8 import android.content.Intent; |
| 9 import android.net.Uri; |
| 10 import android.test.ActivityInstrumentationTestCase2; |
| 11 |
| 12 /** |
| 13 * Base test class for all ContentShell based tests. |
| 14 */ |
| 15 public class ContentShellTestBase extends ActivityInstrumentationTestCase2<Conte
ntShellActivity> { |
| 16 |
| 17 public ContentShellTestBase() { |
| 18 super(ContentShellActivity.class); |
| 19 } |
| 20 |
| 21 /** |
| 22 * Starts the ContentShell activity and loads the given URL. |
| 23 */ |
| 24 protected ContentShellActivity launchContentShellWithUrl(String url) { |
| 25 Intent intent = new Intent(Intent.ACTION_MAIN); |
| 26 intent.addCategory(Intent.CATEGORY_LAUNCHER); |
| 27 intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); |
| 28 intent.setData(Uri.parse(url)); |
| 29 intent.setComponent(new ComponentName(getInstrumentation().getTargetCont
ext(), |
| 30 ContentShellActivity.class)); |
| 31 return (ContentShellActivity) getInstrumentation().startActivitySync(int
ent); |
| 32 } |
| 33 } |
| OLD | NEW |