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

Side by Side Diff: chromecast/media/cma/test/run_all_unittests.cc

Issue 652353003: Chromecast: adds class to help record complex histograms. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: resets initial buffering state on flush Created 6 years, 2 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 unified diff | Download patch
« no previous file with comments | « chromecast/media/cma/base/buffering_controller.cc ('k') | chromecast/media/media.gyp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/bind.h" 5 #include "base/bind.h"
6 #include "base/test/launcher/unit_test_launcher.h" 6 #include "base/test/launcher/unit_test_launcher.h"
7 #include "base/test/test_suite.h" 7 #include "base/test/test_suite.h"
8 #include "build/build_config.h" 8 #include "build/build_config.h"
9 #include "chromecast/base/metrics/cast_metrics_test_helper.h"
9 #include "media/base/media.h" 10 #include "media/base/media.h"
10 11
11 #if defined(OS_ANDROID) 12 #if defined(OS_ANDROID)
12 #error "CMA not supported on Android" 13 #error "CMA not supported on Android"
13 #endif 14 #endif
14 15
15 class CmaTestSuite : public base::TestSuite { 16 class CmaTestSuite : public base::TestSuite {
16 public: 17 public:
17 // Note: the base class constructor creates an AtExitManager. 18 // Note: the base class constructor creates an AtExitManager.
18 CmaTestSuite(int argc, char** argv) : TestSuite(argc, argv) {} 19 CmaTestSuite(int argc, char** argv) : TestSuite(argc, argv) {}
19 virtual ~CmaTestSuite() {} 20 virtual ~CmaTestSuite() {}
20 21
21 protected: 22 protected:
22 virtual void Initialize() override; 23 virtual void Initialize() override;
23 }; 24 };
24 25
25 void CmaTestSuite::Initialize() { 26 void CmaTestSuite::Initialize() {
26 // Run TestSuite::Initialize first so that logging is initialized. 27 // Run TestSuite::Initialize first so that logging is initialized.
27 base::TestSuite::Initialize(); 28 base::TestSuite::Initialize();
28 29
30 // Some of the chromecast media unit tests require a metrics helper instance.
31 // Provide a fake one.
32 chromecast::metrics::InitializeMetricsHelperForTesting();
33
29 // Initialize the FFMpeg library. 34 // Initialize the FFMpeg library.
30 // Note: at this time, AtExitManager is already present. 35 // Note: at this time, AtExitManager is already present.
31 media::InitializeMediaLibraryForTesting(); 36 media::InitializeMediaLibraryForTesting();
32 } 37 }
33 38
34 int main(int argc, char** argv) { 39 int main(int argc, char** argv) {
35 CmaTestSuite test_suite(argc, argv); 40 CmaTestSuite test_suite(argc, argv);
36 41
37 return base::LaunchUnitTests( 42 return base::LaunchUnitTests(
38 argc, argv, base::Bind(&CmaTestSuite::Run, 43 argc, argv, base::Bind(&CmaTestSuite::Run,
39 base::Unretained(&test_suite))); 44 base::Unretained(&test_suite)));
40 } 45 }
OLDNEW
« no previous file with comments | « chromecast/media/cma/base/buffering_controller.cc ('k') | chromecast/media/media.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698