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

Side by Side Diff: chrome/browser/browser_keyevents_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 #include "build/build_config.h" 5 #include "build/build_config.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "base/stringprintf.h" 10 #include "base/stringprintf.h"
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 public: 92 public:
93 explicit TestFinishObserver(RenderViewHost* render_view_host) 93 explicit TestFinishObserver(RenderViewHost* render_view_host)
94 : finished_(false), waiting_(false) { 94 : finished_(false), waiting_(false) {
95 registrar_.Add(this, content::NOTIFICATION_DOM_OPERATION_RESPONSE, 95 registrar_.Add(this, content::NOTIFICATION_DOM_OPERATION_RESPONSE,
96 content::Source<RenderViewHost>(render_view_host)); 96 content::Source<RenderViewHost>(render_view_host));
97 } 97 }
98 98
99 bool WaitForFinish() { 99 bool WaitForFinish() {
100 if (!finished_) { 100 if (!finished_) {
101 waiting_ = true; 101 waiting_ = true;
102 ui_test_utils::RunMessageLoop(); 102 content::RunMessageLoop();
103 waiting_ = false; 103 waiting_ = false;
104 } 104 }
105 return finished_; 105 return finished_;
106 } 106 }
107 107
108 virtual void Observe(int type, 108 virtual void Observe(int type,
109 const content::NotificationSource& source, 109 const content::NotificationSource& source,
110 const content::NotificationDetails& details) { 110 const content::NotificationDetails& details) {
111 DCHECK(type == content::NOTIFICATION_DOM_OPERATION_RESPONSE); 111 DCHECK(type == content::NOTIFICATION_DOM_OPERATION_RESPONSE);
112 content::Details<DomOperationNotificationDetails> dom_op_details(details); 112 content::Details<DomOperationNotificationDetails> dom_op_details(details);
(...skipping 769 matching lines...) Expand 10 before | Expand all | Expand 10 after
882 EXPECT_NO_FATAL_FAILURE(TestKeyEvent(tab_index, kTestAltKeySuppress)); 882 EXPECT_NO_FATAL_FAILURE(TestKeyEvent(tab_index, kTestAltKeySuppress));
883 ASSERT_TRUE(IsViewFocused(VIEW_ID_TAB_CONTAINER)); 883 ASSERT_TRUE(IsViewFocused(VIEW_ID_TAB_CONTAINER));
884 884
885 // Ctrl+Alt should have no effect. 885 // Ctrl+Alt should have no effect.
886 EXPECT_NO_FATAL_FAILURE(TestKeyEvent(tab_index, kTestCtrlAltKey)); 886 EXPECT_NO_FATAL_FAILURE(TestKeyEvent(tab_index, kTestCtrlAltKey));
887 ASSERT_TRUE(IsViewFocused(VIEW_ID_TAB_CONTAINER)); 887 ASSERT_TRUE(IsViewFocused(VIEW_ID_TAB_CONTAINER));
888 } 888 }
889 #endif 889 #endif
890 890
891 } // namespace 891 } // namespace
OLDNEW
« no previous file with comments | « chrome/browser/browser_focus_uitest.cc ('k') | chrome/browser/browsing_data/browsing_data_database_helper_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698