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

Unified Diff: content/public/android/javatests/src/org/chromium/content/browser/TestsJavaScriptEvalTest.java

Issue 572013002: Removing ContentViewCore dependencies from direct WebContents functions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased the patch and addressed review comments. Created 6 years, 2 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: content/public/android/javatests/src/org/chromium/content/browser/TestsJavaScriptEvalTest.java
diff --git a/content/public/android/javatests/src/org/chromium/content/browser/TestsJavaScriptEvalTest.java b/content/public/android/javatests/src/org/chromium/content/browser/TestsJavaScriptEvalTest.java
index dc61d4cf71e25231e03d9ff73014f780f3a04e37..99c14c6cf545fc016c1e34a18bf2bd49cbe1bf76 100644
--- a/content/public/android/javatests/src/org/chromium/content/browser/TestsJavaScriptEvalTest.java
+++ b/content/public/android/javatests/src/org/chromium/content/browser/TestsJavaScriptEvalTest.java
@@ -9,8 +9,12 @@ 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_public.browser.WebContents;
import org.chromium.content_shell_apk.ContentShellTestBase;
+/**
+ * Integration tests for JavaScript execution.
+ */
public class TestsJavaScriptEvalTest extends ContentShellTestBase {
private static final String JSTEST_URL = UrlUtils.encodeHtmlDataUri(
"<html><head><script>" +
@@ -32,15 +36,15 @@ public class TestsJavaScriptEvalTest extends ContentShellTestBase {
launchContentShellWithUrl(JSTEST_URL);
assertTrue("Page failed to load", waitForActiveShellToBeDoneLoading());
- final ContentViewCore contentViewCore = getContentViewCore();
+ final WebContents webContents = getWebContents();
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.
- contentViewCore.evaluateJavaScript("foobar();", null);
+ webContents.evaluateJavaScript("foobar();", null);
}
// DOMUtils does need to evaluate a JavaScript and get its result to get DOM bounds.
assertNotNull("Failed to get bounds",
- DOMUtils.getNodeBounds(contentViewCore, "test"));
+ DOMUtils.getNodeBounds(webContents, "test"));
}
}
}

Powered by Google App Engine
This is Rietveld 408576698