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

Unified Diff: android_webview/test/shell/src/org/chromium/android_webview/test/SecondBrowserProcess.java

Issue 2201783003: Add test to ensure shouldOverrideUrlLoading throws Java exception (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Reupload PS1 with similarity 40% to show JSUtils.java as moved file. Created 4 years, 4 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: android_webview/test/shell/src/org/chromium/android_webview/test/SecondBrowserProcess.java
diff --git a/android_webview/test/shell/src/org/chromium/android_webview/test/SecondBrowserProcess.java b/android_webview/test/shell/src/org/chromium/android_webview/test/SecondBrowserProcess.java
index eaf350f0e27be369a85266dae06368fb5e1fdcfc..dd3272ce2896a2a4605ebe3803c55388fd8865bc 100644
--- a/android_webview/test/shell/src/org/chromium/android_webview/test/SecondBrowserProcess.java
+++ b/android_webview/test/shell/src/org/chromium/android_webview/test/SecondBrowserProcess.java
@@ -5,6 +5,7 @@
package org.chromium.android_webview.test;
import android.app.Service;
+import android.content.Context;
import android.content.Intent;
import android.os.Binder;
import android.os.IBinder;
@@ -31,7 +32,7 @@ public class SecondBrowserProcess extends Service {
case CODE_START:
reply.writeNoException();
try {
- startBrowserProcess();
+ startBrowserProcess(SecondBrowserProcess.this);
reply.writeInt(Process.myPid());
} catch (Exception e) {
reply.writeInt(0);
@@ -53,11 +54,11 @@ public class SecondBrowserProcess extends Service {
}
@SuppressFBWarnings("DMI_HARDCODED_ABSOLUTE_FILENAME")
- private void startBrowserProcess() throws Exception {
+ static void startBrowserProcess(Context context) throws Exception {
boliu 2016/08/02 20:15:59 uhh, move this somewhere that appears more "shared
gsennton 2016/08/02 20:33:57 Sure, will do :)
gsennton 2016/09/06 15:26:08 Actually, IMO we shouldn't merge these services be
boliu 2016/09/07 18:32:40 Always optimize for code that's easy to understand
gsennton 2016/09/14 13:51:51 Yes, this - having a general-purpose Service as ba
CommandLine.initFromFile("/data/local/tmp/android-webview-command-line");
- AwResource.setResources(this.getResources());
+ AwResource.setResources(context.getResources());
AwResource.setConfigKeySystemUuidMapping(R.array.config_key_system_uuid_mapping);
- ContextUtils.initApplicationContext(getApplicationContext());
+ ContextUtils.initApplicationContext(context.getApplicationContext());
AwBrowserProcess.loadLibrary();
AwBrowserProcess.start();
}

Powered by Google App Engine
This is Rietveld 408576698