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

Side by Side Diff: chrome/android/javatests/src/org/chromium/chrome/browser/HistoryUITest.java

Issue 1381003004: Better distinguish didFinishLoad and didStopLoading (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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.chrome.browser; 5 package org.chromium.chrome.browser;
6 6
7 import android.app.Dialog; 7 import android.app.Dialog;
8 import android.support.v7.app.AlertDialog; 8 import android.support.v7.app.AlertDialog;
9 import android.test.FlakyTest; 9 import android.test.FlakyTest;
10 import android.util.JsonReader; 10 import android.util.JsonReader;
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 loadUrl(TestHttpServerClient.getUrl("chrome/test/data/android/get_title_ test.html")); 172 loadUrl(TestHttpServerClient.getUrl("chrome/test/data/android/get_title_ test.html"));
173 loadUrl(HISTORY_URL); 173 loadUrl(HISTORY_URL);
174 UiUtils.settleDownUI(getInstrumentation()); 174 UiUtils.settleDownUI(getInstrumentation());
175 assertResultCountReaches(getActivity().getCurrentContentViewCore(), 2); 175 assertResultCountReaches(getActivity().getCurrentContentViewCore(), 2);
176 176
177 // Search for one of them. 177 // Search for one of them.
178 Tab tab = getActivity().getActivityTab(); 178 Tab tab = getActivity().getActivityTab();
179 final CallbackHelper loadCallback = new CallbackHelper(); 179 final CallbackHelper loadCallback = new CallbackHelper();
180 TabObserver observer = new EmptyTabObserver() { 180 TabObserver observer = new EmptyTabObserver() {
181 @Override 181 @Override
182 public void onLoadStopped(Tab tab) { 182 public void onLoadStopped(Tab tab, boolean toDifferentDocument) {
183 if (tab.getUrl().startsWith(HISTORY_URL)) { 183 if (tab.getUrl().startsWith(HISTORY_URL)) {
184 loadCallback.notifyCalled(); 184 loadCallback.notifyCalled();
185 } 185 }
186 } 186 }
187 }; 187 };
188 tab.addObserver(observer); 188 tab.addObserver(observer);
189 runJavaScriptCodeInCurrentTab("historyView.setSearch('about')"); 189 runJavaScriptCodeInCurrentTab("historyView.setSearch('about')");
190 loadCallback.waitForCallback(0); 190 loadCallback.waitForCallback(0);
191 assertResultCountReaches(getActivity().getCurrentContentViewCore(), 1); 191 assertResultCountReaches(getActivity().getCurrentContentViewCore(), 1);
192 192
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
307 public boolean isSatisfied() { 307 public boolean isSatisfied() {
308 return mainActivity.getActivityTab() != null 308 return mainActivity.getActivityTab() != null
309 && !mainActivity.getActivityTab().isFrozen(); 309 && !mainActivity.getActivityTab().isFrozen();
310 } 310 }
311 })); 311 }));
312 JavaScriptUtils.executeJavaScriptAndWaitForResult( 312 JavaScriptUtils.executeJavaScriptAndWaitForResult(
313 mainActivity.getCurrentContentViewCore().getWebContents(), "relo adHistory()"); 313 mainActivity.getCurrentContentViewCore().getWebContents(), "relo adHistory()");
314 assertResultCountReaches(getActivity().getCurrentContentViewCore(), 0); 314 assertResultCountReaches(getActivity().getCurrentContentViewCore(), 0);
315 } 315 }
316 } 316 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698