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

Unified Diff: chrome/test/base/ui_test_utils.cc

Issue 2300323003: Adding performance tests for HQP that represent importance of optimising HistoryItemsForTerms method (Closed)
Patch Set: Created 4 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/test/base/ui_test_utils.h ('k') | components/omnibox/browser/autocomplete_controller.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/base/ui_test_utils.cc
diff --git a/chrome/test/base/ui_test_utils.cc b/chrome/test/base/ui_test_utils.cc
index b3f7143f9b7b0b5617207afad818d49cd7af1a81..0bfa673e888b0238126c0ab4c0f6952209c5d45a 100644
--- a/chrome/test/base/ui_test_utils.cc
+++ b/chrome/test/base/ui_test_utils.cc
@@ -317,6 +317,16 @@ app_modal::AppModalDialog* WaitForAppModalDialog() {
return waiter.Wait();
}
+void WaitForAutocompleteController(
+ const AutocompleteController& autocomplete_controller) {
+ while (!autocomplete_controller.done()) {
+ content::WindowedNotificationObserver ready_observer(
Paweł Hajdan Jr. 2016/09/06 14:22:10 Shouldn't the observer be instantiated before any
+ chrome::NOTIFICATION_AUTOCOMPLETE_CONTROLLER_RESULT_READY,
+ content::Source<AutocompleteController>(&autocomplete_controller));
+ ready_observer.Wait();
+ }
+}
+
int FindInPage(WebContents* tab,
const base::string16& search_string,
bool forward,
@@ -357,12 +367,7 @@ void SendToOmniboxAndSubmit(LocationBar* location_bar,
omnibox->model()->OnSetFocus(false);
omnibox->SetUserText(base::ASCIIToUTF16(input));
location_bar->AcceptInput();
- while (!omnibox->model()->autocomplete_controller()->done()) {
- content::WindowedNotificationObserver observer(
- chrome::NOTIFICATION_AUTOCOMPLETE_CONTROLLER_RESULT_READY,
- content::NotificationService::AllSources());
- observer.Wait();
- }
+ WaitForAutocompleteController(*omnibox->model()->autocomplete_controller());
}
Browser* GetBrowserNotInSet(const std::set<Browser*>& excluded_browsers) {
« no previous file with comments | « chrome/test/base/ui_test_utils.h ('k') | components/omnibox/browser/autocomplete_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698