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

Side by Side Diff: media/base/run_all_unittests.cc

Issue 12321117: Refactor MainHook into TestSuite. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: "moved hook from new file into existing test_support_ios." Created 7 years, 9 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/test/main_hook.h"
6 #include "base/test/test_suite.h" 5 #include "base/test/test_suite.h"
7 #include "media/base/media.h" 6 #include "media/base/media.h"
8 7
9 class TestSuiteNoAtExit : public base::TestSuite { 8 class TestSuiteNoAtExit : public base::TestSuite {
10 public: 9 public:
11 TestSuiteNoAtExit(int argc, char** argv) : TestSuite(argc, argv) {} 10 TestSuiteNoAtExit(int argc, char** argv) : TestSuite(argc, argv) {}
12 virtual ~TestSuiteNoAtExit() {} 11 virtual ~TestSuiteNoAtExit() {}
13 protected: 12 protected:
14 virtual void Initialize() OVERRIDE; 13 virtual void Initialize() OVERRIDE;
15 }; 14 };
16 15
17 void TestSuiteNoAtExit::Initialize() { 16 void TestSuiteNoAtExit::Initialize() {
18 // Run TestSuite::Initialize first so that logging is initialized. 17 // Run TestSuite::Initialize first so that logging is initialized.
19 base::TestSuite::Initialize(); 18 base::TestSuite::Initialize();
20 // Run this here instead of main() to ensure an AtExitManager is already 19 // Run this here instead of main() to ensure an AtExitManager is already
21 // present. 20 // present.
22 media::InitializeMediaLibraryForTesting(); 21 media::InitializeMediaLibraryForTesting();
23 } 22 }
24 23
25 int main(int argc, char** argv) { 24 int main(int argc, char** argv) {
26 MainHook hook(main, argc, argv);
27 return TestSuiteNoAtExit(argc, argv).Run(); 25 return TestSuiteNoAtExit(argc, argv).Run();
28 } 26 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698