diff options
author | grt@chromium.org <grt@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-04-03 01:02:09 +0000 |
---|---|---|
committer | grt@chromium.org <grt@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-04-03 01:02:09 +0000 |
commit | 39942a36722b6d11192f85790a65df8f47bf0152 (patch) | |
tree | b249e2c4b9c4cc0c67685312fd09730c44bd8c31 /chrome_frame/test/net | |
parent | 2a255898433bcf77b056bb03e65a4f984f30afea (diff) | |
download | chromium_src-39942a36722b6d11192f85790a65df8f47bf0152.zip chromium_src-39942a36722b6d11192f85790a65df8f47bf0152.tar.gz chromium_src-39942a36722b6d11192f85790a65df8f47bf0152.tar.bz2 |
Set up machine configuration so that IE7 and IE9 behave predictably.
Namely, convince IE9 to not show first-run dialogs, not to do phishing filter stuff, or download compatibility view lists. Also poke Group Policy to disable the add-on enablement prompt. For IE7, tell it not to pop an information bar dialog.
BUG=120633
TEST=chrome_frame_tests.exe runs on all bots
Review URL: http://codereview.chromium.org/9924013
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@130270 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame/test/net')
-rw-r--r-- | chrome_frame/test/net/fake_external_tab.cc | 17 | ||||
-rw-r--r-- | chrome_frame/test/net/fake_external_tab.h | 2 |
2 files changed, 19 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); diff --git a/chrome_frame/test/net/fake_external_tab.h b/chrome_frame/test/net/fake_external_tab.h index 964cb13..cd92dc0 100644 --- a/chrome_frame/test/net/fake_external_tab.h +++ b/chrome_frame/test/net/fake_external_tab.h @@ -14,6 +14,7 @@ #include "base/process.h" #include "base/win/scoped_handle.h" #include "chrome/browser/browser_process_impl.h" +#include "chrome_frame/test/ie_configurator.h" #include "chrome_frame/test/net/process_singleton_subclass.h" #include "chrome_frame/test/net/test_automation_provider.h" #include "chrome_frame/test/test_server.h" @@ -159,6 +160,7 @@ class CFUrlRequestUnittestRunner base::CancelableClosure timeout_closure_; scoped_ptr<logging_win::FileLogger> file_logger_; FilePath log_file_; + scoped_ptr<chrome_frame_test::IEConfigurator> ie_configurator_; DISALLOW_COPY_AND_ASSIGN(CFUrlRequestUnittestRunner); }; |