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

Unified Diff: media/audio/audio_unittest_util.cc

Issue 914483002: Add flag --require-audio-hardware-for-testing. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/audio/audio_unittest_util.h ('k') | media/audio/mac/audio_auhal_mac_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/audio/audio_unittest_util.cc
diff --git a/media/audio/audio_unittest_util.cc b/media/audio/audio_unittest_util.cc
new file mode 100644
index 0000000000000000000000000000000000000000..0ddf94ad35f625a30e0888e32a3f95fa32114b9f
--- /dev/null
+++ b/media/audio/audio_unittest_util.cc
@@ -0,0 +1,29 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "media/audio/audio_unittest_util.h"
+
+#include "base/command_line.h"
+#include "base/logging.h"
+#include "media/base/media_switches.h"
+
+namespace media {
+
+// For macro ABORT_AUDIO_TEST_IF_NOT.
+bool ShouldAbortAudioTest(bool requirements_satisfied,
+ const char* requirements_expression,
+ bool* should_fail) {
+ bool fail_if_unsatisfied = base::CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kRequireAudioHardwareForTesting);
+ if (!requirements_satisfied) {
+ LOG(WARNING) << "Requirement(s) not satisfied (" << requirements_expression
+ << ")";
+ *should_fail = fail_if_unsatisfied;
+ return true;
+ }
+ *should_fail = false;
+ return false;
+}
+
+} // namespace media
« no previous file with comments | « media/audio/audio_unittest_util.h ('k') | media/audio/mac/audio_auhal_mac_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698