diff options
Diffstat (limited to 'chrome_frame/test/net/fake_external_tab.cc')
-rw-r--r-- | chrome_frame/test/net/fake_external_tab.cc | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/chrome_frame/test/net/fake_external_tab.cc b/chrome_frame/test/net/fake_external_tab.cc index 322231c..9156409 100644 --- a/chrome_frame/test/net/fake_external_tab.cc +++ b/chrome_frame/test/net/fake_external_tab.cc @@ -514,6 +514,11 @@ void CFUrlRequestUnittestRunner::StartChromeFrameInHostBrowser() { base::win::ScopedCOMInitializer com; chrome_frame_test::CloseAllIEWindows(); + // Tweak IE settings to make it amenable to testing before launching it. + ie_configurator_.reset(chrome_frame_test::CreateConfigurator()); + if (ie_configurator_.get() != NULL) + ie_configurator_->ApplySettings(); + test_http_server_.reset(new test_server::SimpleWebServer(kTestServerPort)); test_http_server_->AddResponse(&chrome_frame_html_); std::wstring url(base::StringPrintf(L"http://localhost:%i/chrome_frame", @@ -541,6 +546,10 @@ void CFUrlRequestUnittestRunner::ShutDownHostBrowser() { void CFUrlRequestUnittestRunner::OnIEShutdownFailure() { LOG(ERROR) << "Failed to shutdown IE and npchrome_frame cleanly after test " "execution."; + + if (ie_configurator_.get() != NULL) + ie_configurator_->RevertSettings(); + StopFileLogger(true); ::ExitProcess(1); } @@ -597,8 +606,13 @@ void CFUrlRequestUnittestRunner::OnInitialTabLoaded() { void CFUrlRequestUnittestRunner::OnProviderDestroyed() { if (tests_ran_) { StopFileLogger(false); + + if (ie_configurator_.get() != NULL) + ie_configurator_->RevertSettings(); + if (crash_service_) base::KillProcess(crash_service_, 0, false); + ::ExitProcess(test_result()); } else { DLOG(ERROR) << "Automation Provider shutting down before test execution " @@ -696,6 +710,9 @@ void CFUrlRequestUnittestRunner::OnInitializationTimeout() { chrome_frame_test::CloseAllIEWindows(); } + if (ie_configurator_.get() != NULL) + ie_configurator_->RevertSettings(); + if (crash_service_) base::KillProcess(crash_service_, 0, false); |