OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #ifndef APP_TEST_SUITE_H_ | 5 #ifndef APP_TEST_SUITE_H_ |
6 #define APP_TEST_SUITE_H_ | 6 #define APP_TEST_SUITE_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "build/build_config.h" | 9 #include "build/build_config.h" |
10 | 10 |
11 #include "app/app_paths.h" | 11 #include "app/app_paths.h" |
12 #include "app/resource_bundle.h" | 12 #include "app/resource_bundle.h" |
13 #include "base/path_service.h" | 13 #include "base/path_service.h" |
14 #if defined(OS_MACOSX) | 14 #if defined(OS_MACOSX) |
15 #include "base/mac_util.h" | 15 #include "base/mac_util.h" |
| 16 #include "base/test/mock_chrome_application_mac.h" |
16 #endif | 17 #endif |
17 #include "base/mac/scoped_nsautorelease_pool.h" | 18 #include "base/mac/scoped_nsautorelease_pool.h" |
18 #include "base/test/test_suite.h" | 19 #include "base/test/test_suite.h" |
19 | 20 |
20 class AppTestSuite : public base::TestSuite { | 21 class AppTestSuite : public base::TestSuite { |
21 public: | 22 public: |
22 AppTestSuite(int argc, char** argv) : TestSuite(argc, argv) { | 23 AppTestSuite(int argc, char** argv) : TestSuite(argc, argv) { |
23 } | 24 } |
24 | 25 |
25 protected: | 26 protected: |
26 | 27 |
27 virtual void Initialize() { | 28 virtual void Initialize() { |
| 29 #if defined(OS_MACOSX) |
| 30 // Some of the app unit tests try to open windows. |
| 31 mock_cr_app::RegisterMockCrApp(); |
| 32 #endif |
| 33 |
28 base::mac::ScopedNSAutoreleasePool autorelease_pool; | 34 base::mac::ScopedNSAutoreleasePool autorelease_pool; |
29 | 35 |
30 TestSuite::Initialize(); | 36 TestSuite::Initialize(); |
31 | 37 |
32 app::RegisterPathProvider(); | 38 app::RegisterPathProvider(); |
33 #if defined(OS_MACOSX) | 39 #if defined(OS_MACOSX) |
34 // Look in the framework bundle for resources. | 40 // Look in the framework bundle for resources. |
35 // TODO(port): make a resource bundle for non-app exes. What's done here | 41 // TODO(port): make a resource bundle for non-app exes. What's done here |
36 // isn't really right because this code needs to depend on chrome_dll | 42 // isn't really right because this code needs to depend on chrome_dll |
37 // being built. This is inappropriate in app. | 43 // being built. This is inappropriate in app. |
(...skipping 25 matching lines...) Expand all Loading... |
63 ResourceBundle::CleanupSharedInstance(); | 69 ResourceBundle::CleanupSharedInstance(); |
64 | 70 |
65 #if defined(OS_MACOSX) | 71 #if defined(OS_MACOSX) |
66 mac_util::SetOverrideAppBundle(NULL); | 72 mac_util::SetOverrideAppBundle(NULL); |
67 #endif | 73 #endif |
68 TestSuite::Shutdown(); | 74 TestSuite::Shutdown(); |
69 } | 75 } |
70 }; | 76 }; |
71 | 77 |
72 #endif // APP_TEST_SUITE_H_ | 78 #endif // APP_TEST_SUITE_H_ |
OLD | NEW |