Skip to content
This repository has been archived by the owner on Apr 3, 2020. It is now read-only.

Commit

Permalink
[Android WebView] Do not terminate WebView when second browser is sta…
Browse files Browse the repository at this point in the history
…rted

Still detect the situation when the app is creating WebView from two
processes sharing the same data dir, but do not throw a RuntimeError,
only print a warning.

BUG=558377,582146

Review URL: https://codereview.chromium.org/1641383002

Cr-Commit-Position: refs/heads/master@{#372231}
(cherry picked from commit d881bd2)

Review URL: https://codereview.chromium.org/1650433003 .

Cr-Commit-Position: refs/branch-heads/2623@{#185}
Cr-Branched-From: 92d7753-refs/heads/master@{#369907}
  • Loading branch information
Mikhail Naganov committed Jan 29, 2016
1 parent 6d5e292 commit 8beab57
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,8 @@ private static void tryObtainingDataDirLockOrDie(Context context) {
Log.w(TAG, "Failed to create lock file " + lockFile, e);
}
if (!success) {
throw new RuntimeException(
"Could not obtain an exclusive lock on the data dir. The app may have "
+ "another WebView opened in a separate process");
Log.w(TAG, "The app may have another WebView opened in a separate process. "
+ "This is not recommended and may stop working in future versions.");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,9 @@
import android.os.Parcel;
import android.os.Process;
import android.os.RemoteException;
import android.test.suitebuilder.annotation.LargeTest;

import org.chromium.android_webview.AwBrowserProcess;
import org.chromium.base.test.util.Feature;
import org.chromium.base.test.util.DisabledTest;

import java.util.concurrent.Callable;
import java.util.concurrent.CountDownLatch;
Expand All @@ -42,15 +41,24 @@ protected void tearDown() throws Exception {
super.tearDown();
}

@LargeTest
@Feature({"AndroidWebView"})
/*
* @LargeTest
* @Feature({"AndroidWebView"})
* See crbug.com/582146. We can't test that creating second browser
* process succeeds either, because in debug it will crash due to an assert
* in the SQL DB code.
*/
@DisabledTest
public void testCreatingSecondBrowserProcessFails() throws Throwable {
startSecondBrowserProcess();
assertFalse(tryStartingBrowserProcess());
}

@LargeTest
@Feature({"AndroidWebView"})
/*
* @LargeTest
* @Feature({"AndroidWebView"})
*/
@DisabledTest
public void testLockCleanupOnProcessShutdown() throws Throwable {
startSecondBrowserProcess();
assertFalse(tryStartingBrowserProcess());
Expand Down

0 comments on commit 8beab57

Please sign in to comment.