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

Side by Side Diff: media/audio/android/audio_android_unittest.cc

Issue 2361203002: Remove calls to MessageLoop::Run/RunUntilIdle. (Closed)
Patch Set: CR jochen #6 Created 4 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
« no previous file with comments | « ios/web/public/test/web_test_with_web_state.mm ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <stdint.h> 5 #include <stdint.h>
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "base/android/build_info.h" 9 #include "base/android/build_info.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after
414 }; 414 };
415 415
416 // Test fixture class for tests which only exercise the output path. 416 // Test fixture class for tests which only exercise the output path.
417 class AudioAndroidOutputTest : public testing::Test { 417 class AudioAndroidOutputTest : public testing::Test {
418 public: 418 public:
419 AudioAndroidOutputTest() 419 AudioAndroidOutputTest()
420 : loop_(new base::MessageLoopForUI()), 420 : loop_(new base::MessageLoopForUI()),
421 audio_manager_(AudioManager::CreateForTesting(loop_->task_runner())), 421 audio_manager_(AudioManager::CreateForTesting(loop_->task_runner())),
422 audio_output_stream_(NULL) { 422 audio_output_stream_(NULL) {
423 // Flush the message loop to ensure that AudioManager is fully initialized. 423 // Flush the message loop to ensure that AudioManager is fully initialized.
424 loop_->RunUntilIdle(); 424 base::RunLoop().RunUntilIdle();
425 } 425 }
426 426
427 ~AudioAndroidOutputTest() override { 427 ~AudioAndroidOutputTest() override {
428 audio_manager_.reset(); 428 audio_manager_.reset();
429 loop_->RunUntilIdle(); 429 base::RunLoop().RunUntilIdle();
430 } 430 }
431 431
432 protected: 432 protected:
433 AudioManager* audio_manager() { return audio_manager_.get(); } 433 AudioManager* audio_manager() { return audio_manager_.get(); }
434 const AudioParameters& audio_output_parameters() { 434 const AudioParameters& audio_output_parameters() {
435 return audio_output_parameters_; 435 return audio_output_parameters_;
436 } 436 }
437 437
438 // Synchronously runs the provided callback/closure on the audio thread. 438 // Synchronously runs the provided callback/closure on the audio thread.
439 void RunOnAudioThread(const base::Closure& closure) { 439 void RunOnAudioThread(const base::Closure& closure) {
(...skipping 531 matching lines...) Expand 10 before | Expand all | Expand 10 after
971 base::PlatformThread::Sleep(base::TimeDelta::FromSeconds(20)); 971 base::PlatformThread::Sleep(base::TimeDelta::FromSeconds(20));
972 printf("\n"); 972 printf("\n");
973 StopAndCloseAudioOutputStreamOnAudioThread(); 973 StopAndCloseAudioOutputStreamOnAudioThread();
974 StopAndCloseAudioInputStreamOnAudioThread(); 974 StopAndCloseAudioInputStreamOnAudioThread();
975 } 975 }
976 976
977 INSTANTIATE_TEST_CASE_P(AudioAndroidInputTest, AudioAndroidInputTest, 977 INSTANTIATE_TEST_CASE_P(AudioAndroidInputTest, AudioAndroidInputTest,
978 testing::ValuesIn(RunAudioRecordInputPathTests())); 978 testing::ValuesIn(RunAudioRecordInputPathTests()));
979 979
980 } // namespace media 980 } // namespace media
OLDNEW
« no previous file with comments | « ios/web/public/test/web_test_with_web_state.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698