| Index: content/public/test/android/javatests/src/org/chromium/content/browser/test/util/TestWebContentsObserver.java
|
| diff --git a/content/public/test/android/javatests/src/org/chromium/content/browser/test/util/TestWebContentsObserver.java b/content/public/test/android/javatests/src/org/chromium/content/browser/test/util/TestWebContentsObserver.java
|
| index 1e25a92b0bb64f608a35f9c1db74710554e10856..5872be16b532956b5193e67848d217428efae5ce 100644
|
| --- a/content/public/test/android/javatests/src/org/chromium/content/browser/test/util/TestWebContentsObserver.java
|
| +++ b/content/public/test/android/javatests/src/org/chromium/content/browser/test/util/TestWebContentsObserver.java
|
| @@ -9,6 +9,7 @@ import org.chromium.content.browser.WebContentsObserverAndroid;
|
| import org.chromium.content.browser.test.util.TestCallbackHelperContainer.OnPageFinishedHelper;
|
| import org.chromium.content.browser.test.util.TestCallbackHelperContainer.OnPageStartedHelper;
|
| import org.chromium.content.browser.test.util.TestCallbackHelperContainer.OnReceivedErrorHelper;
|
| +import org.chromium.content_public.browser.WebContents;
|
|
|
| /**
|
| * The default WebContentsObserverAndroid used by ContentView tests. The below callbacks can be
|
| @@ -16,12 +17,17 @@ import org.chromium.content.browser.test.util.TestCallbackHelperContainer.OnRece
|
| */
|
| public class TestWebContentsObserver extends WebContentsObserverAndroid {
|
|
|
| - private OnPageStartedHelper mOnPageStartedHelper;
|
| - private OnPageFinishedHelper mOnPageFinishedHelper;
|
| - private OnReceivedErrorHelper mOnReceivedErrorHelper;
|
| + private final OnPageStartedHelper mOnPageStartedHelper;
|
| + private final OnPageFinishedHelper mOnPageFinishedHelper;
|
| + private final OnReceivedErrorHelper mOnReceivedErrorHelper;
|
|
|
| + // TODO(yfriedman): Switch everyone to use the WebContents constructor.
|
| public TestWebContentsObserver(ContentViewCore contentViewCore) {
|
| - super(contentViewCore);
|
| + this(contentViewCore.getWebContents());
|
| + }
|
| +
|
| + public TestWebContentsObserver(WebContents webContents) {
|
| + super(webContents);
|
| mOnPageStartedHelper = new OnPageStartedHelper();
|
| mOnPageFinishedHelper = new OnPageFinishedHelper();
|
| mOnReceivedErrorHelper = new OnReceivedErrorHelper();
|
|
|