summaryrefslogtreecommitdiffstats
path: root/chrome_frame/test
diff options
context:
space:
mode:
authorananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-10 23:38:17 +0000
committerananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-10 23:38:17 +0000
commitd9b10feee212c63938d0b39904ea61fcea5f611e (patch)
tree5513a8844ce6e9eef8b3321914e163dfa86ca526 /chrome_frame/test
parent637b3444246416fe4c68cd43e53c8ac8a3cc9d3a (diff)
downloadchromium_src-d9b10feee212c63938d0b39904ea61fcea5f611e.zip
chromium_src-d9b10feee212c63938d0b39904ea61fcea5f611e.tar.gz
chromium_src-d9b10feee212c63938d0b39904ea61fcea5f611e.tar.bz2
Prevent extract build failures on the ChromeFrame builders caused when the chrome frame
tests executable crashes while running a test by register an exception handler and terminating the relevant processes. BUG=none TEST=none Review URL: http://codereview.chromium.org/6136004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@70962 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame/test')
-rw-r--r--chrome_frame/test/run_all_unittests.cc53
1 files changed, 32 insertions, 21 deletions
diff --git a/chrome_frame/test/run_all_unittests.cc b/chrome_frame/test/run_all_unittests.cc
index 694c6c0..e40a5eb 100644
--- a/chrome_frame/test/run_all_unittests.cc
+++ b/chrome_frame/test/run_all_unittests.cc
@@ -31,6 +31,7 @@ void PureCall() {
__debugbreak();
}
+#pragma warning(disable:4509)
int main(int argc, char **argv) {
base::EnableTerminationOnHeapCorruption();
base::PlatformThread::SetName("ChromeFrame tests");
@@ -44,27 +45,36 @@ int main(int argc, char **argv) {
base::ProcessHandle crash_service = chrome_frame_test::StartCrashService();
int ret = -1;
- // If mini_installer is used to register CF, we use the switch
- // --no-registration to avoid repetitive registration.
- if (CommandLine::ForCurrentProcess()->HasSwitch(kNoRegistrationSwitch)) {
- ret = test_suite.Run();
- } else {
- // Register paths needed by the ScopedChromeFrameRegistrar.
- chrome::RegisterPathProvider();
-
- // This will register the chrome frame in the build directory. It currently
- // leaves that chrome frame registered once the tests are done. It must be
- // constructed AFTER the TestSuite is created since TestSuites create THE
- // AtExitManager.
- // TODO(robertshield): Make these tests restore the original registration
- // once done.
- ScopedChromeFrameRegistrar registrar;
-
- // Register IAccessible2 proxy stub DLL, needed for some tests.
- ScopedChromeFrameRegistrar ia2_registrar(
- chrome_frame_test::GetIAccessible2ProxyStubPath().value());
-
- ret = test_suite.Run();
+
+ __try {
+ // If mini_installer is used to register CF, we use the switch
+ // --no-registration to avoid repetitive registration.
+ if (CommandLine::ForCurrentProcess()->HasSwitch(kNoRegistrationSwitch)) {
+ ret = test_suite.Run();
+ } else {
+ // Register paths needed by the ScopedChromeFrameRegistrar.
+ chrome::RegisterPathProvider();
+
+ // This will register the chrome frame in the build directory. It
+ // currently leaves that chrome frame registered once the tests are done.
+ // It must be constructed AFTER the TestSuite is created since TestSuites
+ // create THE AtExitManager.
+ // TODO(robertshield): Make these tests restore the original registration
+ // once done.
+ ScopedChromeFrameRegistrar registrar;
+
+ // Register IAccessible2 proxy stub DLL, needed for some tests.
+ ScopedChromeFrameRegistrar ia2_registrar(
+ chrome_frame_test::GetIAccessible2ProxyStubPath().value());
+
+ ret = test_suite.Run();
+ }
+ }
+
+ _except(EXCEPTION_EXECUTE_HANDLER) {
+ LOG(ERROR) << "ChromeFrame tests crashed";
+ chrome_frame_test::KillProcesses(L"iexplore.exe", 0, false);
+ chrome_frame_test::KillProcesses(L"firefox.exe", 0, false);
}
DeleteConfigValue(kChromeFrameHeadlessMode);
@@ -73,3 +83,4 @@ int main(int argc, char **argv) {
if (crash_service)
base::KillProcess(crash_service, 0, false);
}
+#pragma warning(default:4509)