OLD | NEW |
(Empty) | |
| 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. |
| 4 |
| 5 #include "base/basictypes.h" |
| 6 #include "base/bind.h" |
| 7 #include "base/compiler_specific.h" |
| 8 #include "base/path_service.h" |
| 9 #include "base/test/launcher/unit_test_launcher.h" |
| 10 #include "base/test/test_suite.h" |
| 11 #include "ui/base/resource/resource_bundle.h" |
| 12 #include "ui/base/ui_base_paths.h" |
| 13 |
| 14 namespace { |
| 15 |
| 16 class GfxTestSuite : public base::TestSuite { |
| 17 public: |
| 18 GfxTestSuite(int argc, char** argv) : base::TestSuite(argc, argv) {} |
| 19 |
| 20 protected: |
| 21 virtual void Initialize() OVERRIDE { |
| 22 base::TestSuite::Initialize(); |
| 23 ui::RegisterPathProvider(); |
| 24 |
| 25 base::FilePath pak_dir; |
| 26 PathService::Get(base::DIR_MODULE, &pak_dir); |
| 27 |
| 28 base::FilePath pak_file; |
| 29 pak_file = pak_dir.Append(FILE_PATH_LITERAL("ui_test.pak")); |
| 30 |
| 31 ui::ResourceBundle::InitSharedInstanceWithPakPath(pak_file); |
| 32 } |
| 33 |
| 34 virtual void Shutdown() OVERRIDE { |
| 35 ui::ResourceBundle::CleanupSharedInstance(); |
| 36 base::TestSuite::Shutdown(); |
| 37 } |
| 38 |
| 39 private: |
| 40 DISALLOW_COPY_AND_ASSIGN(GfxTestSuite); |
| 41 }; |
| 42 |
| 43 } // namespace |
| 44 |
| 45 int main(int argc, char** argv) { |
| 46 GfxTestSuite test_suite(argc, argv); |
| 47 |
| 48 return base::LaunchUnitTests( |
| 49 argc, |
| 50 argv, |
| 51 base::Bind(&GfxTestSuite::Run, base::Unretained(&test_suite))); |
| 52 } |
OLD | NEW |