Improve Mojo permission service and chrome::PermissionManager observing.
[chromium-blink-merge.git] / media / audio / audio_unittest_util.cc
blob0ddf94ad35f625a30e0888e32a3f95fa32114b9f
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "media/audio/audio_unittest_util.h"
7 #include "base/command_line.h"
8 #include "base/logging.h"
9 #include "media/base/media_switches.h"
11 namespace media {
13 // For macro ABORT_AUDIO_TEST_IF_NOT.
14 bool ShouldAbortAudioTest(bool requirements_satisfied,
15 const char* requirements_expression,
16 bool* should_fail) {
17 bool fail_if_unsatisfied = base::CommandLine::ForCurrentProcess()->HasSwitch(
18 switches::kRequireAudioHardwareForTesting);
19 if (!requirements_satisfied) {
20 LOG(WARNING) << "Requirement(s) not satisfied (" << requirements_expression
21 << ")";
22 *should_fail = fail_if_unsatisfied;
23 return true;
25 *should_fail = false;
26 return false;
29 } // namespace media