Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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.webview_shell.test; | 5 package org.chromium.webview_shell.test; |
| 6 | 6 |
| 7 import android.test.ActivityInstrumentationTestCase2; | 7 import android.test.ActivityInstrumentationTestCase2; |
| 8 import android.test.suitebuilder.annotation.SmallTest; | 8 import android.test.suitebuilder.annotation.SmallTest; |
| 9 import android.webkit.CookieManager; | 9 import android.webkit.CookieManager; |
| 10 import android.webkit.GeolocationPermissions; | 10 import android.webkit.GeolocationPermissions; |
| 11 import android.webkit.WebStorage; | 11 import android.webkit.WebStorage; |
| 12 | 12 |
| 13 import static org.chromium.base.test.util.ScalableTimeout.scaleTimeout; | 13 import static org.chromium.base.test.util.ScalableTimeout.scaleTimeout; |
| 14 | 14 |
| 15 import org.chromium.webview_shell.WebViewThreadTestActivity; | 15 import org.chromium.webview_shell.WebViewThreadTestActivity; |
| 16 | 16 |
| 17 /** | 17 /** |
| 18 * Tests running WebView on different threads. | 18 * Tests running WebView on different threads. |
| 19 */ | 19 */ |
| 20 public class WebViewThreadTest extends ActivityInstrumentationTestCase2<WebViewT hreadTestActivity> { | 20 public class WebViewThreadTest extends ActivityInstrumentationTestCase2<WebViewT hreadTestActivity> { |
| 21 private static final long TIMEOUT = scaleTimeout(2000); | 21 private static final long TIMEOUT = scaleTimeout(4000); |
|
boliu
2016/11/23 16:50:39
what does this have to do with asserts?
| |
| 22 private static final String DATA = "<html><body>Testing<script>" | 22 private static final String DATA = "<html><body>Testing<script>" |
| 23 + "console.log(\"testing\")</script></body></html>"; | 23 + "console.log(\"testing\")</script></body></html>"; |
| 24 private static final String URL_DATA = "javascript:console.log(\"testing\")" ; | 24 private static final String URL_DATA = "javascript:console.log(\"testing\")" ; |
| 25 private WebViewThreadTestActivity mActivity; | 25 private WebViewThreadTestActivity mActivity; |
| 26 private InterruptedException mException; | 26 private InterruptedException mException; |
| 27 | 27 |
| 28 public WebViewThreadTest() { | 28 public WebViewThreadTest() { |
| 29 super(WebViewThreadTestActivity.class); | 29 super(WebViewThreadTestActivity.class); |
| 30 } | 30 } |
| 31 | 31 |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 116 private boolean loadDataWebViewNonUiThread(final String data) throws Interru ptedException { | 116 private boolean loadDataWebViewNonUiThread(final String data) throws Interru ptedException { |
| 117 return mActivity.loadDataInNonUiThread(data, "text/html", null, TIMEOUT) ; | 117 return mActivity.loadDataInNonUiThread(data, "text/html", null, TIMEOUT) ; |
| 118 } | 118 } |
| 119 private boolean loadUrlWebViewNonUiThread(final String url) throws Interrupt edException { | 119 private boolean loadUrlWebViewNonUiThread(final String url) throws Interrupt edException { |
| 120 return mActivity.loadUrlInNonUiThread(url, TIMEOUT); | 120 return mActivity.loadUrlInNonUiThread(url, TIMEOUT); |
| 121 } | 121 } |
| 122 private boolean loadDataWebViewInUiThread(final String data) throws Interrup tedException { | 122 private boolean loadDataWebViewInUiThread(final String data) throws Interrup tedException { |
| 123 return mActivity.loadDataInUiThread(data, "text/html", null, TIMEOUT); | 123 return mActivity.loadDataInUiThread(data, "text/html", null, TIMEOUT); |
| 124 } | 124 } |
| 125 } | 125 } |
| OLD | NEW |