| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |