| 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 #include <atlbase.h> | 5 #include <atlbase.h> |
| 6 | 6 |
| 7 #include "base/command_line.h" |
| 7 #include "base/process_util.h" | 8 #include "base/process_util.h" |
| 8 #include "base/test/test_suite.h" | 9 #include "base/test/test_suite.h" |
| 9 #include "base/command_line.h" | 10 #include "base/threading/platform_thread.h" |
| 10 #include "chrome/common/chrome_paths.h" | 11 #include "chrome/common/chrome_paths.h" |
| 11 #include "chrome_frame/test/chrome_frame_test_utils.h" | 12 #include "chrome_frame/test/chrome_frame_test_utils.h" |
| 12 #include "chrome_frame/test/chrome_frame_ui_test_utils.h" | 13 #include "chrome_frame/test/chrome_frame_ui_test_utils.h" |
| 13 #include "chrome_frame/test_utils.h" | 14 #include "chrome_frame/test_utils.h" |
| 14 #include "chrome_frame/utils.h" | 15 #include "chrome_frame/utils.h" |
| 15 | 16 |
| 16 // To enable ATL-based code to run in this module | 17 // To enable ATL-based code to run in this module |
| 17 class ChromeFrameUnittestsModule | 18 class ChromeFrameUnittestsModule |
| 18 : public CAtlExeModuleT<ChromeFrameUnittestsModule> { | 19 : public CAtlExeModuleT<ChromeFrameUnittestsModule> { |
| 19 public: | 20 public: |
| 20 static HRESULT InitializeCom() { | 21 static HRESULT InitializeCom() { |
| 21 return CoInitializeEx(NULL, COINIT_APARTMENTTHREADED); | 22 return CoInitializeEx(NULL, COINIT_APARTMENTTHREADED); |
| 22 } | 23 } |
| 23 }; | 24 }; |
| 24 | 25 |
| 25 ChromeFrameUnittestsModule _AtlModule; | 26 ChromeFrameUnittestsModule _AtlModule; |
| 26 | 27 |
| 27 const char kNoRegistrationSwitch[] = "no-registration"; | 28 const char kNoRegistrationSwitch[] = "no-registration"; |
| 28 | 29 |
| 29 void PureCall() { | 30 void PureCall() { |
| 30 __debugbreak(); | 31 __debugbreak(); |
| 31 } | 32 } |
| 32 | 33 |
| 33 int main(int argc, char **argv) { | 34 int main(int argc, char **argv) { |
| 34 base::EnableTerminationOnHeapCorruption(); | 35 base::EnableTerminationOnHeapCorruption(); |
| 35 PlatformThread::SetName("ChromeFrame tests"); | 36 base::PlatformThread::SetName("ChromeFrame tests"); |
| 36 | 37 |
| 37 _set_purecall_handler(PureCall); | 38 _set_purecall_handler(PureCall); |
| 38 | 39 |
| 39 TestSuite test_suite(argc, argv); | 40 TestSuite test_suite(argc, argv); |
| 40 | 41 |
| 41 SetConfigBool(kChromeFrameHeadlessMode, true); | 42 SetConfigBool(kChromeFrameHeadlessMode, true); |
| 42 SetConfigBool(kChromeFrameAccessibleMode, true); | 43 SetConfigBool(kChromeFrameAccessibleMode, true); |
| 43 | 44 |
| 44 base::ProcessHandle crash_service = chrome_frame_test::StartCrashService(); | 45 base::ProcessHandle crash_service = chrome_frame_test::StartCrashService(); |
| 45 int ret = -1; | 46 int ret = -1; |
| (...skipping 19 matching lines...) Expand all Loading... |
| 65 | 66 |
| 66 ret = test_suite.Run(); | 67 ret = test_suite.Run(); |
| 67 } | 68 } |
| 68 | 69 |
| 69 DeleteConfigValue(kChromeFrameHeadlessMode); | 70 DeleteConfigValue(kChromeFrameHeadlessMode); |
| 70 DeleteConfigValue(kChromeFrameAccessibleMode); | 71 DeleteConfigValue(kChromeFrameAccessibleMode); |
| 71 | 72 |
| 72 if (crash_service) | 73 if (crash_service) |
| 73 base::KillProcess(crash_service, 0, false); | 74 base::KillProcess(crash_service, 0, false); |
| 74 } | 75 } |
| OLD | NEW |