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/views/keyboard_access_browsertest.cc

Issue 10822030: Move ui_test_utils::RunMessageLoop to test_utils so that it can be reused by content_browsertests. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 5 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 // This functionality currently works on Windows and on Linux when 5 // This functionality currently works on Windows and on Linux when
6 // toolkit_views is defined (i.e. for Chrome OS). It's not needed 6 // toolkit_views is defined (i.e. for Chrome OS). It's not needed
7 // on the Mac, and it's not yet implemented on Linux. 7 // on the Mac, and it's not yet implemented on Linux.
8 8
9 #include "base/memory/weak_ptr.h" 9 #include "base/memory/weak_ptr.h"
10 #include "base/message_loop.h" 10 #include "base/message_loop.h"
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 // Call the focus change notification once in case the focus has 45 // Call the focus change notification once in case the focus has
46 // already changed. 46 // already changed.
47 OnWillChangeFocus(NULL, focus_manager_->GetFocusedView()); 47 OnWillChangeFocus(NULL, focus_manager_->GetFocusedView());
48 } 48 }
49 49
50 virtual ~ViewFocusChangeWaiter() { 50 virtual ~ViewFocusChangeWaiter() {
51 focus_manager_->RemoveFocusChangeListener(this); 51 focus_manager_->RemoveFocusChangeListener(this);
52 } 52 }
53 53
54 void Wait() { 54 void Wait() {
55 ui_test_utils::RunMessageLoop(); 55 content::RunMessageLoop();
56 } 56 }
57 57
58 private: 58 private:
59 // Inherited from FocusChangeListener 59 // Inherited from FocusChangeListener
60 virtual void OnWillChangeFocus(views::View* focused_before, 60 virtual void OnWillChangeFocus(views::View* focused_before,
61 views::View* focused_now) { 61 views::View* focused_now) {
62 } 62 }
63 63
64 virtual void OnDidChangeFocus(views::View* focused_before, 64 virtual void OnDidChangeFocus(views::View* focused_before,
65 views::View* focused_now) { 65 views::View* focused_now) {
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
255 browser(), url, NEW_FOREGROUND_TAB, 255 browser(), url, NEW_FOREGROUND_TAB,
256 ui_test_utils::BROWSER_TEST_WAIT_FOR_NAVIGATION); 256 ui_test_utils::BROWSER_TEST_WAIT_FOR_NAVIGATION);
257 ASSERT_EQ(2, browser()->active_index()); 257 ASSERT_EQ(2, browser()->active_index());
258 258
259 ASSERT_TRUE(ui_test_utils::SendKeyPressSync( 259 ASSERT_TRUE(ui_test_utils::SendKeyPressSync(
260 browser(), ui::VKEY_W, true, false, false, false)); 260 browser(), ui::VKEY_W, true, false, false, false));
261 ASSERT_EQ(0, browser()->active_index()); 261 ASSERT_EQ(0, browser()->active_index());
262 } 262 }
263 263
264 } // namespace 264 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698