summaryrefslogtreecommitdiff
path: root/chromium/media/audio/audio_unittest_util.h
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@theqtcompany.com>2015-06-18 14:10:49 +0200
committerOswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>2015-06-18 13:53:24 +0000
commit813fbf95af77a531c57a8c497345ad2c61d475b3 (patch)
tree821b2c8de8365f21b6c9ba17a236fb3006a1d506 /chromium/media/audio/audio_unittest_util.h
parentaf6588f8d723931a298c995fa97259bb7f7deb55 (diff)
downloadqtwebengine-chromium-813fbf95af77a531c57a8c497345ad2c61d475b3.tar.gz
BASELINE: Update chromium to 44.0.2403.47
Change-Id: Ie056fedba95cf5e5c76b30c4b2c80fca4764aa2f Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Diffstat (limited to 'chromium/media/audio/audio_unittest_util.h')
-rw-r--r--chromium/media/audio/audio_unittest_util.h34
1 files changed, 34 insertions, 0 deletions
diff --git a/chromium/media/audio/audio_unittest_util.h b/chromium/media/audio/audio_unittest_util.h
new file mode 100644
index 00000000000..3bd0dfad676
--- /dev/null
+++ b/chromium/media/audio/audio_unittest_util.h
@@ -0,0 +1,34 @@
+// 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.
+
+#ifndef MEDIA_AUDIO_AUDIO_UNITTEST_UTIL_H_
+#define MEDIA_AUDIO_AUDIO_UNITTEST_UTIL_H_
+
+#include "testing/gtest/include/gtest/gtest.h"
+
+namespace media {
+
+// Use in tests to either skip or fail a test when the system is missing a
+// required audio device or library. If the --require-audio-hardware-for-testing
+// flag is set, missing requirements will cause the test to fail. Otherwise it
+// will be skipped.
+#define ABORT_AUDIO_TEST_IF_NOT(requirements_satisfied) \
+ do { \
+ bool fail = false; \
+ if (ShouldAbortAudioTest(requirements_satisfied, #requirements_satisfied, \
+ &fail)) { \
+ if (fail) \
+ FAIL(); \
+ else \
+ return; \
+ } \
+ } while (false)
+
+bool ShouldAbortAudioTest(bool requirements_satisfied,
+ const char* requirements_expression,
+ bool* should_fail);
+
+} // namespace media
+
+#endif // MEDIA_AUDIO_AUDIO_UNITTEST_UTIL_H_