OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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.content_shell; | 5 package org.chromium.content_shell; |
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.test.ActivityInstrumentationTestCase2; | 10 import android.test.ActivityInstrumentationTestCase2; |
(...skipping 10 matching lines...) Expand all Loading... |
21 /** | 21 /** |
22 * Starts the ContentShell activity and loads the given URL. | 22 * Starts the ContentShell activity and loads the given URL. |
23 */ | 23 */ |
24 protected ContentShellActivity launchContentShellWithUrl(String url) { | 24 protected ContentShellActivity launchContentShellWithUrl(String url) { |
25 Intent intent = new Intent(Intent.ACTION_MAIN); | 25 Intent intent = new Intent(Intent.ACTION_MAIN); |
26 intent.addCategory(Intent.CATEGORY_LAUNCHER); | 26 intent.addCategory(Intent.CATEGORY_LAUNCHER); |
27 intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); | 27 intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); |
28 intent.setData(Uri.parse(url)); | 28 intent.setData(Uri.parse(url)); |
29 intent.setComponent(new ComponentName(getInstrumentation().getTargetCont
ext(), | 29 intent.setComponent(new ComponentName(getInstrumentation().getTargetCont
ext(), |
30 ContentShellActivity.class)); | 30 ContentShellActivity.class)); |
31 return (ContentShellActivity) getInstrumentation().startActivitySync(int
ent); | 31 setActivityIntent(intent); |
| 32 return getActivity(); |
32 } | 33 } |
33 } | 34 } |
OLD | NEW |