Chromium Code Reviews| 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); | |
|
sadrul
2014/05/21 18:49:10
Does the gfx tests actually use anything from the
tfarina
2014/05/21 19:03:35
Yes. Both font_unittests.cc and text_elider_unitte
sadrul
2014/05/21 19:10:21
Ah, I see. That seems unfortunate. Perhaps we coul
tfarina
2014/05/21 19:28:54
For further reference the error (without this call
| |
| 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 |