[MediaRouter] Update MR-2-Extension's PostMessage to return boolean.
[chromium-blink-merge.git] / chromecast / media / cma / test / run_all_unittests.cc
blob133f8bed08b7aa897e037cc33cb43417f2800de4
1 // Copyright 2014 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 "base/bind.h"
6 #include "base/test/launcher/unit_test_launcher.h"
7 #include "base/test/test_suite.h"
8 #include "build/build_config.h"
9 #include "chromecast/base/metrics/cast_metrics_test_helper.h"
10 #include "media/base/media.h"
12 #if defined(OS_ANDROID)
13 #error "CMA not supported on Android"
14 #endif
16 class CmaTestSuite : public base::TestSuite {
17 public:
18 // Note: the base class constructor creates an AtExitManager.
19 CmaTestSuite(int argc, char** argv) : TestSuite(argc, argv) {}
20 ~CmaTestSuite() override {}
22 protected:
23 void Initialize() override;
26 void CmaTestSuite::Initialize() {
27 // Run TestSuite::Initialize first so that logging is initialized.
28 base::TestSuite::Initialize();
30 // Some of the chromecast media unit tests require a metrics helper instance.
31 // Provide a fake one.
32 chromecast::metrics::InitializeMetricsHelperForTesting();
34 // Initialize the FFMpeg library.
35 // Note: at this time, AtExitManager is already present.
36 media::InitializeMediaLibrary();
39 int main(int argc, char** argv) {
40 CmaTestSuite test_suite(argc, argv);
42 return base::LaunchUnitTests(
43 argc, argv, base::Bind(&CmaTestSuite::Run,
44 base::Unretained(&test_suite)));