| 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 <atlbase.h> | 5 #include <atlbase.h> |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/metrics/field_trial.h" | 8 #include "base/metrics/field_trial.h" |
| 9 #include "base/process_util.h" | 9 #include "base/process_util.h" |
| 10 #include "base/test/test_suite.h" | 10 #include "base/test/test_suite.h" |
| 11 #include "base/threading/platform_thread.h" | 11 #include "base/threading/platform_thread.h" |
| 12 #include "base/win/scoped_com_initializer.h" | 12 #include "base/win/scoped_com_initializer.h" |
| 13 #include "chrome/common/chrome_paths.h" | 13 #include "chrome/common/chrome_paths.h" |
| 14 #include "chrome/common/metrics/entropy_provider.h" |
| 14 #include "chrome/test/logging/win/test_log_collector.h" | 15 #include "chrome/test/logging/win/test_log_collector.h" |
| 15 #include "chrome_frame/crash_server_init.h" | 16 #include "chrome_frame/crash_server_init.h" |
| 16 #include "chrome_frame/test/chrome_frame_test_utils.h" | 17 #include "chrome_frame/test/chrome_frame_test_utils.h" |
| 17 #include "chrome_frame/test/chrome_frame_ui_test_utils.h" | 18 #include "chrome_frame/test/chrome_frame_ui_test_utils.h" |
| 18 #include "chrome_frame/test/ie_configurator.h" | 19 #include "chrome_frame/test/ie_configurator.h" |
| 19 #include "chrome_frame/test/test_scrubber.h" | 20 #include "chrome_frame/test/test_scrubber.h" |
| 20 #include "chrome_frame/test_utils.h" | 21 #include "chrome_frame/test_utils.h" |
| 21 #include "chrome_frame/utils.h" | 22 #include "chrome_frame/utils.h" |
| 22 | 23 |
| 23 // To enable ATL-based code to run in this module | 24 // To enable ATL-based code to run in this module |
| (...skipping 23 matching lines...) Expand all Loading... |
| 47 int main(int argc, char **argv) { | 48 int main(int argc, char **argv) { |
| 48 base::win::ScopedCOMInitializer com_initializer; | 49 base::win::ScopedCOMInitializer com_initializer; |
| 49 ScopedChromeFrameRegistrar::RegisterAndExitProcessIfDirected(); | 50 ScopedChromeFrameRegistrar::RegisterAndExitProcessIfDirected(); |
| 50 base::EnableTerminationOnHeapCorruption(); | 51 base::EnableTerminationOnHeapCorruption(); |
| 51 base::PlatformThread::SetName("ChromeFrame tests"); | 52 base::PlatformThread::SetName("ChromeFrame tests"); |
| 52 | 53 |
| 53 _set_purecall_handler(PureCall); | 54 _set_purecall_handler(PureCall); |
| 54 | 55 |
| 55 // Set up a FieldTrialList to keep any field trials we have going in | 56 // Set up a FieldTrialList to keep any field trials we have going in |
| 56 // Chrome Frame happy. | 57 // Chrome Frame happy. |
| 57 base::FieldTrialList field_trial_list("42"); | 58 base::FieldTrialList field_trial_list(new metrics::SHA1EntropyProvider("42")); |
| 58 | 59 |
| 59 base::TestSuite test_suite(argc, argv); | 60 base::TestSuite test_suite(argc, argv); |
| 60 | 61 |
| 61 SetConfigBool(kChromeFrameHeadlessMode, true); | 62 SetConfigBool(kChromeFrameHeadlessMode, true); |
| 62 SetConfigBool(kChromeFrameAccessibleMode, true); | 63 SetConfigBool(kChromeFrameAccessibleMode, true); |
| 63 | 64 |
| 64 base::ProcessHandle crash_service = NULL; | 65 base::ProcessHandle crash_service = NULL; |
| 65 google_breakpad::scoped_ptr<google_breakpad::ExceptionHandler> breakpad; | 66 google_breakpad::scoped_ptr<google_breakpad::ExceptionHandler> breakpad; |
| 66 | 67 |
| 67 if (!CommandLine::ForCurrentProcess()->HasSwitch(kNoCrashService)) { | 68 if (!CommandLine::ForCurrentProcess()->HasSwitch(kNoCrashService)) { |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 ret = test_suite.Run(); | 103 ret = test_suite.Run(); |
| 103 } | 104 } |
| 104 | 105 |
| 105 DeleteConfigValue(kChromeFrameHeadlessMode); | 106 DeleteConfigValue(kChromeFrameHeadlessMode); |
| 106 DeleteConfigValue(kChromeFrameAccessibleMode); | 107 DeleteConfigValue(kChromeFrameAccessibleMode); |
| 107 | 108 |
| 108 if (crash_service) | 109 if (crash_service) |
| 109 base::KillProcess(crash_service, 0, false); | 110 base::KillProcess(crash_service, 0, false); |
| 110 return ret; | 111 return ret; |
| 111 } | 112 } |
| OLD | NEW |