Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(108)

Side by Side Diff: ui/gfx/test/run_all_unittests.cc

Issue 656293003: [Mac] Do not initialize the MockCrApplication in base::TestSuite. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Invert negated conditions Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ui/base/test/run_all_unittests.cc ('k') | ui/gfx/test/ui_cocoa_test_helper.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/bind.h" 5 #include "base/bind.h"
6 #include "base/compiler_specific.h" 6 #include "base/compiler_specific.h"
7 #include "base/macros.h" 7 #include "base/macros.h"
8 #include "base/path_service.h" 8 #include "base/path_service.h"
9 #include "base/test/launcher/unit_test_launcher.h" 9 #include "base/test/launcher/unit_test_launcher.h"
10 #include "base/test/test_suite.h" 10 #include "base/test/test_suite.h"
11 #include "testing/gtest/include/gtest/gtest.h" 11 #include "testing/gtest/include/gtest/gtest.h"
12 #include "ui/base/resource/resource_bundle.h" 12 #include "ui/base/resource/resource_bundle.h"
13 #include "ui/base/ui_base_paths.h" 13 #include "ui/base/ui_base_paths.h"
14 14
15 #if defined(OS_ANDROID) 15 #if defined(OS_ANDROID)
16 #include "base/android/jni_android.h" 16 #include "base/android/jni_android.h"
17 #include "ui/gfx/android/gfx_jni_registrar.h" 17 #include "ui/gfx/android/gfx_jni_registrar.h"
18 #endif 18 #endif
19 19
20 #if defined(OS_MACOSX) && !defined(OS_IOS)
21 #include "base/test/mock_chrome_application_mac.h"
22 #endif
23
20 namespace { 24 namespace {
21 25
22 class GfxTestSuite : public base::TestSuite { 26 class GfxTestSuite : public base::TestSuite {
23 public: 27 public:
24 GfxTestSuite(int argc, char** argv) : base::TestSuite(argc, argv) {} 28 GfxTestSuite(int argc, char** argv) : base::TestSuite(argc, argv) {}
25 29
26 protected: 30 protected:
27 virtual void Initialize() override { 31 virtual void Initialize() override {
28 base::TestSuite::Initialize(); 32 base::TestSuite::Initialize();
29 33
30 #if defined(OS_ANDROID) 34 #if defined(OS_ANDROID)
31 gfx::android::RegisterJni(base::android::AttachCurrentThread()); 35 gfx::android::RegisterJni(base::android::AttachCurrentThread());
32 #endif 36 #endif
33 37
38 #if defined(OS_MACOSX) && !defined(OS_IOS)
39 mock_cr_app::RegisterMockCrApp();
40 #endif
41
34 ui::RegisterPathProvider(); 42 ui::RegisterPathProvider();
35 43
36 base::FilePath ui_test_pak_path; 44 base::FilePath ui_test_pak_path;
37 ASSERT_TRUE(PathService::Get(ui::UI_TEST_PAK, &ui_test_pak_path)); 45 ASSERT_TRUE(PathService::Get(ui::UI_TEST_PAK, &ui_test_pak_path));
38 ui::ResourceBundle::InitSharedInstanceWithPakPath(ui_test_pak_path); 46 ui::ResourceBundle::InitSharedInstanceWithPakPath(ui_test_pak_path);
39 } 47 }
40 48
41 virtual void Shutdown() override { 49 virtual void Shutdown() override {
42 ui::ResourceBundle::CleanupSharedInstance(); 50 ui::ResourceBundle::CleanupSharedInstance();
43 base::TestSuite::Shutdown(); 51 base::TestSuite::Shutdown();
44 } 52 }
45 53
46 private: 54 private:
47 DISALLOW_COPY_AND_ASSIGN(GfxTestSuite); 55 DISALLOW_COPY_AND_ASSIGN(GfxTestSuite);
48 }; 56 };
49 57
50 } // namespace 58 } // namespace
51 59
52 int main(int argc, char** argv) { 60 int main(int argc, char** argv) {
53 GfxTestSuite test_suite(argc, argv); 61 GfxTestSuite test_suite(argc, argv);
54 62
55 return base::LaunchUnitTests( 63 return base::LaunchUnitTests(
56 argc, 64 argc,
57 argv, 65 argv,
58 base::Bind(&GfxTestSuite::Run, base::Unretained(&test_suite))); 66 base::Bind(&GfxTestSuite::Run, base::Unretained(&test_suite)));
59 } 67 }
OLDNEW
« no previous file with comments | « ui/base/test/run_all_unittests.cc ('k') | ui/gfx/test/ui_cocoa_test_helper.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698