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

Unified Diff: webrtc/base/platform_thread_unittest.cc

Issue 1476453002: Clean up PlatformThread. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: IsRunning DCHECK Created 5 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/base/platform_thread.cc ('k') | webrtc/base/signalthread.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/base/platform_thread_unittest.cc
diff --git a/webrtc/base/platform_thread_unittest.cc b/webrtc/base/platform_thread_unittest.cc
index ffb60b53243b6f30b9540bfe7171c5aaa32c0a19..f9db8e34a305f3fd821280f7549f942742632c78 100644
--- a/webrtc/base/platform_thread_unittest.cc
+++ b/webrtc/base/platform_thread_unittest.cc
@@ -23,10 +23,9 @@ bool NullRunFunction(void* obj) {
}
TEST(PlatformThreadTest, StartStop) {
- rtc::scoped_ptr<PlatformThread> thread = PlatformThread::CreateThread(
- &NullRunFunction, nullptr, "PlatformThreadTest");
- ASSERT_TRUE(thread->Start());
- EXPECT_TRUE(thread->Stop());
+ rtc::PlatformThread thread(&NullRunFunction, nullptr, "PlatformThreadTest");
+ thread.Start();
+ thread.Stop();
}
// Function that sets a boolean.
@@ -39,12 +38,11 @@ bool SetFlagRunFunction(void* obj) {
TEST(PlatformThreadTest, RunFunctionIsCalled) {
bool flag = false;
- rtc::scoped_ptr<PlatformThread> thread = PlatformThread::CreateThread(
- &SetFlagRunFunction, &flag, "RunFunctionIsCalled");
- ASSERT_TRUE(thread->Start());
+ rtc::PlatformThread thread(&SetFlagRunFunction, &flag, "RunFunctionIsCalled");
+ thread.Start();
// At this point, the flag may be either true or false.
- EXPECT_TRUE(thread->Stop());
+ thread.Stop();
// We expect the thread to have run at least once.
EXPECT_TRUE(flag);
« no previous file with comments | « webrtc/base/platform_thread.cc ('k') | webrtc/base/signalthread.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698