summaryrefslogtreecommitdiffstats
path: root/chrome_frame/test/run_all_unittests.cc
diff options
context:
space:
mode:
authorananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-08 18:36:23 +0000
committerananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-08 18:36:23 +0000
commit9d05f7f84520083b1ac0afb85733ba5d32e89f50 (patch)
treec4e05fe7d59a2b783463ef19969c64b7d9b01838 /chrome_frame/test/run_all_unittests.cc
parent0943370762f6d37ba3b9221d69e40c988df3e53a (diff)
downloadchromium_src-9d05f7f84520083b1ac0afb85733ba5d32e89f50.zip
chromium_src-9d05f7f84520083b1ac0afb85733ba5d32e89f50.tar.gz
chromium_src-9d05f7f84520083b1ac0afb85733ba5d32e89f50.tar.bz2
Fixes to get the ChromeFrame IE6 builder on FYI green. I had to tweak the test expectations a bit because the OnQuit
notification does not seem to show up on IE6 for some reason. We can debug that later. The sideeffect of this would be that the relevant tests which rely on the OnQuit notification would run for the duration of the loop. We also needed to check in the ConnectToChromeFrame helper if we are already connected. This is for the AttachExternalTab case where we could receive the NavigateComplete event twice. While debugging this on my local IE6 VM I found that the calls to register/unregister chrome frame would take for ever on the VM. This was because the ExceptionHandler would try to setup and unwind. This only works correctly for official builds. To workaround this we launch the crash server for the duration of the test and run the chrome frame tests under headless mode. The FullTabModeIE_BackForwardAnchor test still fails on IE6. This is marked as FLAKY anyway. I will send out a separate CL addressing this issue. Review URL: http://codereview.chromium.org/1564018 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@43975 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame/test/run_all_unittests.cc')
-rw-r--r--chrome_frame/test/run_all_unittests.cc42
1 files changed, 39 insertions, 3 deletions
diff --git a/chrome_frame/test/run_all_unittests.cc b/chrome_frame/test/run_all_unittests.cc
index f5f479d..7772259 100644
--- a/chrome_frame/test/run_all_unittests.cc
+++ b/chrome_frame/test/run_all_unittests.cc
@@ -6,14 +6,18 @@
#include <iostream>
#include "base/at_exit.h"
+#include "base/path_service.h"
#include "base/platform_thread.h"
#include "base/process_util.h"
+#include "base/sys_info.h"
+#include "chrome/common/env_vars.h"
#include "base/test/test_suite.h"
#include "base/command_line.h"
#include "chrome/common/chrome_paths.h"
#include "chrome_frame/test/http_server.h"
#include "chrome_frame/test_utils.h"
+#include "chrome_frame/utils.h"
// To enable ATL-based code to run in this module
class ChromeFrameUnittestsModule
@@ -32,6 +36,30 @@ const wchar_t kNoRegistrationSwitch[] = L"no-registration";
// server is killed. Useful for debugging tests.
const wchar_t kRunAsServer[] = L"server";
+base::ProcessHandle LoadCrashService() {
+ FilePath exe_dir;
+ if (!PathService::Get(base::DIR_EXE, &exe_dir)) {
+ DCHECK(false);
+ return NULL;
+ }
+
+ base::ProcessHandle crash_service = NULL;
+
+ FilePath crash_service_path = exe_dir.Append(L"crash_service.exe");
+ if (!base::LaunchApp(crash_service_path.ToWStringHack(), false, false,
+ &crash_service)) {
+ printf("Couldn't start crash_service.exe, so this test run won't tell " \
+ "you if any test crashes!\n");
+ return NULL;
+ }
+
+ printf("Started crash_service.exe so you know if a test crashes!\n");
+ // This sleep is to ensure that the crash service is done initializing, i.e
+ // the pipe creation, etc.
+ Sleep(500);
+ return crash_service;
+}
+
int main(int argc, char **argv) {
base::EnableTerminationOnHeapCorruption();
PlatformThread::SetName("ChromeFrame tests");
@@ -57,10 +85,14 @@ int main(int argc, char **argv) {
return 0;
}
+ SetConfigBool(kChromeFrameHeadlessMode, true);
+
+ base::ProcessHandle crash_service = LoadCrashService();
+ 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)) {
- return test_suite.Run();
+ ret = test_suite.Run();
} else {
// Register paths needed by the ScopedChromeFrameRegistrar.
chrome::RegisterPathProvider();
@@ -72,7 +104,11 @@ int main(int argc, char **argv) {
// TODO(robertshield): Make these tests restore the original registration
// once done.
ScopedChromeFrameRegistrar registrar;
-
- return test_suite.Run();
+ ret = test_suite.Run();
}
+
+ DeleteConfigValue(kChromeFrameHeadlessMode);
+
+ if (crash_service)
+ base::KillProcess(crash_service, 0, false);
}