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

Unified Diff: chrome/browser/media/chrome_webrtc_audio_quality_browsertest.cc

Issue 789023002: Update browser/media to use the new version of LaunchProcess. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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
Index: chrome/browser/media/chrome_webrtc_audio_quality_browsertest.cc
diff --git a/chrome/browser/media/chrome_webrtc_audio_quality_browsertest.cc b/chrome/browser/media/chrome_webrtc_audio_quality_browsertest.cc
index f0d5516f3220af8a195303c7bb4f8a04dc969eee..d59b99baa290852aea4128541af53cf8c39c5de2 100644
--- a/chrome/browser/media/chrome_webrtc_audio_quality_browsertest.cc
+++ b/chrome/browser/media/chrome_webrtc_audio_quality_browsertest.cc
@@ -7,6 +7,7 @@
#include "base/command_line.h"
#include "base/files/file_util.h"
#include "base/process/launch.h"
+#include "base/process/process.h"
#include "base/scoped_native_library.h"
#include "base/strings/stringprintf.h"
#include "chrome/browser/media/webrtc_browsertest_base.h"
@@ -174,14 +175,14 @@ class MAYBE_WebRtcAudioQualityBrowserTest : public WebRtcTestBase {
class AudioRecorder {
public:
- AudioRecorder(): recording_application_(base::kNullProcessHandle) {}
+ AudioRecorder() {}
~AudioRecorder() {}
// Starts the recording program for the specified duration. Returns true
// on success.
bool StartRecording(int duration_sec, const base::FilePath& output_file,
bool mono) {
- EXPECT_EQ(base::kNullProcessHandle, recording_application_)
+ EXPECT_FALSE(recording_application_.IsValid())
<< "Tried to record, but is already recording.";
CommandLine command_line(CommandLine::NO_PROGRAM);
@@ -244,18 +245,19 @@ class AudioRecorder {
#endif
DVLOG(0) << "Running " << command_line.GetCommandLineString();
- return base::LaunchProcess(command_line, base::LaunchOptions(),
- &recording_application_);
+ recording_application_ =
+ base::LaunchProcess(command_line, base::LaunchOptions());
+ return recording_application_.IsValid();
}
// Joins the recording program. Returns true on success.
bool WaitForRecordingToEnd() {
int exit_code = -1;
- base::WaitForExitCode(recording_application_, &exit_code);
+ recording_application_.WaitForExit(&exit_code);
return exit_code == 0;
}
private:
- base::ProcessHandle recording_application_;
+ base::Process recording_application_;
};
bool ForceMicrophoneVolumeTo100Percent() {
« no previous file with comments | « chrome/browser/media/chrome_webrtc_apprtc_browsertest.cc ('k') | chrome/browser/media/test_license_server.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698