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

Side by Side Diff: content/public/android/javatests/src/org/chromium/content/browser/NavigationTest.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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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.MediumTest; 7 import android.test.suitebuilder.annotation.MediumTest;
8 8
9 import org.chromium.base.test.util.Feature; 9 import org.chromium.base.test.util.Feature;
10 import org.chromium.base.test.util.UrlUtils; 10 import org.chromium.base.test.util.UrlUtils;
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 final String urlLoadTime = UrlUtils.encodeHtmlDataUri(htmlLoadTime); 111 final String urlLoadTime = UrlUtils.encodeHtmlDataUri(htmlLoadTime);
112 112
113 ContentShellActivity activity = launchContentShellWithUrl(urlLoadTime); 113 ContentShellActivity activity = launchContentShellWithUrl(urlLoadTime);
114 waitForActiveShellToBeDoneLoading(); 114 waitForActiveShellToBeDoneLoading();
115 ContentViewCore contentViewCore = activity.getActiveContentViewCore(); 115 ContentViewCore contentViewCore = activity.getActiveContentViewCore();
116 TestCallbackHelperContainer testCallbackHelperContainer = 116 TestCallbackHelperContainer testCallbackHelperContainer =
117 new TestCallbackHelperContainer(contentViewCore); 117 new TestCallbackHelperContainer(contentViewCore);
118 OnEvaluateJavaScriptResultHelper javascriptHelper = new OnEvaluateJavaSc riptResultHelper(); 118 OnEvaluateJavaScriptResultHelper javascriptHelper = new OnEvaluateJavaSc riptResultHelper();
119 119
120 // Grab the first timestamp. 120 // Grab the first timestamp.
121 javascriptHelper.evaluateJavaScriptForTests( 121 javascriptHelper.evaluateJavaScript(contentViewCore.getWebContents(), "g etLoadtime();");
122 contentViewCore.getWebContents(), "getLoadtime();");
123 javascriptHelper.waitUntilHasValue(); 122 javascriptHelper.waitUntilHasValue();
124 String firstTimestamp = javascriptHelper.getJsonResultAndClear(); 123 String firstTimestamp = javascriptHelper.getJsonResultAndClear();
125 assertNotNull("Timestamp was null.", firstTimestamp); 124 assertNotNull("Timestamp was null.", firstTimestamp);
126 125
127 // Grab the timestamp after a reload and make sure they don't match. 126 // Grab the timestamp after a reload and make sure they don't match.
128 reload(contentViewCore.getWebContents().getNavigationController(), 127 reload(contentViewCore.getWebContents().getNavigationController(),
129 testCallbackHelperContainer); 128 testCallbackHelperContainer);
130 javascriptHelper.evaluateJavaScriptForTests( 129 javascriptHelper.evaluateJavaScript(contentViewCore.getWebContents(), "g etLoadtime();");
131 contentViewCore.getWebContents(), "getLoadtime();");
132 javascriptHelper.waitUntilHasValue(); 130 javascriptHelper.waitUntilHasValue();
133 String secondTimestamp = javascriptHelper.getJsonResultAndClear(); 131 String secondTimestamp = javascriptHelper.getJsonResultAndClear();
134 assertNotNull("Timestamp was null.", secondTimestamp); 132 assertNotNull("Timestamp was null.", secondTimestamp);
135 assertFalse("Timestamps matched.", firstTimestamp.equals(secondTimestamp )); 133 assertFalse("Timestamps matched.", firstTimestamp.equals(secondTimestamp ));
136 } 134 }
137 } 135 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698