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

Side by Side Diff: chrome/browser/ui/search/instant_test_utils.cc

Issue 302433013: Instant interactive_ui_tests should wait for main frame load. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: only change first wait to wait for frame load Created 6 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/ui/search/instant_test_utils.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #include "chrome/browser/ui/search/instant_test_utils.h" 5 #include "chrome/browser/ui/search/instant_test_utils.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/prefs/pref_service.h" 8 #include "base/prefs/pref_service.h"
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "chrome/browser/chrome_notification_types.h" 10 #include "chrome/browser/chrome_notification_types.h"
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 } 111 }
112 112
113 void InstantTestBase::PressEnterAndWaitForNavigation() { 113 void InstantTestBase::PressEnterAndWaitForNavigation() {
114 content::WindowedNotificationObserver nav_observer( 114 content::WindowedNotificationObserver nav_observer(
115 content::NOTIFICATION_NAV_ENTRY_COMMITTED, 115 content::NOTIFICATION_NAV_ENTRY_COMMITTED,
116 content::NotificationService::AllSources()); 116 content::NotificationService::AllSources());
117 browser_->window()->GetLocationBar()->AcceptInput(); 117 browser_->window()->GetLocationBar()->AcceptInput();
118 nav_observer.Wait(); 118 nav_observer.Wait();
119 } 119 }
120 120
121 void InstantTestBase::PressEnterAndWaitForFrameLoad() {
122 content::WindowedNotificationObserver nav_observer(
123 content::NOTIFICATION_LOAD_COMPLETED_MAIN_FRAME,
124 content::NotificationService::AllSources());
125 browser_->window()->GetLocationBar()->AcceptInput();
126 nav_observer.Wait();
127 }
128
121 bool InstantTestBase::GetBoolFromJS(content::WebContents* contents, 129 bool InstantTestBase::GetBoolFromJS(content::WebContents* contents,
122 const std::string& script, 130 const std::string& script,
123 bool* result) { 131 bool* result) {
124 return content::ExecuteScriptAndExtractBool( 132 return content::ExecuteScriptAndExtractBool(
125 contents, WrapScript(script), result); 133 contents, WrapScript(script), result);
126 } 134 }
127 135
128 bool InstantTestBase::GetIntFromJS(content::WebContents* contents, 136 bool InstantTestBase::GetIntFromJS(content::WebContents* contents,
129 const std::string& script, 137 const std::string& script,
130 int* result) { 138 int* result) {
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 return content::ExecuteScriptAndExtractBool(rvh, js_chrome, loaded); 171 return content::ExecuteScriptAndExtractBool(rvh, js_chrome, loaded);
164 } 172 }
165 173
166 base::string16 InstantTestBase::GetBlueText() { 174 base::string16 InstantTestBase::GetBlueText() {
167 size_t start = 0, end = 0; 175 size_t start = 0, end = 0;
168 omnibox()->GetSelectionBounds(&start, &end); 176 omnibox()->GetSelectionBounds(&start, &end);
169 if (start > end) 177 if (start > end)
170 std::swap(start, end); 178 std::swap(start, end);
171 return omnibox()->GetText().substr(start, end - start); 179 return omnibox()->GetText().substr(start, end - start);
172 } 180 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/search/instant_test_utils.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698