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

Side by Side Diff: base/message_pump_glib_unittest.cc

Issue 7529003: Make base::MessageLoops have names at construction time (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add name argument to MessageLoop Created 9 years, 4 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) 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 <gtk/gtk.h> 7 #include <gtk/gtk.h>
8 #include <math.h> 8 #include <math.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 Task* task) { 149 Task* task) {
150 MessageLoop::current()->PostTask(from_here, task); 150 MessageLoop::current()->PostTask(from_here, task);
151 } 151 }
152 152
153 // Test fixture. 153 // Test fixture.
154 class MessagePumpGLibTest : public testing::Test { 154 class MessagePumpGLibTest : public testing::Test {
155 public: 155 public:
156 MessagePumpGLibTest() : loop_(NULL), injector_(NULL) { } 156 MessagePumpGLibTest() : loop_(NULL), injector_(NULL) { }
157 157
158 virtual void SetUp() { 158 virtual void SetUp() {
159 loop_ = new MessageLoop(MessageLoop::TYPE_UI); 159 loop_ = new MessageLoop("MessagePumpGLibTest", MessageLoop::TYPE_UI);
160 injector_ = new EventInjector(); 160 injector_ = new EventInjector();
161 } 161 }
162 162
163 virtual void TearDown() { 163 virtual void TearDown() {
164 delete injector_; 164 delete injector_;
165 injector_ = NULL; 165 injector_ = NULL;
166 delete loop_; 166 delete loop_;
167 loop_ = NULL; 167 loop_ = NULL;
168 } 168 }
169 169
(...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after
534 534
535 TEST_F(MessagePumpGLibTest, TestGtkLoop) { 535 TEST_F(MessagePumpGLibTest, TestGtkLoop) {
536 // Tests that events and posted tasks are correctly exectuted if the message 536 // Tests that events and posted tasks are correctly exectuted if the message
537 // loop is not run by MessageLoop::Run() but by a straight Gtk loop. 537 // loop is not run by MessageLoop::Run() but by a straight Gtk loop.
538 // Note that in this case we don't make strong guarantees about niceness 538 // Note that in this case we don't make strong guarantees about niceness
539 // between events and posted tasks. 539 // between events and posted tasks.
540 loop()->PostTask(FROM_HERE, 540 loop()->PostTask(FROM_HERE,
541 NewRunnableFunction(TestGtkLoopInternal, injector())); 541 NewRunnableFunction(TestGtkLoopInternal, injector()));
542 loop()->Run(); 542 loop()->Run();
543 } 543 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698