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

Side by Side Diff: base/message_pump_glib_unittest.cc

Issue 9034032: And now NewRunnableMethod(), you die. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix chrome_frame_automation Created 8 years, 11 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
« no previous file with comments | « base/message_loop_unittest.cc ('k') | base/task.h » ('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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "base/message_pump_glib.h" 5 #include "base/message_pump_glib.h"
6 6
7 #include <math.h> 7 #include <math.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <vector> 10 #include <vector>
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 EventInjector* injector() const { return injector_; } 181 EventInjector* injector() const { return injector_; }
182 182
183 private: 183 private:
184 MessageLoop* loop_; 184 MessageLoop* loop_;
185 EventInjector* injector_; 185 EventInjector* injector_;
186 DISALLOW_COPY_AND_ASSIGN(MessagePumpGLibTest); 186 DISALLOW_COPY_AND_ASSIGN(MessagePumpGLibTest);
187 }; 187 };
188 188
189 } // namespace 189 } // namespace
190 190
191 // EventInjector is expected to always live longer than the runnable methods.
192 DISABLE_RUNNABLE_METHOD_REFCOUNT(EventInjector);
193
194 TEST_F(MessagePumpGLibTest, TestQuit) { 191 TEST_F(MessagePumpGLibTest, TestQuit) {
195 // Checks that Quit works and that the basic infrastructure is working. 192 // Checks that Quit works and that the basic infrastructure is working.
196 193
197 // Quit from a task 194 // Quit from a task
198 loop()->PostTask(FROM_HERE, MessageLoop::QuitClosure()); 195 loop()->PostTask(FROM_HERE, MessageLoop::QuitClosure());
199 loop()->Run(); 196 loop()->Run();
200 EXPECT_EQ(0, injector()->processed_events()); 197 EXPECT_EQ(0, injector()->processed_events());
201 198
202 injector()->Reset(); 199 injector()->Reset();
203 // Quit from an event 200 // Quit from an event
(...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after
563 TEST_F(MessagePumpGLibTest, TestGtkLoop) { 560 TEST_F(MessagePumpGLibTest, TestGtkLoop) {
564 // Tests that events and posted tasks are correctly executed if the message 561 // Tests that events and posted tasks are correctly executed if the message
565 // loop is not run by MessageLoop::Run() but by a straight Gtk loop. 562 // loop is not run by MessageLoop::Run() but by a straight Gtk loop.
566 // Note that in this case we don't make strong guarantees about niceness 563 // Note that in this case we don't make strong guarantees about niceness
567 // between events and posted tasks. 564 // between events and posted tasks.
568 loop()->PostTask( 565 loop()->PostTask(
569 FROM_HERE, 566 FROM_HERE,
570 base::Bind(&TestGtkLoopInternal, base::Unretained(injector()))); 567 base::Bind(&TestGtkLoopInternal, base::Unretained(injector())));
571 loop()->Run(); 568 loop()->Run();
572 } 569 }
OLDNEW
« no previous file with comments | « base/message_loop_unittest.cc ('k') | base/task.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698