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

Side by Side Diff: chrome/browser/browser_keyevents_browsertest.cc

Issue 1395103003: Don't use base::MessageLoop::{Quit,QuitClosure} in chrome/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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
« no previous file with comments | « chrome/browser/autofill/autofill_uitest_util.cc ('k') | chrome/browser/browser_process_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/strings/stringprintf.h" 10 #include "base/strings/stringprintf.h"
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 void Observe(int type, 110 void Observe(int type,
111 const content::NotificationSource& source, 111 const content::NotificationSource& source,
112 const content::NotificationDetails& details) override { 112 const content::NotificationDetails& details) override {
113 DCHECK(type == content::NOTIFICATION_DOM_OPERATION_RESPONSE); 113 DCHECK(type == content::NOTIFICATION_DOM_OPERATION_RESPONSE);
114 content::Details<std::string> dom_op_result(details); 114 content::Details<std::string> dom_op_result(details);
115 // We might receive responses for other script execution, but we only 115 // We might receive responses for other script execution, but we only
116 // care about the test finished message. 116 // care about the test finished message.
117 if (*dom_op_result.ptr() == "\"FINISHED\"") { 117 if (*dom_op_result.ptr() == "\"FINISHED\"") {
118 finished_ = true; 118 finished_ = true;
119 if (waiting_) 119 if (waiting_)
120 base::MessageLoopForUI::current()->Quit(); 120 base::MessageLoopForUI::current()->QuitWhenIdle();
121 } 121 }
122 } 122 }
123 123
124 private: 124 private:
125 bool finished_; 125 bool finished_;
126 bool waiting_; 126 bool waiting_;
127 content::NotificationRegistrar registrar_; 127 content::NotificationRegistrar registrar_;
128 128
129 DISALLOW_COPY_AND_ASSIGN(TestFinishObserver); 129 DISALLOW_COPY_AND_ASSIGN(TestFinishObserver);
130 }; 130 };
(...skipping 732 matching lines...) Expand 10 before | Expand all | Expand 10 after
863 EXPECT_NO_FATAL_FAILURE(TestKeyEvent(tab_index, kTestAltKeySuppress)); 863 EXPECT_NO_FATAL_FAILURE(TestKeyEvent(tab_index, kTestAltKeySuppress));
864 ASSERT_TRUE(IsViewFocused(VIEW_ID_TAB_CONTAINER)); 864 ASSERT_TRUE(IsViewFocused(VIEW_ID_TAB_CONTAINER));
865 865
866 // Ctrl+Alt should have no effect. 866 // Ctrl+Alt should have no effect.
867 EXPECT_NO_FATAL_FAILURE(TestKeyEvent(tab_index, kTestCtrlAltKey)); 867 EXPECT_NO_FATAL_FAILURE(TestKeyEvent(tab_index, kTestCtrlAltKey));
868 ASSERT_TRUE(IsViewFocused(VIEW_ID_TAB_CONTAINER)); 868 ASSERT_TRUE(IsViewFocused(VIEW_ID_TAB_CONTAINER));
869 } 869 }
870 #endif 870 #endif
871 871
872 } // namespace 872 } // namespace
OLDNEW
« no previous file with comments | « chrome/browser/autofill/autofill_uitest_util.cc ('k') | chrome/browser/browser_process_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698