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

Side by Side Diff: base/message_pump_glib_unittest.cc

Issue 251012: Assert that thread-safe reference counting is used with... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 11 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | base/ref_counted.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Property Changes:
Added: svn:eol-style
+ LF
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 EventInjector* injector_; 178 EventInjector* injector_;
179 DISALLOW_COPY_AND_ASSIGN(MessagePumpGLibTest); 179 DISALLOW_COPY_AND_ASSIGN(MessagePumpGLibTest);
180 }; 180 };
181 181
182 } // namespace 182 } // namespace
183 183
184 // EventInjector is expected to always live longer than the runnable methods. 184 // EventInjector is expected to always live longer than the runnable methods.
185 // This lets us call NewRunnableMethod on EventInjector instances. 185 // This lets us call NewRunnableMethod on EventInjector instances.
186 template<> 186 template<>
187 struct RunnableMethodTraits<EventInjector> { 187 struct RunnableMethodTraits<EventInjector> {
188 static void RetainCallee(EventInjector* obj) { } 188 void RetainCallee(EventInjector* obj) { }
189 static void ReleaseCallee(EventInjector* obj) { } 189 void ReleaseCallee(EventInjector* obj) { }
190 }; 190 };
191 191
192 TEST_F(MessagePumpGLibTest, TestQuit) { 192 TEST_F(MessagePumpGLibTest, TestQuit) {
193 // Checks that Quit works and that the basic infrastructure is working. 193 // Checks that Quit works and that the basic infrastructure is working.
194 194
195 // Quit from a task 195 // Quit from a task
196 loop()->PostTask(FROM_HERE, NewQuitTask()); 196 loop()->PostTask(FROM_HERE, NewQuitTask());
197 loop()->Run(); 197 loop()->Run();
198 EXPECT_EQ(0, injector()->processed_events()); 198 EXPECT_EQ(0, injector()->processed_events());
199 199
(...skipping 334 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
« no previous file with comments | « no previous file | base/ref_counted.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698