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

Side by Side Diff: content/renderer/device_sensors/device_motion_event_pump_unittest.cc

Issue 1398153002: Don't use base::MessageLoop::{Quit,QuitClosure} in content/ (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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "device_motion_event_pump.h" 5 #include "device_motion_event_pump.h"
6 6
7 #include "base/location.h" 7 #include "base/location.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/single_thread_task_runner.h" 10 #include "base/single_thread_task_runner.h"
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 186
187 base::MessageLoopForUI loop; 187 base::MessageLoopForUI loop;
188 188
189 InitBuffer(true); 189 InitBuffer(true);
190 190
191 motion_pump()->set_stop_on_fire_event(false); 191 motion_pump()->set_stop_on_fire_event(false);
192 motion_pump()->Start(listener()); 192 motion_pump()->Start(listener());
193 motion_pump()->OnDidStart(handle()); 193 motion_pump()->OnDidStart(handle());
194 194
195 base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( 195 base::ThreadTaskRunnerHandle::Get()->PostDelayedTask(
196 FROM_HERE, base::MessageLoop::QuitClosure(), 196 FROM_HERE, base::MessageLoop::QuitWhenIdleClosure(),
197 base::TimeDelta::FromMilliseconds(100)); 197 base::TimeDelta::FromMilliseconds(100));
198 base::MessageLoop::current()->Run(); 198 base::MessageLoop::current()->Run();
199 motion_pump()->Stop(); 199 motion_pump()->Stop();
200 200
201 // Check that the blink::WebDeviceMotionListener does not receive excess 201 // Check that the blink::WebDeviceMotionListener does not receive excess
202 // events. 202 // events.
203 EXPECT_TRUE(listener()->did_change_device_motion()); 203 EXPECT_TRUE(listener()->did_change_device_motion());
204 EXPECT_GE(6, listener()->number_of_events()); 204 EXPECT_GE(6, listener()->number_of_events());
205 } 205 }
206 206
207 } // namespace content 207 } // namespace content
OLDNEW
« no previous file with comments | « content/public/test/test_utils.cc ('k') | content/renderer/gpu/render_widget_compositor_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698