| OLD | NEW |
| 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 "ui/views/run_all_unittests.h" | 5 #include "ui/views/run_all_unittests.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 ViewTestSuite::ViewTestSuite(int argc, char** argv) | 26 ViewTestSuite::ViewTestSuite(int argc, char** argv) |
| 27 : base::TestSuite(argc, argv), argc_(argc), argv_(argv) {} | 27 : base::TestSuite(argc, argv), argc_(argc), argv_(argv) {} |
| 28 | 28 |
| 29 ViewTestSuite::~ViewTestSuite() {} | 29 ViewTestSuite::~ViewTestSuite() {} |
| 30 | 30 |
| 31 int ViewTestSuite::RunTests() { | 31 int ViewTestSuite::RunTests() { |
| 32 return base::LaunchUnitTests( | 32 return base::LaunchUnitTests( |
| 33 argc_, argv_, base::Bind(&ViewTestSuite::Run, base::Unretained(this))); | 33 argc_, argv_, base::Bind(&ViewTestSuite::Run, base::Unretained(this))); |
| 34 } | 34 } |
| 35 | 35 |
| 36 int ViewTestSuite::RunTestsSerially() { | |
| 37 return base::LaunchUnitTestsSerially( | |
| 38 argc_, argv_, base::Bind(&ViewTestSuite::Run, base::Unretained(this))); | |
| 39 } | |
| 40 | |
| 41 void ViewTestSuite::Initialize() { | 36 void ViewTestSuite::Initialize() { |
| 42 base::TestSuite::Initialize(); | 37 base::TestSuite::Initialize(); |
| 43 gfx::GLSurfaceTestSupport::InitializeOneOff(); | 38 gfx::GLSurfaceTestSupport::InitializeOneOff(); |
| 44 ui::RegisterPathProvider(); | 39 ui::RegisterPathProvider(); |
| 45 | 40 |
| 46 base::FilePath ui_test_pak_path; | 41 base::FilePath ui_test_pak_path; |
| 47 ASSERT_TRUE(PathService::Get(ui::UI_TEST_PAK, &ui_test_pak_path)); | 42 ASSERT_TRUE(PathService::Get(ui::UI_TEST_PAK, &ui_test_pak_path)); |
| 48 ui::ResourceBundle::InitSharedInstanceWithPakPath(ui_test_pak_path); | 43 ui::ResourceBundle::InitSharedInstanceWithPakPath(ui_test_pak_path); |
| 49 #if defined(USE_AURA) | 44 #if defined(USE_AURA) |
| 50 env_ = aura::Env::CreateInstance(); | 45 env_ = aura::Env::CreateInstance(); |
| 51 #endif | 46 #endif |
| 52 } | 47 } |
| 53 | 48 |
| 54 void ViewTestSuite::Shutdown() { | 49 void ViewTestSuite::Shutdown() { |
| 55 #if defined(USE_AURA) | 50 #if defined(USE_AURA) |
| 56 env_.reset(); | 51 env_.reset(); |
| 57 #endif | 52 #endif |
| 58 ui::ResourceBundle::CleanupSharedInstance(); | 53 ui::ResourceBundle::CleanupSharedInstance(); |
| 59 base::TestSuite::Shutdown(); | 54 base::TestSuite::Shutdown(); |
| 60 } | 55 } |
| 61 | 56 |
| 62 } // namespace views | 57 } // namespace views |
| OLD | NEW |