Move VISUAL_STATE promise to activation
[chromium-blink-merge.git] / ui / app_list / test / run_all_unittests.cc
blob07d09cb5aabca68f80bbdb361fa2c75b39bda05c
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.
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_discardable_memory_allocator.h"
11 #include "base/test/test_suite.h"
12 #include "testing/gtest/include/gtest/gtest.h"
13 #include "ui/base/resource/resource_bundle.h"
14 #include "ui/base/ui_base_paths.h"
16 #if defined(OS_MACOSX)
17 #include "base/test/mock_chrome_application_mac.h"
18 #endif
20 #if defined(TOOLKIT_VIEWS)
21 #include "ui/gl/gl_surface.h"
22 #endif
24 namespace {
26 class AppListTestSuite : public base::TestSuite {
27 public:
28 AppListTestSuite(int argc, char** argv) : base::TestSuite(argc, argv) {}
30 protected:
31 void Initialize() override {
32 #if defined(OS_MACOSX)
33 mock_cr_app::RegisterMockCrApp();
34 #endif
35 #if defined(TOOLKIT_VIEWS)
36 gfx::GLSurface::InitializeOneOffForTests();
37 #endif
38 base::TestSuite::Initialize();
39 ui::RegisterPathProvider();
41 base::FilePath ui_test_pak_path;
42 ASSERT_TRUE(PathService::Get(ui::UI_TEST_PAK, &ui_test_pak_path));
43 ui::ResourceBundle::InitSharedInstanceWithPakPath(ui_test_pak_path);
45 base::DiscardableMemoryAllocator::SetInstance(
46 &discardable_memory_allocator_);
49 void Shutdown() override {
50 ui::ResourceBundle::CleanupSharedInstance();
51 base::TestSuite::Shutdown();
54 private:
55 base::TestDiscardableMemoryAllocator discardable_memory_allocator_;
57 DISALLOW_COPY_AND_ASSIGN(AppListTestSuite);
60 } // namespace
62 int main(int argc, char** argv) {
63 AppListTestSuite test_suite(argc, argv);
65 return base::LaunchUnitTests(
66 argc,
67 argv,
68 base::Bind(&AppListTestSuite::Run, base::Unretained(&test_suite)));