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

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

Issue 2797893002: Prevent Android webview tests from being broken by data URL deprecation (Closed)
Patch Set: Rebase Created 3 years, 8 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 static org.chromium.base.test.util.ScalableTimeout.scaleTimeout; 7 import static org.chromium.base.test.util.ScalableTimeout.scaleTimeout;
8 8
9 import android.content.Context; 9 import android.content.Context;
10 import android.graphics.Point; 10 import android.graphics.Point;
(...skipping 1164 matching lines...) Expand 10 before | Expand all | Expand 10 after
1175 POPUP_BLOCKED.equals(title); 1175 POPUP_BLOCKED.equals(title);
1176 } 1176 }
1177 }); 1177 });
1178 assertEquals(value ? POPUP_ENABLED : POPUP_BLOCKED, getTitleOnUiThre ad()); 1178 assertEquals(value ? POPUP_ENABLED : POPUP_BLOCKED, getTitleOnUiThre ad());
1179 } 1179 }
1180 1180
1181 private String getData() { 1181 private String getData() {
1182 return "<html><head>" 1182 return "<html><head>"
1183 + "<script>" 1183 + "<script>"
1184 + " function tryOpenWindow() {" 1184 + " function tryOpenWindow() {"
1185 + " var newWindow = window.open(" 1185 + " var newWindow = window.open('about:blank');"
1186 + " 'data:text/html;charset=utf-8," 1186 + " if (newWindow) {"
1187 + " <html><head><title>" + POPUP_ENABLED + "</titl e></head></html>');" 1187 + " newWindow.document.write("
1188 + " if (!newWindow) document.title = '" + POPUP_BLOCK ED + "';" 1188 + " '<html><head><title>" + POPUP_ENABLED
1189 + "</title></head></html>');"
1190 + " } else {"
1191 + " document.title = '" + POPUP_BLOCKED + "';"
1192 + " }"
1189 + " }" 1193 + " }"
1190 + "</script></head>" 1194 + "</script></head>"
1191 + "<body onload='tryOpenWindow()'></body></html>"; 1195 + "<body onload='tryOpenWindow()'></body></html>";
1192 } 1196 }
1193 } 1197 }
1194 1198
1195 class AwSettingsCacheModeTestHelper extends AwSettingsTestHelper<Integer> { 1199 class AwSettingsCacheModeTestHelper extends AwSettingsTestHelper<Integer> {
1196 1200
1197 AwSettingsCacheModeTestHelper( 1201 AwSettingsCacheModeTestHelper(
1198 AwTestContainerView containerView, 1202 AwTestContainerView containerView,
(...skipping 1888 matching lines...) Expand 10 before | Expand all | Expand 10 after
3087 final AwContents awContents = webView.getAwContents(); 3091 final AwContents awContents = webView.getAwContents();
3088 runTestOnUiThread(new Runnable() { 3092 runTestOnUiThread(new Runnable() {
3089 @Override 3093 @Override
3090 public void run() { 3094 public void run() {
3091 awContents.getContentViewCore().sendDoubleTapForTest( 3095 awContents.getContentViewCore().sendDoubleTapForTest(
3092 SystemClock.uptimeMillis(), x, y); 3096 SystemClock.uptimeMillis(), x, y);
3093 } 3097 }
3094 }); 3098 });
3095 } 3099 }
3096 } 3100 }
OLDNEW
« no previous file with comments | « android_webview/javatests/src/org/chromium/android_webview/test/AwContentsClientShouldOverrideUrlLoadingTest.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698