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

Side by Side Diff: android_webview/javatests/src/org/chromium/android_webview/test/AwContentsTest.java

Issue 1257603003: Revert of Add ExecuteJavaScriptForTest and make all tests use it (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 unified diff | Download patch
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 package org.chromium.android_webview.test; 5 package org.chromium.android_webview.test;
6 6
7 import android.graphics.Bitmap; 7 import android.graphics.Bitmap;
8 import android.graphics.BitmapFactory; 8 import android.graphics.BitmapFactory;
9 import android.graphics.Canvas; 9 import android.graphics.Canvas;
10 import android.os.Build; 10 import android.os.Build;
(...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after
396 final AwTestContainerView testView = createAwTestContainerViewOnMainSync (mContentsClient); 396 final AwTestContainerView testView = createAwTestContainerViewOnMainSync (mContentsClient);
397 final CallbackHelper callback = new CallbackHelper(); 397 final CallbackHelper callback = new CallbackHelper();
398 398
399 runTestOnUiThread(new Runnable() { 399 runTestOnUiThread(new Runnable() {
400 @Override 400 @Override
401 public void run() { 401 public void run() {
402 AwContents awContents = testView.getAwContents(); 402 AwContents awContents = testView.getAwContents();
403 AwSettings awSettings = awContents.getSettings(); 403 AwSettings awSettings = awContents.getSettings();
404 awSettings.setJavaScriptEnabled(true); 404 awSettings.setJavaScriptEnabled(true);
405 awContents.addJavascriptInterface(new JavaScriptObject(callback) , "bridge"); 405 awContents.addJavascriptInterface(new JavaScriptObject(callback) , "bridge");
406 awContents.evaluateJavaScriptForTests("window.bridge.run();", nu ll); 406 awContents.evaluateJavaScript("window.bridge.run();", null);
407 } 407 }
408 }); 408 });
409 callback.waitForCallback(0, 1, WAIT_TIMEOUT_MS, TimeUnit.MILLISECONDS); 409 callback.waitForCallback(0, 1, WAIT_TIMEOUT_MS, TimeUnit.MILLISECONDS);
410 } 410 }
411 411
412 @Feature({"AndroidWebView"}) 412 @Feature({"AndroidWebView"})
413 @SmallTest 413 @SmallTest
414 public void testEscapingOfErrorPage() throws Throwable { 414 public void testEscapingOfErrorPage() throws Throwable {
415 AwTestContainerView testView = createAwTestContainerViewOnMainSync(mCont entsClient); 415 AwTestContainerView testView = createAwTestContainerViewOnMainSync(mCont entsClient);
416 AwContents awContents = testView.getAwContents(); 416 AwContents awContents = testView.getAwContents();
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after
713 assertFalse(grandChild.hasStyle); 713 assertFalse(grandChild.hasStyle);
714 } 714 }
715 715
716 @Feature({"AndroidWebView"}) 716 @Feature({"AndroidWebView"})
717 @SmallTest 717 @SmallTest
718 public void testRequestAccessibilitySnapshotAboutBlank() throws Throwable { 718 public void testRequestAccessibilitySnapshotAboutBlank() throws Throwable {
719 AccessibilitySnapshotNode root = receiveAccessibilitySnapshot(null); 719 AccessibilitySnapshotNode root = receiveAccessibilitySnapshot(null);
720 assertEquals(null, root); 720 assertEquals(null, root);
721 } 721 }
722 } 722 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698