summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortedchoc@chromium.org <tedchoc@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-07 04:53:26 +0000
committertedchoc@chromium.org <tedchoc@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-07 04:53:26 +0000
commit6ea9b656cd9aeedcf6537509d781dec47efb298f (patch)
tree6c52c210728aca5ede9d0c07cc4d1e2aead09cab
parent90cb1cd285be64f7df5abd68dd867dc8eb0ccb01 (diff)
downloadchromium_src-6ea9b656cd9aeedcf6537509d781dec47efb298f.zip
chromium_src-6ea9b656cd9aeedcf6537509d781dec47efb298f.tar.gz
chromium_src-6ea9b656cd9aeedcf6537509d781dec47efb298f.tar.bz2
Fix adb_run_content_shell to correctly pass URL.
Also fixes testshell to support launching with a URL and triggering new intents (and fixes it's adb_run_chromium_testshell. BUG=159602 Review URL: https://chromiumcodereview.appspot.com/11377011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@166357 0039d316-1c4b-4281-b951-d872f2087c98
-rwxr-xr-xbuild/android/adb_run_chromium_testshell2
-rwxr-xr-xbuild/android/adb_run_content_shell2
-rw-r--r--chrome/android/testshell/java/AndroidManifest.xml1
-rw-r--r--chrome/android/testshell/java/src/org/chromium/chrome/testshell/ChromiumTestShellActivity.java4
-rw-r--r--chrome/android/testshell/java/src/org/chromium/chrome/testshell/TabManager.java11
5 files changed, 17 insertions, 3 deletions
diff --git a/build/android/adb_run_chromium_testshell b/build/android/adb_run_chromium_testshell
index 7829a76..b17482c 100755
--- a/build/android/adb_run_chromium_testshell
+++ b/build/android/adb_run_chromium_testshell
@@ -5,7 +5,7 @@
# found in the LICENSE file.
if [ $# -gt 0 ] ; then
- INTENT_ARGS='-d "$1"' # e.g. a URL
+ INTENT_ARGS="-d \"$1\"" # e.g. a URL
fi
adb shell am start \
diff --git a/build/android/adb_run_content_shell b/build/android/adb_run_content_shell
index bfc7367..ea92f5a 100755
--- a/build/android/adb_run_content_shell
+++ b/build/android/adb_run_content_shell
@@ -5,7 +5,7 @@
# found in the LICENSE file.
if [ $# -gt 0 ] ; then
- INTENT_ARGS='-d "$1"' # e.g. a URL
+ INTENT_ARGS="-d \"$1\"" # e.g. a URL
fi
adb shell am start \
diff --git a/chrome/android/testshell/java/AndroidManifest.xml b/chrome/android/testshell/java/AndroidManifest.xml
index 8990f3a..2806af9 100644
--- a/chrome/android/testshell/java/AndroidManifest.xml
+++ b/chrome/android/testshell/java/AndroidManifest.xml
@@ -16,6 +16,7 @@
android:label="ChromiumTestShell">
<activity android:name="org.chromium.chrome.testshell.ChromiumTestShellActivity"
android:label="ChromiumTestShellActivity"
+ android:launchMode="singleTask"
android:hardwareAccelerated="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
diff --git a/chrome/android/testshell/java/src/org/chromium/chrome/testshell/ChromiumTestShellActivity.java b/chrome/android/testshell/java/src/org/chromium/chrome/testshell/ChromiumTestShellActivity.java
index 489dc77..ede99c1 100644
--- a/chrome/android/testshell/java/src/org/chromium/chrome/testshell/ChromiumTestShellActivity.java
+++ b/chrome/android/testshell/java/src/org/chromium/chrome/testshell/ChromiumTestShellActivity.java
@@ -46,6 +46,10 @@ public class ChromiumTestShellActivity extends Activity {
setContentView(R.layout.testshell_activity);
mTabManager = (TabManager) findViewById(R.id.tab_manager);
+ String startupUrl = getUrlFromIntent(getIntent());
+ if (!TextUtils.isEmpty(startupUrl)) {
+ mTabManager.setStartupUrl(startupUrl);
+ }
mWindow = new ActivityNativeWindow(this);
mWindow.restoreInstanceState(savedInstanceState);
diff --git a/chrome/android/testshell/java/src/org/chromium/chrome/testshell/TabManager.java b/chrome/android/testshell/java/src/org/chromium/chrome/testshell/TabManager.java
index f072a6d..649b40f 100644
--- a/chrome/android/testshell/java/src/org/chromium/chrome/testshell/TabManager.java
+++ b/chrome/android/testshell/java/src/org/chromium/chrome/testshell/TabManager.java
@@ -35,6 +35,8 @@ public class TabManager extends LinearLayout {
private TabBase mCurrentTab;
+ private String mStartupUrl = DEFAULT_URL;
+
/**
* @param context The Context the view is running in.
* @param attrs The attributes of the XML tag that is inflating the view.
@@ -61,7 +63,7 @@ public class TabManager extends LinearLayout {
public void surfaceCreated(SurfaceHolder holder) {
nativeSurfaceCreated(holder.getSurface());
- if (mCurrentTab == null) createTab(DEFAULT_URL);
+ if (mCurrentTab == null) createTab(mStartupUrl);
}
@Override
@@ -79,6 +81,13 @@ public class TabManager extends LinearLayout {
}
/**
+ * @param startupUrl The URL that the first tab should navigate to.
+ */
+ public void setStartupUrl(String startupUrl) {
+ mStartupUrl = startupUrl;
+ }
+
+ /**
* @return The currently visible {@link TabBase}.
*/
public TabBase getCurrentTab() {