Chromium Code Reviews| OLD | NEW |
|---|---|
| 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/macros.h" | |
| 7 #include "base/test/launcher/unit_test_launcher.h" | 6 #include "base/test/launcher/unit_test_launcher.h" |
| 8 #include "base/test/test_suite.h" | 7 #include "base/test/test_suite.h" |
| 9 #include "extensions/test/test_extensions_client.h" | 8 #include "build/build_config.h" |
| 10 | 9 |
| 11 namespace { | 10 namespace { |
| 12 | 11 |
| 13 class ExtensionsTestSuite : public base::TestSuite { | 12 class OzoneTestSuite : public base::TestSuite { |
| 14 public: | 13 public: |
| 15 ExtensionsTestSuite(int argc, char** argv); | 14 OzoneTestSuite(int argc, char** argv); |
| 16 | 15 |
| 17 private: | 16 protected: |
| 18 // base::TestSuite: | 17 // base::TestSuite: |
| 19 virtual void Initialize() OVERRIDE; | 18 virtual void Initialize() OVERRIDE; |
| 20 virtual void Shutdown() OVERRIDE; | 19 virtual void Shutdown() OVERRIDE; |
| 21 | 20 |
| 22 scoped_ptr<extensions::TestExtensionsClient> client_; | 21 private: |
| 23 | 22 DISALLOW_COPY_AND_ASSIGN(OzoneTestSuite); |
| 24 DISALLOW_COPY_AND_ASSIGN(ExtensionsTestSuite); | |
| 25 }; | 23 }; |
| 26 | 24 |
| 27 ExtensionsTestSuite::ExtensionsTestSuite(int argc, char** argv) | 25 OzoneTestSuite::OzoneTestSuite(int argc, char** argv) |
| 28 : base::TestSuite(argc, argv) {} | 26 : base::TestSuite(argc, argv) {} |
| 29 | 27 |
| 30 void ExtensionsTestSuite::Initialize() { | 28 void OzoneTestSuite::Initialize() { |
| 31 base::TestSuite::Initialize(); | 29 base::TestSuite::Initialize(); |
| 32 | |
| 33 client_.reset(new extensions::TestExtensionsClient()); | |
| 34 extensions::ExtensionsClient::Set(client_.get()); | |
| 35 } | 30 } |
| 36 | 31 |
| 37 void ExtensionsTestSuite::Shutdown() { | 32 void OzoneTestSuite::Shutdown() { |
| 38 base::TestSuite::Shutdown(); | 33 base::TestSuite::Shutdown(); |
| 39 } | 34 } |
| 40 | 35 |
| 41 } // namespace | 36 } // namespace |
| 42 | 37 |
| 43 int main(int argc, char** argv) { | 38 int main(int argc, char** argv) { |
| 44 ExtensionsTestSuite test_suite(argc, argv); | 39 OzoneTestSuite test_suite(argc, argv); |
| 45 | 40 |
| 46 return base::LaunchUnitTests(argc, | 41 return base::LaunchUnitTests(argc, |
| 47 argv, | 42 argv, |
| 48 base::Bind(&ExtensionsTestSuite::Run, | 43 base::Bind(&OzoneTestSuite::Run, |
| 49 base::Unretained(&test_suite))); | 44 base::Unretained(&test_suite))); |
| 50 } | 45 } |
|
rjkroege
2014/05/30 15:57:49
all the bad parts of lisp without the good bits. :
spang
2014/05/30 16:47:01
Done.
| |
| OLD | NEW |