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

Side by Side Diff: content/renderer/media/webrtc_local_audio_track_unittest.cc

Issue 1051863003: Turn ThreadPriority enum into an enum class. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@setthreadpri
Patch Set: nits Created 5 years, 8 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/synchronization/waitable_event.h" 5 #include "base/synchronization/waitable_event.h"
6 #include "base/test/test_timeouts.h" 6 #include "base/test/test_timeouts.h"
7 #include "content/public/renderer/media_stream_audio_sink.h" 7 #include "content/public/renderer/media_stream_audio_sink.h"
8 #include "content/renderer/media/media_stream_audio_source.h" 8 #include "content/renderer/media/media_stream_audio_source.h"
9 #include "content/renderer/media/mock_media_constraint_factory.h" 9 #include "content/renderer/media/mock_media_constraint_factory.h"
10 #include "content/renderer/media/webrtc/webrtc_local_audio_track_adapter.h" 10 #include "content/renderer/media/webrtc/webrtc_local_audio_track_adapter.h"
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 audio_bus_->Zero(); 59 audio_bus_->Zero();
60 callback->Capture(audio_bus_.get(), 0, 0, false); 60 callback->Capture(audio_bus_.get(), 0, 0, false);
61 61
62 // Sleep 1ms to yield the resource for the main thread. 62 // Sleep 1ms to yield the resource for the main thread.
63 base::PlatformThread::Sleep(base::TimeDelta::FromMilliseconds(1)); 63 base::PlatformThread::Sleep(base::TimeDelta::FromMilliseconds(1));
64 } 64 }
65 } 65 }
66 66
67 void Start() { 67 void Start() {
68 base::PlatformThread::CreateWithPriority( 68 base::PlatformThread::CreateWithPriority(
69 0, this, &thread_, base::kThreadPriority_RealtimeAudio); 69 0, this, &thread_, base::ThreadPriority::REALTIME_AUDIO);
70 CHECK(!thread_.is_null()); 70 CHECK(!thread_.is_null());
71 } 71 }
72 72
73 void Stop() { 73 void Stop() {
74 closure_.Signal(); 74 closure_.Signal();
75 base::PlatformThread::Join(thread_); 75 base::PlatformThread::Join(thread_);
76 thread_ = base::PlatformThreadHandle(); 76 thread_ = base::PlatformThreadHandle();
77 } 77 }
78 78
79 private: 79 private:
(...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after
507 // Stopping the new source will stop the second track. 507 // Stopping the new source will stop the second track.
508 EXPECT_CALL(*source.get(), OnStop()).Times(1); 508 EXPECT_CALL(*source.get(), OnStop()).Times(1);
509 capturer->Stop(); 509 capturer->Stop();
510 510
511 // Even though this test don't use |capturer_source_| it will be stopped 511 // Even though this test don't use |capturer_source_| it will be stopped
512 // during teardown of the test harness. 512 // during teardown of the test harness.
513 EXPECT_CALL(*capturer_source_.get(), OnStop()); 513 EXPECT_CALL(*capturer_source_.get(), OnStop());
514 } 514 }
515 515
516 } // namespace content 516 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/gpu/compositor_output_surface.cc ('k') | content/renderer/render_thread_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698