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/basictypes.h" | |
| 6 #include "base/bind.h" | 5 #include "base/bind.h" |
| 7 #include "base/compiler_specific.h" | 6 #include "base/macros.h" |
| 8 #include "base/path_service.h" | |
| 9 #include "base/test/launcher/unit_test_launcher.h" | 7 #include "base/test/launcher/unit_test_launcher.h" |
| 10 #include "base/test/test_suite.h" | 8 #include "base/test/test_suite.h" |
| 11 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
| 12 #include "ui/base/resource/resource_bundle.h" | 10 #include "ui/base/resource/resource_bundle.h" |
| 13 #include "ui/base/ui_base_paths.h" | 11 #include "ui/base/ui_base_paths.h" |
| 12 #include "ui/gfx/gfx_paths.h" | |
| 14 #include "ui/gl/gl_surface.h" | 13 #include "ui/gl/gl_surface.h" |
| 15 | 14 |
| 16 namespace { | 15 namespace { |
| 17 | 16 |
| 18 class KeyboardTestSuite : public base::TestSuite { | 17 class AthenaTestSuite : public base::TestSuite { |
| 19 public: | 18 public: |
| 20 KeyboardTestSuite(int argc, char** argv) : base::TestSuite(argc, argv) {} | 19 AthenaTestSuite(int argc, char** argv) : TestSuite(argc, argv) {} |
| 20 virtual ~AthenaTestSuite() {} | |
| 21 | 21 |
| 22 protected: | 22 protected: |
| 23 // base::TestSuite: | |
| 23 virtual void Initialize() OVERRIDE { | 24 virtual void Initialize() OVERRIDE { |
| 24 base::TestSuite::Initialize(); | 25 base::TestSuite::Initialize(); |
| 25 gfx::GLSurface::InitializeOneOffForTests(); | 26 gfx::GLSurface::InitializeOneOffForTests(); |
| 27 gfx::RegisterPathProvider(); | |
|
tfarina
2014/09/01 16:47:33
did you need this? if yes, what was the error you
| |
| 26 ui::RegisterPathProvider(); | 28 ui::RegisterPathProvider(); |
| 27 | 29 |
| 28 base::FilePath ui_test_pak_path; | 30 // Force unittests to run using en-US so if we test against string |
| 29 ASSERT_TRUE(PathService::Get(ui::UI_TEST_PAK, &ui_test_pak_path)); | 31 // output, it'll pass regardless of the system language. |
| 30 ui::ResourceBundle::InitSharedInstanceWithPakPath(ui_test_pak_path); | 32 ui::ResourceBundle::InitSharedInstanceWithLocale("en-US", NULL); |
|
tfarina
2014/05/29 02:17:16
Do you plan to provide your own pak file?
| |
| 31 } | 33 } |
| 32 | |
| 33 virtual void Shutdown() OVERRIDE { | 34 virtual void Shutdown() OVERRIDE { |
| 34 ui::ResourceBundle::CleanupSharedInstance(); | 35 ui::ResourceBundle::CleanupSharedInstance(); |
| 35 base::TestSuite::Shutdown(); | 36 base::TestSuite::Shutdown(); |
| 36 } | 37 } |
| 37 | 38 |
| 38 private: | 39 private: |
| 39 DISALLOW_COPY_AND_ASSIGN(KeyboardTestSuite); | 40 DISALLOW_COPY_AND_ASSIGN(AthenaTestSuite); |
| 40 }; | 41 }; |
| 41 | 42 |
| 42 } // namespace | 43 } // namespace |
| 43 | 44 |
| 44 int main(int argc, char** argv) { | 45 int main(int argc, char** argv) { |
| 45 KeyboardTestSuite test_suite(argc, argv); | 46 AthenaTestSuite test_suite(argc, argv); |
| 46 | 47 |
| 47 return base::LaunchUnitTests( | 48 return base::LaunchUnitTestsSerially( |
| 48 argc, | 49 argc, |
| 49 argv, | 50 argv, |
| 50 base::Bind(&KeyboardTestSuite::Run, base::Unretained(&test_suite))); | 51 base::Bind(&AthenaTestSuite::Run, base::Unretained(&test_suite))); |
| 51 } | 52 } |
| OLD | NEW |