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

Side by Side Diff: base/message_loop/message_loop_task_runner_unittest.cc

Issue 2211473003: Remove calls to deprecated MessageLoop methods on Windows and Linux. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 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
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 "base/message_loop/message_loop_task_runner.h" 5 #include "base/message_loop/message_loop_task_runner.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "base/atomic_sequence_num.h" 9 #include "base/atomic_sequence_num.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 19 matching lines...) Expand all
30 30
31 void DeleteCurrentMessageLoop() { current_loop_.reset(); } 31 void DeleteCurrentMessageLoop() { current_loop_.reset(); }
32 32
33 protected: 33 protected:
34 void SetUp() override { 34 void SetUp() override {
35 // Use SetUp() instead of the constructor to avoid posting a task to a 35 // Use SetUp() instead of the constructor to avoid posting a task to a
36 // partially constructed object. 36 // partially constructed object.
37 task_thread_.Start(); 37 task_thread_.Start();
38 38
39 // Allow us to pause the |task_thread_|'s MessageLoop. 39 // Allow us to pause the |task_thread_|'s MessageLoop.
40 task_thread_.message_loop()->task_runner()->PostTask( 40 task_thread_.task_runner()->PostTask(
41 FROM_HERE, Bind(&MessageLoopTaskRunnerTest::BlockTaskThreadHelper, 41 FROM_HERE, Bind(&MessageLoopTaskRunnerTest::BlockTaskThreadHelper,
42 Unretained(this))); 42 Unretained(this)));
43 } 43 }
44 44
45 void TearDown() override { 45 void TearDown() override {
46 // Make sure the |task_thread_| is not blocked, and stop the thread 46 // Make sure the |task_thread_| is not blocked, and stop the thread
47 // fully before destruction because its tasks may still depend on the 47 // fully before destruction because its tasks may still depend on the
48 // |thread_sync_| event. 48 // |thread_sync_| event.
49 thread_sync_.Signal(); 49 thread_sync_.Signal();
50 task_thread_.Stop(); 50 task_thread_.Stop();
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after
353 new Thread("MessageLoopTaskRunnerThreadingTest_Dummy")); 353 new Thread("MessageLoopTaskRunnerThreadingTest_Dummy"));
354 test_thread->Start(); 354 test_thread->Start();
355 task_runner = test_thread->task_runner(); 355 task_runner = test_thread->task_runner();
356 } 356 }
357 bool ret = task_runner->PostTask( 357 bool ret = task_runner->PostTask(
358 FROM_HERE, Bind(&MessageLoopTaskRunnerThreadingTest::AssertNotRun)); 358 FROM_HERE, Bind(&MessageLoopTaskRunnerThreadingTest::AssertNotRun));
359 EXPECT_FALSE(ret); 359 EXPECT_FALSE(ret);
360 } 360 }
361 361
362 } // namespace base 362 } // namespace base
OLDNEW
« no previous file with comments | « base/memory/memory_pressure_monitor_win_unittest.cc ('k') | base/message_loop/message_loop_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698