1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 package org.chromium.content.browser.test.util;
7 import android.content.Context;
9 import org.chromium.content.browser.ContentViewClient;
10 import org.chromium.content.browser.test.util.TestCallbackHelperContainer.OnEvaluateJavaScriptResultHelper;
11 import org.chromium.content.browser.test.util.TestCallbackHelperContainer.OnStartContentIntentHelper;
14 * The default ContentViewClient used by ContentView tests.
16 * Tests that need to supply their own ContentViewClient should do that
17 * by extending this one.
19 public class TestContentViewClient extends ContentViewClient {
21 private OnEvaluateJavaScriptResultHelper mOnEvaluateJavaScriptResultHelper;
22 private OnStartContentIntentHelper mOnStartContentIntentHelper;
24 public TestContentViewClient() {
25 mOnEvaluateJavaScriptResultHelper = new OnEvaluateJavaScriptResultHelper();
26 mOnStartContentIntentHelper = new OnStartContentIntentHelper();
29 public OnEvaluateJavaScriptResultHelper getOnEvaluateJavaScriptResultHelper() {
30 return mOnEvaluateJavaScriptResultHelper;
33 public OnStartContentIntentHelper getOnStartContentIntentHelper() {
34 return mOnStartContentIntentHelper;
38 * ATTENTION!: When overriding the following method, be sure to call
39 * the corresponding method in the super class. Otherwise
40 * {@link CallbackHelper#waitForCallback()} methods will
45 public void onStartContentIntent(Context context, String contentUrl) {
46 mOnStartContentIntentHelper.notifyCalled(contentUrl);