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

Side by Side Diff: android_webview/tools/system_webview_shell/layout_tests/src/org/chromium/webview_shell/test/WebViewThreadTest.java

Issue 2517203002: Reland of Add GN build rules to allow java_assertion_enabler to enable Java asserts. (Closed)
Patch Set: format nit Created 4 years 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 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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698