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

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

Issue 10700167: Adds ContentShellTest.apk and very simple test. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: content/shell/android/javatests/src/org/chromium/content_shell/ContentShellTestBase.java
diff --git a/content/shell/android/javatests/src/org/chromium/content_shell/ContentShellTestBase.java b/content/shell/android/javatests/src/org/chromium/content_shell/ContentShellTestBase.java
new file mode 100644
index 0000000000000000000000000000000000000000..59a6f7de77f2aa3e3706a1cba51c6b2734ff0910
--- /dev/null
+++ b/content/shell/android/javatests/src/org/chromium/content_shell/ContentShellTestBase.java
@@ -0,0 +1,33 @@
+// Copyright (c) 2012 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.content_shell;
+
+import android.content.ComponentName;
+import android.content.Intent;
+import android.net.Uri;
+import android.test.ActivityInstrumentationTestCase2;
+
+/**
+ * Base test class for all ContentShell based tests.
+ */
+public class ContentShellTestBase extends ActivityInstrumentationTestCase2<ContentShellActivity> {
+
+ public ContentShellTestBase() {
+ super(ContentShellActivity.class);
+ }
+
+ /**
+ * Starts the ContentShell activity and loads the given URL.
+ */
+ protected ContentShellActivity launchContentShellWithUrl(String url) {
+ Intent intent = new Intent(Intent.ACTION_MAIN);
+ intent.addCategory(Intent.CATEGORY_LAUNCHER);
+ intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
+ intent.setData(Uri.parse(url));
+ intent.setComponent(new ComponentName(getInstrumentation().getTargetContext(),
+ ContentShellActivity.class));
+ return (ContentShellActivity) getInstrumentation().startActivitySync(intent);
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698