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

Side by Side Diff: content/public/android/javatests/src/org/chromium/content/browser/JavaBridgeChildFrameTest.java

Issue 1257603003: Revert of Add ExecuteJavaScriptForTest and make all tests use it (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 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.content.browser; 5 package org.chromium.content.browser;
6 6
7 import android.test.suitebuilder.annotation.SmallTest; 7 import android.test.suitebuilder.annotation.SmallTest;
8 8
9 import org.chromium.base.annotations.SuppressFBWarnings; 9 import org.chromium.base.annotations.SuppressFBWarnings;
10 import org.chromium.base.test.util.CommandLineFlags; 10 import org.chromium.base.test.util.CommandLineFlags;
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after
250 @Override 250 @Override
251 public void handleJavaScriptResult(String jsonResult) { 251 public void handleJavaScriptResult(String jsonResult) {
252 result[0] = jsonResult; 252 result[0] = jsonResult;
253 notifyResultIsReady(); 253 notifyResultIsReady();
254 } 254 }
255 } 255 }
256 final ResultCallback resultCallback = new ResultCallback(); 256 final ResultCallback resultCallback = new ResultCallback();
257 runTestOnUiThread(new Runnable() { 257 runTestOnUiThread(new Runnable() {
258 @Override 258 @Override
259 public void run() { 259 public void run() {
260 webContents.evaluateJavaScriptForTests(script, resultCallback); 260 webContents.evaluateJavaScript(script, resultCallback);
261 } 261 }
262 }); 262 });
263 resultCallback.waitForResult(); 263 resultCallback.waitForResult();
264 return result[0]; 264 return result[0];
265 } 265 }
266 266
267 /** 267 /**
268 * Loads data on the UI thread and blocks until onPageFinished is called. 268 * Loads data on the UI thread and blocks until onPageFinished is called.
269 */ 269 */
270 private void loadDataSync(final NavigationController navigationController, f inal String data, 270 private void loadDataSync(final NavigationController navigationController, f inal String data,
271 final String mimeType, final boolean isBase64Encoded) throws Throwab le { 271 final String mimeType, final boolean isBase64Encoded) throws Throwab le {
272 loadUrl(navigationController, mTestCallbackHelperContainer, 272 loadUrl(navigationController, mTestCallbackHelperContainer,
273 LoadUrlParams.createLoadDataParams(data, mimeType, isBase64Encod ed)); 273 LoadUrlParams.createLoadDataParams(data, mimeType, isBase64Encod ed));
274 } 274 }
275 } 275 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698