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

Unified Diff: android_webview/javatests/src/org/chromium/android_webview/test/AwSettingsTest.java

Issue 2933623002: Create AwJUnit4ClassRunner AwActivityTestRule and convert AwContentsTest (Closed)
Patch Set: address bo's comments Created 3 years, 5 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: android_webview/javatests/src/org/chromium/android_webview/test/AwSettingsTest.java
diff --git a/android_webview/javatests/src/org/chromium/android_webview/test/AwSettingsTest.java b/android_webview/javatests/src/org/chromium/android_webview/test/AwSettingsTest.java
index 6c4fe83344a67e72ca8f9bfe8d7097f4fc3e2a5a..caeb729ae00ed1b29556698aca7db769ff113d91 100644
--- a/android_webview/javatests/src/org/chromium/android_webview/test/AwSettingsTest.java
+++ b/android_webview/javatests/src/org/chromium/android_webview/test/AwSettingsTest.java
@@ -2956,12 +2956,12 @@ public class AwSettingsTest extends AwTestBase {
final AwTestContainerView mContainerView = createAwTestContainerViewOnMainSync(client);
final AwContents awContents = mContainerView.getAwContents();
enableJavaScriptOnUiThread(awContents);
- JSUtils.executeJavaScriptAndWaitForResult(this, awContents,
+ JSUtils.executeJavaScriptAndWaitForResult(getInstrumentation(), awContents,
client.getOnEvaluateJavaScriptResultHelper(),
"window.emptyDocumentPersistenceTest = true;");
loadUrlSync(awContents, client.getOnPageFinishedHelper(),
ContentUrlConstants.ABOUT_BLANK_DISPLAY_URL);
- String result = JSUtils.executeJavaScriptAndWaitForResult(this, awContents,
+ String result = JSUtils.executeJavaScriptAndWaitForResult(getInstrumentation(), awContents,
client.getOnEvaluateJavaScriptResultHelper(),
"window.emptyDocumentPersistenceTest ? 'set' : 'not set';");
assertEquals(allow ? "\"set\"" : "\"not set\"", result);
@@ -3014,12 +3014,12 @@ public class AwSettingsTest extends AwTestBase {
awContents, client.getOnPageFinishedHelper(), testPageHtml, "text/html", false);
// Focus on an empty DIV.
- JSUtils.executeJavaScriptAndWaitForResult(this, awContents,
+ JSUtils.executeJavaScriptAndWaitForResult(getInstrumentation(), awContents,
client.getOnEvaluateJavaScriptResultHelper(), "window.a.focus();");
assertEquals(1, getSelectionChangeCountForSelectionUpdateTest(awContents, client));
// Create and delete a zero-width space. See crbug.com/698752 for details.
- JSUtils.executeJavaScriptAndWaitForResult(this, awContents,
+ JSUtils.executeJavaScriptAndWaitForResult(getInstrumentation(), awContents,
client.getOnEvaluateJavaScriptResultHelper(),
"(function() {"
+ "var sel = window.getSelection();"
@@ -3051,16 +3051,16 @@ public class AwSettingsTest extends AwTestBase {
String expectedTitle = Integer.toString(mTitleIdx);
// Since selectionchange event is posted on a message loop, we run another message loop
// before we get the result. On Chromium both run on the same message loop.
- JSUtils.executeJavaScriptAndWaitForResult(this, awContents,
+ JSUtils.executeJavaScriptAndWaitForResult(getInstrumentation(), awContents,
client.getOnEvaluateJavaScriptResultHelper(),
"setTimeout(function() { document.title = '" + expectedTitle + "'; });");
pollTitleAs(expectedTitle, awContents);
- String result = JSUtils.executeJavaScriptAndWaitForResult(
- this, awContents, client.getOnEvaluateJavaScriptResultHelper(), "window.cnt");
+ String result = JSUtils.executeJavaScriptAndWaitForResult(getInstrumentation(), awContents,
+ client.getOnEvaluateJavaScriptResultHelper(), "window.cnt");
// Clean up
- JSUtils.executeJavaScriptAndWaitForResult(
- this, awContents, client.getOnEvaluateJavaScriptResultHelper(), "window.cnt = 0;");
+ JSUtils.executeJavaScriptAndWaitForResult(getInstrumentation(), awContents,
+ client.getOnEvaluateJavaScriptResultHelper(), "window.cnt = 0;");
return Integer.parseInt(result);
}

Powered by Google App Engine
This is Rietveld 408576698