| 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 static org.chromium.base.test.util.ScalableTimeout.scaleTimeout; | 7 import static org.chromium.base.test.util.ScalableTimeout.scaleTimeout; |
| 8 | 8 |
| 9 import android.app.Instrumentation; | 9 import android.app.Instrumentation; |
| 10 import android.content.Context; | 10 import android.content.Context; |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 | 154 |
| 155 public void enableJavaScriptOnUiThread(final AwContents awContents) { | 155 public void enableJavaScriptOnUiThread(final AwContents awContents) { |
| 156 getInstrumentation().runOnMainSync(new Runnable() { | 156 getInstrumentation().runOnMainSync(new Runnable() { |
| 157 @Override | 157 @Override |
| 158 public void run() { | 158 public void run() { |
| 159 awContents.getSettings().setJavaScriptEnabled(true); | 159 awContents.getSettings().setJavaScriptEnabled(true); |
| 160 } | 160 } |
| 161 }); | 161 }); |
| 162 } | 162 } |
| 163 | 163 |
| 164 public void allowFileAccessFromFileURLs(final AwContents awContents) { |
| 165 getInstrumentation().runOnMainSync(new Runnable() { |
| 166 @Override |
| 167 public void run() { |
| 168 awContents.getSettings().setAllowFileAccessFromFileURLs(true); |
| 169 } |
| 170 }); |
| 171 } |
| 172 |
| 164 public void setNetworkAvailableOnUiThread(final AwContents awContents, | 173 public void setNetworkAvailableOnUiThread(final AwContents awContents, |
| 165 final boolean networkUp) { | 174 final boolean networkUp) { |
| 166 getInstrumentation().runOnMainSync(new Runnable() { | 175 getInstrumentation().runOnMainSync(new Runnable() { |
| 167 @Override | 176 @Override |
| 168 public void run() { | 177 public void run() { |
| 169 awContents.setNetworkAvailable(networkUp); | 178 awContents.setNetworkAvailable(networkUp); |
| 170 } | 179 } |
| 171 }); | 180 }); |
| 172 } | 181 } |
| 173 | 182 |
| (...skipping 530 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 704 int titleCallCount = onReceivedTitleHelper.getCallCount(); | 713 int titleCallCount = onReceivedTitleHelper.getCallCount(); |
| 705 | 714 |
| 706 onPageFinishedHelper.waitForCallback(finishCallCount, 1, WAIT_TIMEOUT_MS
, | 715 onPageFinishedHelper.waitForCallback(finishCallCount, 1, WAIT_TIMEOUT_MS
, |
| 707 TimeUnit.MILLISECONDS); | 716 TimeUnit.MILLISECONDS); |
| 708 onReceivedTitleHelper.waitForCallback(titleCallCount, 1, WAIT_TIMEOUT_MS
, | 717 onReceivedTitleHelper.waitForCallback(titleCallCount, 1, WAIT_TIMEOUT_MS
, |
| 709 TimeUnit.MILLISECONDS); | 718 TimeUnit.MILLISECONDS); |
| 710 | 719 |
| 711 return new PopupInfo(popupContentsClient, popupContainerView, popupConte
nts); | 720 return new PopupInfo(popupContentsClient, popupContainerView, popupConte
nts); |
| 712 } | 721 } |
| 713 } | 722 } |
| OLD | NEW |