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

Side by Side Diff: chrome/browser/ui/omnibox/omnibox_view_browsertest.cc

Issue 10825085: Move RunAllPendingInMessageLoop from ui_test_utils.h to test_utils.h, so that it can be reused by c… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 4 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 #include <stdio.h> 5 #include <stdio.h>
6 6
7 #include "base/message_loop.h" 7 #include "base/message_loop.h"
8 #include "base/string16.h" 8 #include "base/string16.h"
9 #include "base/string_util.h" 9 #include "base/string_util.h"
10 #include "base/time.h" 10 #include "base/time.h"
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after
334 { 334 {
335 content::NotificationRegistrar registrar; 335 content::NotificationRegistrar registrar;
336 registrar.Add(this, chrome::NOTIFICATION_HISTORY_URLS_MODIFIED, 336 registrar.Add(this, chrome::NOTIFICATION_HISTORY_URLS_MODIFIED,
337 content::Source<Profile>(profile)); 337 content::Source<Profile>(profile));
338 content::RunMessageLoop(); 338 content::RunMessageLoop();
339 // We don't want to return until all observers have processed this 339 // We don't want to return until all observers have processed this
340 // notification, because some (e.g. the in-memory history database) may do 340 // notification, because some (e.g. the in-memory history database) may do
341 // something important. Since we don't know where in the observer list we 341 // something important. Since we don't know where in the observer list we
342 // stand, just spin the message loop once more to allow the current 342 // stand, just spin the message loop once more to allow the current
343 // callstack to complete. 343 // callstack to complete.
344 ui_test_utils::RunAllPendingInMessageLoop(); 344 content::RunAllPendingInMessageLoop();
345 } 345 }
346 } 346 }
347 347
348 void SetupHistory() { 348 void SetupHistory() {
349 // Add enough history pages containing |kSearchText| to trigger 349 // Add enough history pages containing |kSearchText| to trigger
350 // open history page url in autocomplete result. 350 // open history page url in autocomplete result.
351 for (size_t i = 0; i < arraysize(kHistoryEntries); i++) { 351 for (size_t i = 0; i < arraysize(kHistoryEntries); i++) {
352 // Add everything in order of time. We don't want to have a time that 352 // Add everything in order of time. We don't want to have a time that
353 // is "right now" or it will nondeterministically appear in the results. 353 // is "right now" or it will nondeterministically appear in the results.
354 Time t = Time::Now() - TimeDelta::FromHours(i + 1); 354 Time t = Time::Now() - TimeDelta::FromHours(i + 1);
(...skipping 1314 matching lines...) Expand 10 before | Expand all | Expand 10 after
1669 1669
1670 // Middle-clicking shouldn't select all the text either. 1670 // Middle-clicking shouldn't select all the text either.
1671 ASSERT_NO_FATAL_FAILURE( 1671 ASSERT_NO_FATAL_FAILURE(
1672 ClickFocusViewOrigin(ui_controls::LEFT, kClickOffset, kClickOffset)); 1672 ClickFocusViewOrigin(ui_controls::LEFT, kClickOffset, kClickOffset));
1673 ASSERT_NO_FATAL_FAILURE(ClickBrowserWindowCenter()); 1673 ASSERT_NO_FATAL_FAILURE(ClickBrowserWindowCenter());
1674 ASSERT_NO_FATAL_FAILURE( 1674 ASSERT_NO_FATAL_FAILURE(
1675 ClickFocusViewOrigin(ui_controls::MIDDLE, kClickOffset, kClickOffset)); 1675 ClickFocusViewOrigin(ui_controls::MIDDLE, kClickOffset, kClickOffset));
1676 EXPECT_FALSE(omnibox_view->IsSelectAll()); 1676 EXPECT_FALSE(omnibox_view->IsSelectAll());
1677 } 1677 }
1678 #endif // defined(USE_AURA) 1678 #endif // defined(USE_AURA)
OLDNEW
« no previous file with comments | « chrome/browser/ui/login/login_prompt_browsertest.cc ('k') | chrome/browser/ui/tab_modal_confirm_dialog_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698