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

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

Issue 10890023: Miscellaneous cleanups from several months ago I never got around to landing. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 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 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 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 type, source); 217 type, source);
218 } 218 }
219 219
220 void WaitForTabOpenOrCloseForBrowser(const Browser* browser, 220 void WaitForTabOpenOrCloseForBrowser(const Browser* browser,
221 int expected_tab_count) { 221 int expected_tab_count) {
222 int tab_count = browser->tab_count(); 222 int tab_count = browser->tab_count();
223 if (tab_count == expected_tab_count) 223 if (tab_count == expected_tab_count)
224 return; 224 return;
225 225
226 content::NotificationRegistrar registrar; 226 content::NotificationRegistrar registrar;
227 registrar.Add( 227 registrar.Add(this,
228 this, 228 (tab_count < expected_tab_count) ?
229 tab_count < expected_tab_count 229 static_cast<int>(chrome::NOTIFICATION_TAB_PARENTED) :
230 ? static_cast<int>(chrome::NOTIFICATION_TAB_PARENTED) 230 static_cast<int>(content::NOTIFICATION_WEB_CONTENTS_DESTROYED),
231 : static_cast<int>(content::NOTIFICATION_WEB_CONTENTS_DESTROYED),
232 content::NotificationService::AllSources()); 231 content::NotificationService::AllSources());
233 232
234 while (!HasFailure() && browser->tab_count() != expected_tab_count) 233 while (!HasFailure() && browser->tab_count() != expected_tab_count)
235 content::RunMessageLoop(); 234 content::RunMessageLoop();
236 235
237 ASSERT_EQ(expected_tab_count, browser->tab_count()); 236 ASSERT_EQ(expected_tab_count, browser->tab_count());
238 } 237 }
239 238
240 void WaitForTabOpenOrClose(int expected_tab_count) { 239 void WaitForTabOpenOrClose(int expected_tab_count) {
241 WaitForTabOpenOrCloseForBrowser(browser(), expected_tab_count); 240 WaitForTabOpenOrCloseForBrowser(browser(), expected_tab_count);
(...skipping 1429 matching lines...) Expand 10 before | Expand all | Expand 10 after
1671 1670
1672 // Middle-clicking shouldn't select all the text either. 1671 // Middle-clicking shouldn't select all the text either.
1673 ASSERT_NO_FATAL_FAILURE( 1672 ASSERT_NO_FATAL_FAILURE(
1674 ClickFocusViewOrigin(ui_controls::LEFT, kClickOffset, kClickOffset)); 1673 ClickFocusViewOrigin(ui_controls::LEFT, kClickOffset, kClickOffset));
1675 ASSERT_NO_FATAL_FAILURE(ClickBrowserWindowCenter()); 1674 ASSERT_NO_FATAL_FAILURE(ClickBrowserWindowCenter());
1676 ASSERT_NO_FATAL_FAILURE( 1675 ASSERT_NO_FATAL_FAILURE(
1677 ClickFocusViewOrigin(ui_controls::MIDDLE, kClickOffset, kClickOffset)); 1676 ClickFocusViewOrigin(ui_controls::MIDDLE, kClickOffset, kClickOffset));
1678 EXPECT_FALSE(omnibox_view->IsSelectAll()); 1677 EXPECT_FALSE(omnibox_view->IsSelectAll());
1679 } 1678 }
1680 #endif // defined(USE_AURA) 1679 #endif // defined(USE_AURA)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698