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

Side by Side Diff: content/shell/android/javatests/src/org/chromium/content_shell/ContentShellTestBase.java

Issue 10911131: Upstream JavaBridge tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Adding back JavaBridge test files Created 8 years, 3 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 | Annotate | Revision Log
OLDNEW
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;
11 11
12 import org.chromium.content.browser.ContentView;
Yaron 2012/09/20 04:13:53 It doesn't seem like any of these new imports are
13 import org.chromium.content.browser.ContentViewClient;
14 import org.chromium.content.browser.LoadUrlParams;
15 import org.chromium.content.browser.test.TestContentViewClient;
16
17 import java.util.HashMap;
18 import java.util.Map;
19 import java.util.concurrent.TimeUnit;
20
12 /** 21 /**
13 * Base test class for all ContentShell based tests. 22 * Base test class for all ContentShell based tests.
14 */ 23 */
15 public class ContentShellTestBase extends ActivityInstrumentationTestCase2<Conte ntShellActivity> { 24 public class ContentShellTestBase extends ActivityInstrumentationTestCase2<Conte ntShellActivity> {
16 25
17 public ContentShellTestBase() { 26 public ContentShellTestBase() {
18 super(ContentShellActivity.class); 27 super(ContentShellActivity.class);
19 } 28 }
20 29
21 /** 30 /**
22 * Starts the ContentShell activity and loads the given URL. 31 * Starts the ContentShell activity and loads the given URL.
23 */ 32 */
24 protected ContentShellActivity launchContentShellWithUrl(String url) { 33 protected ContentShellActivity launchContentShellWithUrl(String url) {
25 Intent intent = new Intent(Intent.ACTION_MAIN); 34 Intent intent = new Intent(Intent.ACTION_MAIN);
26 intent.addCategory(Intent.CATEGORY_LAUNCHER); 35 intent.addCategory(Intent.CATEGORY_LAUNCHER);
27 intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); 36 intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
28 intent.setData(Uri.parse(url)); 37 intent.setData(Uri.parse(url));
29 intent.setComponent(new ComponentName(getInstrumentation().getTargetCont ext(), 38 intent.setComponent(new ComponentName(getInstrumentation().getTargetCont ext(),
30 ContentShellActivity.class)); 39 ContentShellActivity.class));
31 return (ContentShellActivity) getInstrumentation().startActivitySync(int ent); 40 setActivityIntent(intent);
41 return getActivity();
32 } 42 }
33 } 43 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698