Remove some dependencies on ContentView.

Turns out that https://chromiumcodereview.appspot.com/11788005 made it
such that blocking for JavaScript doesn't require ContentViewClient,
just a ContentViewCore. Many places in tests still get the ContentView
in order to create a TestCallbackHelperContainer in order to wait for
JavaScript to execute...

Instead for clients that don't care about waiting themselves for JS to
execute, just do it inside JavaScriptUtils.

BUG=360644

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@262929 0039d316-1c4b-4281-b951-d872f2087c98
parent 6c16ef3d
......@@ -17,7 +17,6 @@ import org.chromium.content.browser.ContentViewCore;
import org.chromium.content.browser.test.util.Criteria;
import org.chromium.content.browser.test.util.CriteriaHelper;
import org.chromium.content.browser.test.util.DOMUtils;
import org.chromium.content.browser.test.util.TestCallbackHelperContainer;
import java.util.concurrent.TimeoutException;
......@@ -466,10 +465,9 @@ public class AutofillDialogControllerTest extends ChromeShellTestBase {
setUpAndRequestAutocomplete(url, requestFullBilling, requestShipping, requestPhoneNumbers);
ContentView view = getActivity().getActiveContentView();
final TestCallbackHelperContainer viewClient = new TestCallbackHelperContainer(view);
assertEquals(actualId + " did not match",
expected, DOMUtils.getNodeValue(view.getContentViewCore(), viewClient, actualId));
expected, DOMUtils.getNodeValue(view.getContentViewCore(), actualId));
}
private void verifyFieldsAreFilled(final boolean requestFullBilling,
......@@ -481,88 +479,87 @@ public class AutofillDialogControllerTest extends ChromeShellTestBase {
final ContentView view = getActivity().getActiveContentView();
final ContentViewCore viewCore = view.getContentViewCore();
final TestCallbackHelperContainer viewClient = new TestCallbackHelperContainer(view);
assertEquals("billing name did not match",
TEST_NAME, DOMUtils.getNodeValue(viewCore, viewClient, "id-billing-name"));
TEST_NAME, DOMUtils.getNodeValue(viewCore, "id-billing-name"));
assertEquals("email did not match",
TEST_EMAIL, DOMUtils.getNodeValue(viewCore, viewClient, "id-email"));
TEST_EMAIL, DOMUtils.getNodeValue(viewCore, "id-email"));
assertEquals("cc-name did not match",
TEST_NAME, DOMUtils.getNodeValue(viewCore, viewClient, "id-cc-name"));
TEST_NAME, DOMUtils.getNodeValue(viewCore, "id-cc-name"));
assertEquals("cc-number did not match",
TEST_CC_NUMBER, DOMUtils.getNodeValue(viewCore, viewClient, "id-cc-number"));
TEST_CC_NUMBER, DOMUtils.getNodeValue(viewCore, "id-cc-number"));
assertEquals("cc-csc did not match",
TEST_CC_CSC, DOMUtils.getNodeValue(viewCore, viewClient, "id-cc-csc"));
TEST_CC_CSC, DOMUtils.getNodeValue(viewCore, "id-cc-csc"));
assertEquals("cc-csc did not match",
TEST_CC_CSC, DOMUtils.getNodeValue(viewCore, viewClient, "id-cc-csc"));
TEST_CC_CSC, DOMUtils.getNodeValue(viewCore, "id-cc-csc"));
assertEquals("cc-exp did not match",
"" + TEST_CC_EXP_YEAR + "-" + TEST_CC_EXP_MONTH,
DOMUtils.getNodeValue(viewCore, viewClient, "id-cc-exp"));
DOMUtils.getNodeValue(viewCore, "id-cc-exp"));
assertEquals("cc-exp-month did not match",
"" + TEST_CC_EXP_MONTH,
DOMUtils.getNodeValue(viewCore, viewClient, "id-cc-exp-month"));
DOMUtils.getNodeValue(viewCore, "id-cc-exp-month"));
assertEquals("cc-exp-year did not match",
"" + TEST_CC_EXP_YEAR,
DOMUtils.getNodeValue(viewCore, viewClient, "id-cc-exp-year"));
DOMUtils.getNodeValue(viewCore, "id-cc-exp-year"));
assertEquals("billing country did not match",
TEST_BILLING_COUNTRY, DOMUtils.getNodeValue(viewCore, viewClient, "id-cc-country"));
TEST_BILLING_COUNTRY, DOMUtils.getNodeValue(viewCore, "id-cc-country"));
assertEquals("billing postal-code did not match",
TEST_BILLING_ZIP, DOMUtils.getNodeValue(viewCore, viewClient, "id-cc-zip"));
TEST_BILLING_ZIP, DOMUtils.getNodeValue(viewCore, "id-cc-zip"));
if (requestFullBilling) {
assertEquals("billing address-line1 did not match",
TEST_BILLING1, DOMUtils.getNodeValue(viewCore, viewClient, "id-cc-1"));
TEST_BILLING1, DOMUtils.getNodeValue(viewCore, "id-cc-1"));
assertEquals("billing address-line2 did not match",
TEST_BILLING2, DOMUtils.getNodeValue(viewCore, viewClient, "id-cc-2"));
TEST_BILLING2, DOMUtils.getNodeValue(viewCore, "id-cc-2"));
assertEquals("billing locality did not match",
TEST_BILLING_CITY, DOMUtils.getNodeValue(viewCore, viewClient, "id-cc-city"));
TEST_BILLING_CITY, DOMUtils.getNodeValue(viewCore, "id-cc-city"));
assertEquals("billing region did not match",
TEST_BILLING_STATE, DOMUtils.getNodeValue(viewCore, viewClient, "id-cc-state"));
TEST_BILLING_STATE, DOMUtils.getNodeValue(viewCore, "id-cc-state"));
if (requestPhoneNumbers) {
assertEquals("billing tel did not match",
TEST_PHONE_UNFORMATTED,
DOMUtils.getNodeValue(viewCore, viewClient, "id-cc-tel"));
DOMUtils.getNodeValue(viewCore, "id-cc-tel"));
}
}
if (requestShipping) {
assertEquals("shipping name did not match",
TEST_SHIPPING_NAME, DOMUtils.getNodeValue(viewCore, viewClient, "id-h-name"));
TEST_SHIPPING_NAME, DOMUtils.getNodeValue(viewCore, "id-h-name"));
assertEquals("shipping postal-code did not match",
TEST_SHIPPING_ZIP, DOMUtils.getNodeValue(viewCore, viewClient, "id-h-zip"));
TEST_SHIPPING_ZIP, DOMUtils.getNodeValue(viewCore, "id-h-zip"));
assertEquals("shipping address-line1 did not match",
TEST_SHIPPING1, DOMUtils.getNodeValue(viewCore, viewClient, "id-h-1"));
TEST_SHIPPING1, DOMUtils.getNodeValue(viewCore, "id-h-1"));
assertEquals("shipping address-line2 did not match",
TEST_SHIPPING2, DOMUtils.getNodeValue(viewCore, viewClient, "id-h-2"));
TEST_SHIPPING2, DOMUtils.getNodeValue(viewCore, "id-h-2"));
assertEquals("shipping locality did not match",
TEST_SHIPPING_CITY, DOMUtils.getNodeValue(viewCore, viewClient, "id-h-city"));
TEST_SHIPPING_CITY, DOMUtils.getNodeValue(viewCore, "id-h-city"));
assertEquals("shipping region did not match",
TEST_SHIPPING_STATE, DOMUtils.getNodeValue(viewCore, viewClient, "id-h-state"));
TEST_SHIPPING_STATE, DOMUtils.getNodeValue(viewCore, "id-h-state"));
assertEquals("shipping country did not match",
TEST_SHIPPING_COUNTRY,
DOMUtils.getNodeValue(viewCore, viewClient, "id-h-country"));
DOMUtils.getNodeValue(viewCore, "id-h-country"));
// It is currently unspecified whether autocomplete="name" gives a SHIPPING or
// a BILLING name. I'm assuming here that this is a shipping name.
assertEquals("name did not match",
TEST_SHIPPING_NAME, DOMUtils.getNodeValue(viewCore, viewClient, "id-name"));
TEST_SHIPPING_NAME, DOMUtils.getNodeValue(viewCore, "id-name"));
if (requestPhoneNumbers) {
assertEquals("shipping tel did not match",
TEST_SHIPPING_PHONE_UNFORMATTED,
DOMUtils.getNodeValue(viewCore, viewClient, "id-h-tel"));
DOMUtils.getNodeValue(viewCore, "id-h-tel"));
// It is currently unspecified whether autocomplete="name" gives a SHIPPING or
// a BILLING phone. I'm assuming here that this is a shipping phone.
assertEquals("tel did not match",
TEST_SHIPPING_PHONE_UNFORMATTED,
DOMUtils.getNodeValue(viewCore, viewClient, "id-tel"));
DOMUtils.getNodeValue(viewCore, "id-tel"));
}
}
}
......@@ -578,7 +575,6 @@ public class AutofillDialogControllerTest extends ChromeShellTestBase {
assertTrue(waitForActiveShellToBeDoneLoading());
final ContentView view = getActivity().getActiveContentView();
final TestCallbackHelperContainer viewClient = new TestCallbackHelperContainer(view);
AutofillDialogResult.ResultWallet result = new AutofillDialogResult.ResultWallet(
TEST_EMAIL, "Google Transaction ID",
......@@ -599,16 +595,15 @@ public class AutofillDialogControllerTest extends ChromeShellTestBase {
true, "", "", "", "",
requestFullBilling, requestShipping, requestPhoneNumbers);
DOMUtils.clickNode(this, view, viewClient, "id-button");
waitForInputFieldFill(view.getContentViewCore(), viewClient);
DOMUtils.clickNode(this, view, "id-button");
waitForInputFieldFill(view.getContentViewCore());
assertEquals("requestAutocomplete failed",
"succeeded", DOMUtils.getNodeContents(
view.getContentViewCore(), viewClient, "was-autocompleted"));
view.getContentViewCore(), "was-autocompleted"));
}
private void waitForInputFieldFill(final ContentViewCore viewCore,
final TestCallbackHelperContainer viewClient) throws InterruptedException {
private void waitForInputFieldFill(final ContentViewCore viewCore) throws InterruptedException {
assertTrue("requestAutocomplete() never completed.",
CriteriaHelper.pollForCriteria(new Criteria() {
@Override
......@@ -616,7 +611,7 @@ public class AutofillDialogControllerTest extends ChromeShellTestBase {
String wasAutocompleted;
try {
wasAutocompleted = DOMUtils.getNodeContents(
viewCore, viewClient, "was-autocompleted");
viewCore, "was-autocompleted");
} catch (InterruptedException e) {
return false;
} catch (TimeoutException e) {
......
......@@ -19,7 +19,6 @@ import org.chromium.content.browser.ContentViewCore;
import org.chromium.content.browser.test.util.Criteria;
import org.chromium.content.browser.test.util.CriteriaHelper;
import org.chromium.content.browser.test.util.DOMUtils;
import org.chromium.content.browser.test.util.TestCallbackHelperContainer;
import org.chromium.content.browser.test.util.TestInputMethodManagerWrapper;
import org.chromium.content.browser.test.util.TouchCommon;
import org.chromium.ui.autofill.AutofillPopup;
......@@ -127,7 +126,7 @@ public class AutofillPopupTest extends ChromeShellTestBase {
);
}
private TestCallbackHelperContainer loadAndFillForm(
private void loadAndFillForm(
final String formDataUrl, final String inputText)
throws InterruptedException, ExecutionException, TimeoutException {
launchChromeShellWithUrl(formDataUrl);
......@@ -150,9 +149,8 @@ public class AutofillPopupTest extends ChromeShellTestBase {
assertEquals(1, mHelper.getNumberOfProfiles());
// Click the input field for the first name.
final TestCallbackHelperContainer viewClient = new TestCallbackHelperContainer(view);
assertTrue(DOMUtils.waitForNonZeroNodeBounds(viewCore, viewClient, "fn"));
DOMUtils.clickNode(this, view, viewClient, "fn");
assertTrue(DOMUtils.waitForNonZeroNodeBounds(viewCore, "fn"));
DOMUtils.clickNode(this, view, "fn");
waitForKeyboardShowRequest(immw, 1);
......@@ -175,9 +173,7 @@ public class AutofillPopupTest extends ChromeShellTestBase {
TouchCommon touchCommon = new TouchCommon(this);
touchCommon.singleClickViewRelative(popup.getListView(), 10, 10);
waitForInputFieldFill(viewCore, viewClient);
return viewClient;
waitForInputFieldFill(viewCore);
}
/**
......@@ -188,27 +184,27 @@ public class AutofillPopupTest extends ChromeShellTestBase {
@Feature({"autofill"})
public void testClickAutofillPopupSuggestion()
throws InterruptedException, ExecutionException, TimeoutException {
TestCallbackHelperContainer viewClient = loadAndFillForm(BASIC_PAGE_DATA, "J");
loadAndFillForm(BASIC_PAGE_DATA, "J");
final ContentViewCore viewCore = getActivity().getActiveContentView().getContentViewCore();
assertEquals("First name did not match",
FIRST_NAME, DOMUtils.getNodeValue(viewCore, viewClient, "fn"));
FIRST_NAME, DOMUtils.getNodeValue(viewCore, "fn"));
assertEquals("Last name did not match",
LAST_NAME, DOMUtils.getNodeValue(viewCore, viewClient, "ln"));
LAST_NAME, DOMUtils.getNodeValue(viewCore, "ln"));
assertEquals("Address line 1 did not match",
ADDRESS_LINE1, DOMUtils.getNodeValue(viewCore, viewClient, "a1"));
ADDRESS_LINE1, DOMUtils.getNodeValue(viewCore, "a1"));
assertEquals("Address line 2 did not match",
ADDRESS_LINE2, DOMUtils.getNodeValue(viewCore, viewClient, "a2"));
ADDRESS_LINE2, DOMUtils.getNodeValue(viewCore, "a2"));
assertEquals("City did not match",
CITY, DOMUtils.getNodeValue(viewCore, viewClient, "ct"));
CITY, DOMUtils.getNodeValue(viewCore, "ct"));
assertEquals("Zip code did not match",
ZIP_CODE, DOMUtils.getNodeValue(viewCore, viewClient, "zc"));
ZIP_CODE, DOMUtils.getNodeValue(viewCore, "zc"));
assertEquals("Country did not match",
COUNTRY, DOMUtils.getNodeValue(viewCore, viewClient, "co"));
COUNTRY, DOMUtils.getNodeValue(viewCore, "co"));
assertEquals("Email did not match",
EMAIL, DOMUtils.getNodeValue(viewCore, viewClient, "em"));
EMAIL, DOMUtils.getNodeValue(viewCore, "em"));
assertEquals("Phone number did not match",
PHONE_NUMBER, DOMUtils.getNodeValue(viewCore, viewClient, "ph"));
PHONE_NUMBER, DOMUtils.getNodeValue(viewCore, "ph"));
final String profileFullName = FIRST_NAME + " " + LAST_NAME;
final int loggedEntries = 9;
......@@ -314,15 +310,14 @@ public class AutofillPopupTest extends ChromeShellTestBase {
}));
}
private void waitForInputFieldFill(final ContentViewCore viewCore,
final TestCallbackHelperContainer viewClient) throws InterruptedException {
private void waitForInputFieldFill(final ContentViewCore viewCore) throws InterruptedException {
assertTrue("First name field was never filled.",
CriteriaHelper.pollForCriteria(new Criteria() {
@Override
public boolean isSatisfied() {
try {
return TextUtils.equals(FIRST_NAME,
DOMUtils.getNodeValue(viewCore, viewClient, "fn"));
DOMUtils.getNodeValue(viewCore, "fn"));
} catch (InterruptedException e) {
return false;
} catch (TimeoutException e) {
......
......@@ -18,7 +18,6 @@ import org.chromium.content.browser.ContentView;
import org.chromium.content.browser.test.util.Criteria;
import org.chromium.content.browser.test.util.CriteriaHelper;
import org.chromium.content.browser.test.util.DOMUtils;
import org.chromium.content.browser.test.util.TestCallbackHelperContainer;
import org.chromium.content.browser.test.util.UiUtils;
import org.chromium.ui.base.ActivityWindowAndroid;
......@@ -37,7 +36,6 @@ public class SelectFileDialogTest extends ChromeShellTestBase {
"</body></html>");
private ContentView mContentView;
private TestCallbackHelperContainer mCallbackContainer;
private ActivityWindowAndroidForTest mActivityWindowAndroidForTest;
private static class ActivityWindowAndroidForTest extends ActivityWindowAndroid {
......@@ -80,12 +78,11 @@ public class SelectFileDialogTest extends ChromeShellTestBase {
assertTrue("Page failed to load", waitForActiveShellToBeDoneLoading());
mContentView = getActivity().getActiveContentView();
mCallbackContainer = new TestCallbackHelperContainer(mContentView);
// TODO(aurimas) remove this wait once crbug.com/179511 is fixed.
assertWaitForPageScaleFactorMatch(2);
assertTrue(
DOMUtils.waitForNonZeroNodeBounds(mContentView.getContentViewCore(),
mCallbackContainer, "input_file"));
"input_file"));
}
/**
......@@ -94,20 +91,20 @@ public class SelectFileDialogTest extends ChromeShellTestBase {
@MediumTest
@Feature({"TextInput", "Main"})
public void testSelectFileAndCancelRequest() throws Throwable {
DOMUtils.clickNode(this, mContentView, mCallbackContainer, "input_file");
DOMUtils.clickNode(this, mContentView, "input_file");
assertTrue("SelectFileDialog never sent an intent.",
CriteriaHelper.pollForCriteria(new IntentSentCriteria()));
assertEquals(Intent.ACTION_CHOOSER, mActivityWindowAndroidForTest.lastIntent.getAction());
resetActivityWindowAndroidForTest();
DOMUtils.clickNode(this, mContentView, mCallbackContainer, "input_image");
DOMUtils.clickNode(this, mContentView, "input_image");
assertTrue("SelectFileDialog never sent an intent.",
CriteriaHelper.pollForCriteria(new IntentSentCriteria()));
assertEquals(MediaStore.ACTION_IMAGE_CAPTURE,
mActivityWindowAndroidForTest.lastIntent.getAction());
resetActivityWindowAndroidForTest();
DOMUtils.clickNode(this, mContentView, mCallbackContainer, "input_audio");
DOMUtils.clickNode(this, mContentView, "input_audio");
assertTrue("SelectFileDialog never sent an intent.",
CriteriaHelper.pollForCriteria(new IntentSentCriteria()));
assertEquals(MediaStore.Audio.Media.RECORD_SOUND_ACTION,
......
......@@ -12,7 +12,6 @@ import org.chromium.content.browser.ContentView;
import org.chromium.content.browser.test.util.Criteria;
import org.chromium.content.browser.test.util.CriteriaHelper;
import org.chromium.content.browser.test.util.DOMUtils;
import org.chromium.content.browser.test.util.TestCallbackHelperContainer;
import org.chromium.content.browser.test.util.UiUtils;
import org.chromium.ui.base.ActivityWindowAndroid;
import org.chromium.ui.base.WindowAndroid;
......@@ -59,11 +58,9 @@ public class SelectPopupOtherContentViewTest extends ChromeShellTestBase {
assertTrue("Page failed to load", waitForActiveShellToBeDoneLoading());
final ContentView view = getActivity().getActiveContentView();
final TestCallbackHelperContainer viewClient =
new TestCallbackHelperContainer(view);
// Once clicked, the popup should show up.
DOMUtils.clickNode(this, view, viewClient, "select");
DOMUtils.clickNode(this, view, "select");
assertTrue("The select popup did not show up on click.",
CriteriaHelper.pollForCriteria(new PopupShowingCriteria()));
......
......@@ -22,7 +22,6 @@ import org.chromium.content.browser.ContentViewCore;
import org.chromium.content.browser.test.util.Criteria;
import org.chromium.content.browser.test.util.CriteriaHelper;
import org.chromium.content.browser.test.util.JavaScriptUtils;
import org.chromium.content.browser.test.util.TestCallbackHelperContainer;
import org.chromium.sync.notifier.SyncStatusHelper;
import org.chromium.sync.signin.AccountManagerHelper;
import org.chromium.sync.signin.ChromeSigninController;
......@@ -115,10 +114,8 @@ public class SyncTest extends ChromeShellTestBase {
final ContentViewCore contentViewCore = getContentViewCore(getActivity());
String innerHtml = "";
try {
final TestCallbackHelperContainer.OnEvaluateJavaScriptResultHelper helper =
new TestCallbackHelperContainer.OnEvaluateJavaScriptResultHelper();
innerHtml = JavaScriptUtils.executeJavaScriptAndWaitForResult(
contentViewCore, helper, "document.documentElement.innerHTML");
contentViewCore, "document.documentElement.innerHTML");
} catch (InterruptedException e) {
Log.w(TAG, "Interrupted while polling about:sync page for sync status.", e);
} catch (TimeoutException e) {
......
......@@ -306,9 +306,7 @@ public class ModalDialogTest extends ChromeShellTestBase {
*/
private OnEvaluateJavaScriptResultHelper executeJavaScriptAndWaitForDialog(String script)
throws InterruptedException {
final OnEvaluateJavaScriptResultHelper helper =
getActiveTabTestCallbackHelperContainer().getOnEvaluateJavaScriptResultHelper();
return executeJavaScriptAndWaitForDialog(helper, script);
return executeJavaScriptAndWaitForDialog(new OnEvaluateJavaScriptResultHelper(), script);
}
/**
......
......@@ -44,7 +44,7 @@ public class ContextMenuUtils {
client.getOnContextMenuShownHelper();
int callCount = helper.getCallCount();
DOMUtils.longPressNode(testCase, tab.getContentView(), client, openerDOMNodeId);
DOMUtils.longPressNode(testCase, tab.getContentView(), openerDOMNodeId);
helper.waitForCallback(callCount);
return helper.getContextMenu();
......
......@@ -66,8 +66,8 @@ public class ContentDetectionTestBase extends ContentShellTestBase {
callbackHelperContainer.getOnStartContentIntentHelper();
int currentCallCount = onStartContentIntentHelper.getCallCount();
DOMUtils.scrollNodeIntoView(getContentViewCore(), callbackHelperContainer, id);
DOMUtils.clickNode(this, getContentView(), callbackHelperContainer, id);
DOMUtils.scrollNodeIntoView(getContentViewCore(), id);
DOMUtils.clickNode(this, getContentView(), id);
onStartContentIntentHelper.waitForCallback(currentCallCount, 1, WAIT_TIMEOUT_SECONDS,
TimeUnit.SECONDS);
......@@ -87,8 +87,8 @@ public class ContentDetectionTestBase extends ContentShellTestBase {
callbackHelperContainer.getOnPageFinishedHelper();
int currentCallCount = onPageFinishedHelper.getCallCount();
DOMUtils.scrollNodeIntoView(getContentViewCore(), callbackHelperContainer, id);
DOMUtils.clickNode(this, getContentView(), callbackHelperContainer, id);
DOMUtils.scrollNodeIntoView(getContentViewCore(), id);
DOMUtils.clickNode(this, getContentView(), id);
onPageFinishedHelper.waitForCallback(currentCallCount, 1, WAIT_TIMEOUT_SECONDS,
TimeUnit.SECONDS);
......
......@@ -11,6 +11,7 @@ import org.chromium.content.browser.test.util.Criteria;
import org.chromium.content.browser.test.util.CriteriaHelper;
import org.chromium.content.browser.test.util.MockLocationProvider;
import org.chromium.content.browser.test.util.TestCallbackHelperContainer;
import org.chromium.content.browser.test.util.TestCallbackHelperContainer.OnEvaluateJavaScriptResultHelper;
import org.chromium.content_shell_apk.ContentShellTestBase;
/**
......@@ -91,7 +92,7 @@ public class ContentViewLocationTest extends ContentShellTestBase {
}
mTestCallbackHelperContainer = new TestCallbackHelperContainer(getContentView());
mJavascriptHelper = mTestCallbackHelperContainer.getOnEvaluateJavaScriptResultHelper();
mJavascriptHelper = new OnEvaluateJavaScriptResultHelper();
ensureGeolocationRunning(false);
}
......
......@@ -92,7 +92,7 @@ public class ContentViewPopupZoomerTest extends ContentShellTestBase {
CriteriaHelper.pollForCriteria(new PopupShowingCriteria(view, false)));
// Once clicked, the popup should show up.
DOMUtils.clickNode(this, view, viewClient, "clickme");
DOMUtils.clickNode(this, view, "clickme");
assertTrue("The zoomer popup did not show up on click.",
CriteriaHelper.pollForCriteria(new PopupShowingCriteria(view, true)));
......
......@@ -32,16 +32,13 @@ public class GestureDetectorResetTest extends ContentShellTestBase {
private static class NodeContentsIsEqualToCriteria implements Criteria {
private final ContentViewCore mViewCore;
private final TestCallbackHelperContainer mViewClient;
private final String mNodeId;
private final String mExpectedContents;
public NodeContentsIsEqualToCriteria(
ContentViewCore viewCore,
TestCallbackHelperContainer viewClient,
String nodeId, String expectedContents) {
mViewCore = viewCore;
mViewClient = viewClient;
mNodeId = nodeId;
mExpectedContents = expectedContents;
assert mExpectedContents != null;
......@@ -50,7 +47,7 @@ public class GestureDetectorResetTest extends ContentShellTestBase {
@Override
public boolean isSatisfied() {
try {
String contents = DOMUtils.getNodeContents(mViewCore, mViewClient, mNodeId);
String contents = DOMUtils.getNodeContents(mViewCore, mNodeId);
return mExpectedContents.equals(contents);
} catch (Throwable e) {
Assert.fail("Failed to retrieve node contents: " + e);
......@@ -64,20 +61,20 @@ public class GestureDetectorResetTest extends ContentShellTestBase {
private void verifyClicksAreRegistered(
String disambiguation,
ContentView view, TestCallbackHelperContainer viewClient)
ContentView view)
throws InterruptedException, Exception, Throwable {
// Initially the text on the page should say "not clicked".
assertTrue("The page contents is invalid " + disambiguation,
CriteriaHelper.pollForCriteria(new NodeContentsIsEqualToCriteria(
view.getContentViewCore(), viewClient, "test", "not clicked")));
view.getContentViewCore(), "test", "not clicked")));
// Click the button.
DOMUtils.clickNode(this, view, viewClient, "button");
DOMUtils.clickNode(this, view, "button");
// After the click, the text on the page should say "clicked".
assertTrue("The page contents didn't change after a click " + disambiguation,
CriteriaHelper.pollForCriteria(new NodeContentsIsEqualToCriteria(
view.getContentViewCore(), viewClient, "test", "clicked")));
view.getContentViewCore(), "test", "clicked")));
}
/**
......@@ -102,7 +99,7 @@ public class GestureDetectorResetTest extends ContentShellTestBase {
viewClient.getOnPageFinishedHelper();
// Test that the button click works.
verifyClicksAreRegistered("on initial load", view, viewClient);
verifyClicksAreRegistered("on initial load", view);
// Reload the test page.
int currentCallCount = onPageFinishedHelper.getCallCount();
......@@ -116,7 +113,7 @@ public class GestureDetectorResetTest extends ContentShellTestBase {
WAIT_TIMEOUT_SECONDS, TimeUnit.SECONDS);
// Test that the button click still works.
verifyClicksAreRegistered("after reload", view, viewClient);
verifyClicksAreRegistered("after reload", view);
// Directly navigate to the test page.
currentCallCount = onPageFinishedHelper.getCallCount();
......@@ -131,6 +128,6 @@ public class GestureDetectorResetTest extends ContentShellTestBase {
WAIT_TIMEOUT_SECONDS, TimeUnit.SECONDS);
// Test that the button click still works.
verifyClicksAreRegistered("after direct navigation", view, viewClient);
verifyClicksAreRegistered("after direct navigation", view);
}
}
......@@ -9,6 +9,7 @@ import android.test.suitebuilder.annotation.MediumTest;
import org.chromium.base.test.util.Feature;
import org.chromium.base.test.util.UrlUtils;
import org.chromium.content.browser.test.util.TestCallbackHelperContainer;
import org.chromium.content.browser.test.util.TestCallbackHelperContainer.OnEvaluateJavaScriptResultHelper;
import org.chromium.content_shell_apk.ContentShellActivity;
import org.chromium.content_shell_apk.ContentShellTestBase;
......@@ -112,8 +113,7 @@ public class NavigationTest extends ContentShellTestBase {
ContentView contentView = activity.getActiveContentView();
TestCallbackHelperContainer testCallbackHelperContainer =
new TestCallbackHelperContainer(contentView);
TestCallbackHelperContainer.OnEvaluateJavaScriptResultHelper javascriptHelper =
testCallbackHelperContainer.getOnEvaluateJavaScriptResultHelper();
OnEvaluateJavaScriptResultHelper javascriptHelper = new OnEvaluateJavaScriptResultHelper();
// Grab the first timestamp.
javascriptHelper.evaluateJavaScript(contentView.getContentViewCore(), "getLoadtime();");
......
......@@ -9,7 +9,6 @@ import android.test.suitebuilder.annotation.SmallTest;
import org.chromium.base.test.util.Feature;
import org.chromium.base.test.util.UrlUtils;
import org.chromium.content.browser.test.util.JavaScriptUtils;
import org.chromium.content.browser.test.util.TestCallbackHelperContainer;
import org.chromium.content_shell_apk.ContentShellActivity;
import org.chromium.content_shell_apk.ContentShellTestBase;
......@@ -35,7 +34,6 @@ public class ScreenOrientationIntegrationTest extends ContentShellTestBase {
return Integer.parseInt(
JavaScriptUtils.executeJavaScriptAndWaitForResult(
mContentView.getContentViewCore(),
new TestCallbackHelperContainer(mContentView),
"window.orientation"));
}
......@@ -48,7 +46,6 @@ public class ScreenOrientationIntegrationTest extends ContentShellTestBase {
return Integer.parseInt(
JavaScriptUtils.executeJavaScriptAndWaitForResult(
mContentView.getContentViewCore(),
new TestCallbackHelperContainer(mContentView),
"changes"));
}
......
......@@ -9,7 +9,6 @@ import android.test.suitebuilder.annotation.LargeTest;
import org.chromium.base.test.util.Feature;
import org.chromium.base.test.util.UrlUtils;
import org.chromium.content.browser.test.util.DOMUtils;
import org.chromium.content.browser.test.util.TestCallbackHelperContainer;
import org.chromium.content_shell_apk.ContentShellTestBase;
public class TestsJavaScriptEvalTest extends ContentShellTestBase {
......@@ -34,9 +33,6 @@ public class TestsJavaScriptEvalTest extends ContentShellTestBase {
assertTrue("Page failed to load", waitForActiveShellToBeDoneLoading());
final ContentView view = getActivity().getActiveContentView();
final TestCallbackHelperContainer viewClient =
new TestCallbackHelperContainer(view);
for (int i = 0; i < 30; ++i) {
for (int j = 0; j < 10; ++j) {
// Start evaluation of a JavaScript script -- we don't need a result.
......@@ -44,7 +40,7 @@ public class TestsJavaScriptEvalTest extends ContentShellTestBase {
}
// DOMUtils does need to evaluate a JavaScript and get its result to get DOM bounds.
assertNotNull("Failed to get bounds",
DOMUtils.getNodeBounds(view.getContentViewCore(), viewClient, "test"));
DOMUtils.getNodeBounds(view.getContentViewCore(), "test"));
}
}
}
......@@ -10,29 +10,15 @@ import android.view.WindowManager;
import org.chromium.base.test.util.DisabledTest;
import org.chromium.content.browser.test.util.JavaScriptUtils;
import org.chromium.content.browser.test.util.TestCallbackHelperContainer;
/**
* Test suite for viewport-related properties.
*/
public class ViewportTest extends ContentViewTestBase {
private TestCallbackHelperContainer mCallbackHelper;
/**
* Returns the TestCallbackHelperContainer associated with this ContentView,
* or creates it lazily.
*/
protected TestCallbackHelperContainer getTestCallbackHelperContainer() {
if (mCallbackHelper == null) {
mCallbackHelper = new TestCallbackHelperContainer(getContentView());
}
return mCallbackHelper;
}
protected String evaluateStringValue(String expression) throws Throwable {
return JavaScriptUtils.executeJavaScriptAndWaitForResult(getContentViewCore(),
getTestCallbackHelperContainer(), expression);
expression);
}
protected float evaluateFloatValue(String expression) throws Throwable {
......
......@@ -72,8 +72,8 @@ public class ImeTest extends ContentShellTestBase {
// TODO(aurimas) remove this wait once crbug.com/179511 is fixed.
assertWaitForPageScaleFactorMatch(2);
assertTrue(DOMUtils.waitForNonZeroNodeBounds(
mContentViewCore, mCallbackContainer, "input_text"));
DOMUtils.clickNode(this, mContentView, mCallbackContainer, "input_text");
mContentViewCore, "input_text"));
DOMUtils.clickNode(this, mContentView, "input_text");
assertWaitForKeyboardStatus(true);
mConnection = (TestAdapterInputConnection) getAdapterInputConnection();
......@@ -136,10 +136,10 @@ public class ImeTest extends ContentShellTestBase {
commitText(mConnection, "hello", 1);
waitAndVerifyEditableCallback(mConnection.mImeUpdateQueue, 1, "hello", 5, 5, -1, -1);
DOMUtils.clickNode(this, mContentView, mCallbackContainer, "input_radio");
DOMUtils.clickNode(this, mContentView, "input_radio");
assertWaitForKeyboardStatus(false);
DOMUtils.clickNode(this, mContentView, mCallbackContainer, "input_text");
DOMUtils.clickNode(this, mContentView, "input_text");
assertWaitForKeyboardStatus(true);
assertEquals(5, mInputMethodManagerWrapper.getEditorInfo().initialSelStart);
assertEquals(5, mInputMethodManagerWrapper.getEditorInfo().initialSelEnd);
......@@ -207,13 +207,13 @@ public class ImeTest extends ContentShellTestBase {
@SmallTest
@Feature({"TextInput", "Main"})
public void testShowImeIfNeeded() throws Throwable {
DOMUtils.focusNode(this, mContentViewCore, mCallbackContainer, "input_radio");
DOMUtils.focusNode(this, mContentViewCore, "input_radio");
assertWaitForKeyboardStatus(false);
performShowImeIfNeeded();
assertWaitForKeyboardStatus(false);
DOMUtils.focusNode(this, mContentViewCore, mCallbackContainer, "input_text");
DOMUtils.focusNode(this, mContentViewCore, "input_text");
assertWaitForKeyboardStatus(false);
performShowImeIfNeeded();
......@@ -224,9 +224,9 @@ public class ImeTest extends ContentShellTestBase {
@Feature({"TextInput", "Main"})
public void testFinishComposingText() throws Throwable {
// Focus the textarea. We need to do the following steps because we are focusing using JS.
DOMUtils.focusNode(this, mContentViewCore, mCallbackContainer, "input_radio");
DOMUtils.focusNode(this, mContentViewCore, "input_radio");
assertWaitForKeyboardStatus(false);
DOMUtils.focusNode(this, mContentViewCore, mCallbackContainer, "textarea");
DOMUtils.focusNode(this, mContentViewCore, "textarea");
assertWaitForKeyboardStatus(false);
performShowImeIfNeeded();
assertWaitForKeyboardStatus(true);
......@@ -257,9 +257,9 @@ public class ImeTest extends ContentShellTestBase {
@Feature({"TextInput", "Main"})
public void testEnterKeyEventWhileComposingText() throws Throwable {
// Focus the textarea. We need to do the following steps because we are focusing using JS.
DOMUtils.focusNode(this, mContentViewCore, mCallbackContainer, "input_radio");
DOMUtils.focusNode(this, mContentViewCore, "input_radio");
assertWaitForKeyboardStatus(false);
DOMUtils.focusNode(this, mContentViewCore, mCallbackContainer, "textarea");
DOMUtils.focusNode(this, mContentViewCore, "textarea");
assertWaitForKeyboardStatus(false);
performShowImeIfNeeded();
assertWaitForKeyboardStatus(true);
......
......@@ -21,7 +21,6 @@ import org.chromium.content.browser.RenderCoordinates;
import org.chromium.content.browser.test.util.Criteria;
import org.chromium.content.browser.test.util.CriteriaHelper;
import org.chromium.content.browser.test.util.DOMUtils;
import org.chromium.content.browser.test.util.TestCallbackHelperContainer;
import org.chromium.content.browser.test.util.TestInputMethodManagerWrapper;
import org.chromium.content.browser.test.util.TestTouchUtils;
import org.chromium.content.browser.test.util.TouchCommon;
......@@ -250,8 +249,7 @@ public class InsertionHandleTest extends ContentShellTestBase {
// click (only if it changes the selection), the insertion handle is displayed. So that the
// second click changes the selection, the two clicks should be in sufficiently different
// locations.
Rect nodeBounds = DOMUtils.getNodeBounds(getContentViewCore(),
new TestCallbackHelperContainer(getContentView()), nodeId);
Rect nodeBounds = DOMUtils.getNodeBounds(getContentViewCore(), nodeId);
RenderCoordinates renderCoordinates = getContentViewCore().getRenderCoordinates();
int offsetX = getContentViewCore().getViewportSizeOffsetWidthPix();
......
......@@ -83,7 +83,7 @@ public class SelectPopupTest extends ContentShellTestBase {
viewClient.getOnPageFinishedHelper();
// Once clicked, the popup should show up.
DOMUtils.clickNode(this, view, viewClient, "select");
DOMUtils.clickNode(this, view, "select");
assertTrue("The select popup did not show up on click.",
CriteriaHelper.pollForCriteria(new PopupShowingCriteria()));
......@@ -104,7 +104,7 @@ public class SelectPopupTest extends ContentShellTestBase {
CriteriaHelper.pollForCriteria(new PopupHiddenCriteria()));
// Click the select and wait for the popup to show.
DOMUtils.clickNode(this, view, viewClient, "select");
DOMUtils.clickNode(this, view, "select");
assertTrue("The select popup did not show on click after reload.",
CriteriaHelper.pollForCriteria(new PopupShowingCriteria()));
}
......
......@@ -22,7 +22,6 @@ import org.chromium.content.browser.RenderCoordinates;
import org.chromium.content.browser.test.util.Criteria;
import org.chromium.content.browser.test.util.CriteriaHelper;
import org.chromium.content.browser.test.util.DOMUtils;
import org.chromium.content.browser.test.util.TestCallbackHelperContainer;
import org.chromium.content.browser.test.util.TestInputMethodManagerWrapper;
import org.chromium.content.browser.test.util.TestTouchUtils;
import org.chromium.content.browser.test.util.TouchCommon;
......@@ -449,8 +448,7 @@ public class SelectionHandleTest extends ContentShellTestBase {
}
private Rect getNodeBoundsPix(String nodeId) throws Throwable {
Rect nodeBounds = DOMUtils.getNodeBounds(getContentViewCore(),
new TestCallbackHelperContainer(getContentView()), nodeId);
Rect nodeBounds = DOMUtils.getNodeBounds(getContentViewCore(), nodeId);
RenderCoordinates renderCoordinates = getContentViewCore().getRenderCoordinates();
int offsetX = getContentViewCore().getViewportSizeOffsetWidthPix();
......
......@@ -25,8 +25,7 @@ public class DOMUtils {
/**
* Returns the rect boundaries for a node by its id.
*/
public static Rect getNodeBounds(
final ContentViewCore viewCore, TestCallbackHelperContainer viewClient, String nodeId)
public static Rect getNodeBounds(final ContentViewCore viewCore, String nodeId)
throws InterruptedException, TimeoutException {
StringBuilder sb = new StringBuilder();
sb.append("(function() {");
......@@ -44,7 +43,7 @@ public class DOMUtils {
sb.append("})();");
String jsonText = JavaScriptUtils.executeJavaScriptAndWaitForResult(
viewCore, viewClient, sb.toString());
viewCore, sb.toString());
Assert.assertFalse("Failed to retrieve bounds for " + nodeId,
jsonText.trim().equalsIgnoreCase("null"));
......@@ -72,7 +71,7 @@ public class DOMUtils {
* Focus a DOM node by its id.
*/
public static void focusNode(ActivityInstrumentationTestCase2 activityTestCase,
final ContentViewCore viewCore, TestCallbackHelperContainer viewClient, String nodeId)
final ContentViewCore viewCore, String nodeId)
throws InterruptedException, TimeoutException {
StringBuilder sb = new StringBuilder();
sb.append("(function() {");
......@@ -80,16 +79,16 @@ public class DOMUtils {
sb.append(" if (node) node.focus();");
sb.append("})();");
JavaScriptUtils.executeJavaScriptAndWaitForResult(viewCore, viewClient, sb.toString());
JavaScriptUtils.executeJavaScriptAndWaitForResult(viewCore, sb.toString());
}
/**
* Click a DOM node by its id.
*/
public static void clickNode(ActivityInstrumentationTestCase2 activityTestCase,
final ContentView view, TestCallbackHelperContainer viewClient, String nodeId)
final ContentView view, String nodeId)
throws InterruptedException, TimeoutException {
int[] clickTarget = getClickTargetForNode(view.getContentViewCore(), viewClient, nodeId);
int[] clickTarget = getClickTargetForNode(view.getContentViewCore(), nodeId);
TouchCommon touchCommon = new TouchCommon(activityTestCase);
touchCommon.singleClickView(view, clickTarget[0], clickTarget[1]);
}
......@@ -98,9 +97,9 @@ public class DOMUtils {
* Long-press a DOM node by its id.
*/
public static void longPressNode(ActivityInstrumentationTestCase2 activityTestCase,
final ContentView view, TestCallbackHelperContainer viewClient, String nodeId)
final ContentView view, String nodeId)
throws InterruptedException, TimeoutException {
int[] clickTarget = getClickTargetForNode(view.getContentViewCore(), viewClient, nodeId);
int[] clickTarget = getClickTargetForNode(view.getContentViewCore(), nodeId);
TouchCommon touchCommon = new TouchCommon(activityTestCase);
touchCommon.longPressView(view, clickTarget[0], clickTarget[1]);
}
......@@ -108,33 +107,30 @@ public class DOMUtils {
/**
* Scrolls the view to ensure that the required DOM node is visible.
*/
public static void scrollNodeIntoView(final ContentViewCore viewCore,
TestCallbackHelperContainer viewClient, String nodeId)
public static void scrollNodeIntoView(ContentViewCore viewCore, String nodeId)
throws InterruptedException, TimeoutException {
JavaScriptUtils.executeJavaScriptAndWaitForResult(viewCore, viewClient,
JavaScriptUtils.executeJavaScriptAndWaitForResult(viewCore,
"document.getElementById('" + nodeId + "').scrollIntoView()");
}
/**
* Returns the contents of the node by its id.
*/
public static String getNodeContents(final ContentViewCore viewCore,
TestCallbackHelperContainer viewClient, String nodeId)
public static String getNodeContents(ContentViewCore viewCore, String nodeId)
throws InterruptedException, TimeoutException {
return getNodeField("textContent", viewCore, viewClient, nodeId);
return getNodeField("textContent", viewCore, nodeId);
}
/**
* Returns the value of the node by its id.
*/
public static String getNodeValue(final ContentViewCore viewCore,
TestCallbackHelperContainer viewClient, String nodeId)
public static String getNodeValue(final ContentViewCore viewCore, String nodeId)
throws InterruptedException, TimeoutException {
return getNodeField("value", viewCore, viewClient, nodeId);
return getNodeField("value", viewCore, nodeId);
}
private static String getNodeField(String fieldName, final ContentViewCore viewCore,
TestCallbackHelperContainer viewClient, String nodeId)
String nodeId)
throws InterruptedException, TimeoutException {
StringBuilder sb = new StringBuilder();
sb.append("(function() {");
......@@ -145,7 +141,7 @@ public class DOMUtils {
sb.append("})();");
String jsonText = JavaScriptUtils.executeJavaScriptAndWaitForResult(
viewCore, viewClient, sb.toString());
viewCore, sb.toString());
Assert.assertFalse("Failed to retrieve contents for " + nodeId,
jsonText.trim().equalsIgnoreCase("null"));
......@@ -169,13 +165,13 @@ public class DOMUtils {
* @return Whether the node started having non-zero bounds.
*/
public static boolean waitForNonZeroNodeBounds(final ContentViewCore viewCore,
final TestCallbackHelperContainer viewClient, final String nodeName)
final String nodeName)
throws InterruptedException {
return CriteriaHelper.pollForCriteria(new Criteria() {
@Override
public boolean isSatisfied() {
try {
return !DOMUtils.getNodeBounds(viewCore, viewClient, nodeName).isEmpty();
return !DOMUtils.getNodeBounds(viewCore, nodeName).isEmpty();
} catch (InterruptedException e) {
// Intentionally do nothing
return false;
......@@ -190,10 +186,9 @@ public class DOMUtils {
/**
* Returns click targets for a given DOM node.
*/
private static int[] getClickTargetForNode(final ContentViewCore viewCore,
TestCallbackHelperContainer viewClient, String nodeName)
private static int[] getClickTargetForNode(ContentViewCore viewCore, String nodeName)
throws InterruptedException, TimeoutException {
Rect bounds = getNodeBounds(viewCore, viewClient, nodeName);
Rect bounds = getNodeBounds(viewCore, nodeName);
Assert.assertNotNull("Failed to get DOM element bounds of '" + nodeName + "'.", bounds);
int clickX = (int) viewCore.getRenderCoordinates().fromLocalCssToPix(bounds.exactCenterX())
......
......@@ -10,6 +10,7 @@ import junit.framework.Assert;
import org.chromium.base.ThreadUtils;
import org.chromium.content.browser.ContentViewCore;
import org.chromium.content.browser.test.util.TestCallbackHelperContainer.OnEvaluateJavaScriptResultHelper;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
......@@ -25,10 +26,9 @@ public class JavaScriptUtils {
* Returns the result of its execution in JSON format.
*/
public static String executeJavaScriptAndWaitForResult(
final ContentViewCore viewCore, TestCallbackHelperContainer viewClient,
final String code) throws InterruptedException, TimeoutException {
ContentViewCore viewCore, String code) throws InterruptedException, TimeoutException {
return executeJavaScriptAndWaitForResult(
viewCore, viewClient.getOnEvaluateJavaScriptResultHelper(), code);
viewCore, code, EVALUATION_TIMEOUT_SECONDS, TimeUnit.SECONDS);
}
/**
......@@ -38,23 +38,11 @@ public class JavaScriptUtils {
*/
public static String executeJavaScriptAndWaitForResult(
final ContentViewCore viewCore,
final TestCallbackHelperContainer.OnEvaluateJavaScriptResultHelper helper,
final String code) throws InterruptedException, TimeoutException {
return executeJavaScriptAndWaitForResult(
viewCore, helper, code, EVALUATION_TIMEOUT_SECONDS, TimeUnit.SECONDS);
}
/**
* Executes the given snippet of JavaScript code within the given ContentViewCore.
* Does not depend on ContentView and TestCallbackHelperContainer.
* Returns the result of its execution in JSON format.
*/
public static String executeJavaScriptAndWaitForResult(
final ContentViewCore viewCore,
final TestCallbackHelperContainer.OnEvaluateJavaScriptResultHelper helper,
final String code,
final long timeout, final TimeUnit timeoutUnits)
final long timeout,
final TimeUnit timeoutUnits)
throws InterruptedException, TimeoutException {
final OnEvaluateJavaScriptResultHelper helper = new OnEvaluateJavaScriptResultHelper();
// Calling this from the UI thread causes it to time-out: the UI thread being blocked won't
// have a chance to process the JavaScript eval response).
Assert.assertFalse("Executing JavaScript should be done from the test thread, "
......
......@@ -15,8 +15,8 @@ import java.util.concurrent.TimeoutException;
* This class is used to provide callback hooks for tests and related classes.
*/
public class TestCallbackHelperContainer {
private TestContentViewClient mTestContentViewClient;
private TestWebContentsObserver mTestWebContentsObserver;
private final TestContentViewClient mTestContentViewClient;
private final TestWebContentsObserver mTestWebContentsObserver;
public TestCallbackHelperContainer(ContentView contentView) {
mTestContentViewClient = new TestContentViewClient();
......@@ -176,10 +176,6 @@ public class TestCallbackHelperContainer {
return mTestWebContentsObserver.getOnReceivedErrorHelper();
}
public OnEvaluateJavaScriptResultHelper getOnEvaluateJavaScriptResultHelper() {
return mTestContentViewClient.getOnEvaluateJavaScriptResultHelper();
}
public OnStartContentIntentHelper getOnStartContentIntentHelper() {
return mTestContentViewClient.getOnStartContentIntentHelper();
}
......
......@@ -7,7 +7,6 @@ package org.chromium.content.browser.test.util;
import android.content.Context;
import org.chromium.content.browser.ContentViewClient;
import org.chromium.content.browser.test.util.TestCallbackHelperContainer.OnEvaluateJavaScriptResultHelper;
import org.chromium.content.browser.test.util.TestCallbackHelperContainer.OnStartContentIntentHelper;
/**
......@@ -18,18 +17,12 @@ import org.chromium.content.browser.test.util.TestCallbackHelperContainer.OnStar
*/
public class TestContentViewClient extends ContentViewClient {
private OnEvaluateJavaScriptResultHelper mOnEvaluateJavaScriptResultHelper;
private OnStartContentIntentHelper mOnStartContentIntentHelper;
private final OnStartContentIntentHelper mOnStartContentIntentHelper;
public TestContentViewClient() {
mOnEvaluateJavaScriptResultHelper = new OnEvaluateJavaScriptResultHelper();
mOnStartContentIntentHelper = new OnStartContentIntentHelper();
}
public OnEvaluateJavaScriptResultHelper getOnEvaluateJavaScriptResultHelper() {
return mOnEvaluateJavaScriptResultHelper;
}
public OnStartContentIntentHelper getOnStartContentIntentHelper() {
return mOnStartContentIntentHelper;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment