diff options
author | erikwright@chromium.org <erikwright@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-02-28 13:12:25 +0000 |
---|---|---|
committer | erikwright@chromium.org <erikwright@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-02-28 13:12:25 +0000 |
commit | acc0ead3b74678f2e444b341897f38cba5d38686 (patch) | |
tree | 736ff28fd3b57e94924f3c7bc0fa21968b9b515a /chrome_frame | |
parent | 6dcc9437d226ccd023db267f4db8a1b9bce9bdfd (diff) | |
download | chromium_src-acc0ead3b74678f2e444b341897f38cba5d38686.zip chromium_src-acc0ead3b74678f2e444b341897f38cba5d38686.tar.gz chromium_src-acc0ead3b74678f2e444b341897f38cba5d38686.tar.bz2 |
Enable Chrome Frame net tests on IE9.
Includes disabling a test that is flaky on IE9.
BUG=114369
TEST=Chrome Frame net tests run reliably on IE9, including on try bots and the waterfall.
Review URL: http://codereview.chromium.org/9465016
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@123967 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame')
-rw-r--r-- | chrome_frame/test/net/fake_external_tab.cc | 48 | ||||
-rw-r--r-- | chrome_frame/test/net/fake_external_tab.h | 5 |
2 files changed, 22 insertions, 31 deletions
diff --git a/chrome_frame/test/net/fake_external_tab.cc b/chrome_frame/test/net/fake_external_tab.cc index b42a78f..8c3d980 100644 --- a/chrome_frame/test/net/fake_external_tab.cc +++ b/chrome_frame/test/net/fake_external_tab.cc @@ -96,14 +96,6 @@ const char kChromeFrameHtml[] = "<html><head>" "<link rel=\"shortcut icon\" href=\"file://c:\\favicon.ico\"/>" "</head><body>Chrome Frame should now be loaded</body></html>"; -bool ShouldLaunchBrowser() { - return !CommandLine::ForCurrentProcess()->HasSwitch(kManualBrowserLaunch); -} - -bool PromptAfterSetup() { - return CommandLine::ForCurrentProcess()->HasSwitch(kPromptAfterSetup); -} - // Uses the IAccessible interface for the window to set the focus. // This can be useful when you don't have control over the thread that // owns the window. @@ -297,6 +289,8 @@ void FilterDisabledTests() { "URLRequestTestHTTP.NetworkDelegateRedirectRequestPost", "URLRequestTestHTTP.GetTest", "HTTPSRequestTest.HTTPSPreloadedHSTSTest", + // This always hangs on erikwright's box with IE9. + "URLRequestTestHTTP.Redirect302Tests" }; std::string filter("-"); // All following filters will be negative. @@ -485,14 +479,18 @@ CFUrlRequestUnittestRunner::CFUrlRequestUnittestRunner(int argc, char** argv) : NetTestSuite(argc, argv, false), chrome_frame_html_("/chrome_frame", kChromeFrameHtml), registrar_(chrome_frame_test::GetTestBedType()), - test_result_(0) { + test_result_(0), + launch_browser_( + !CommandLine::ForCurrentProcess()->HasSwitch(kManualBrowserLaunch)), + prompt_after_setup_( + CommandLine::ForCurrentProcess()->HasSwitch(kPromptAfterSetup)) { } CFUrlRequestUnittestRunner::~CFUrlRequestUnittestRunner() { } void CFUrlRequestUnittestRunner::StartChromeFrameInHostBrowser() { - if (!ShouldLaunchBrowser()) + if (!launch_browser_) return; base::win::ScopedCOMInitializer com; @@ -516,7 +514,7 @@ void CFUrlRequestUnittestRunner::StartChromeFrameInHostBrowser() { } void CFUrlRequestUnittestRunner::ShutDownHostBrowser() { - if (ShouldLaunchBrowser()) { + if (launch_browser_) { base::win::ScopedCOMInitializer com; chrome_frame_test::CloseAllIEWindows(); } @@ -567,7 +565,7 @@ void CFUrlRequestUnittestRunner::OnInitialTabLoaded() { } void CFUrlRequestUnittestRunner::StartTests() { - if (PromptAfterSetup()) + if (prompt_after_setup_) MessageBoxA(NULL, "click ok to run", "", MB_OK); DCHECK_EQ(test_thread_.IsValid(), false); @@ -582,19 +580,19 @@ DWORD CFUrlRequestUnittestRunner::RunAllUnittests(void* param) { CFUrlRequestUnittestRunner* me = reinterpret_cast<CFUrlRequestUnittestRunner*>(param); me->test_result_ = me->Run(); - BrowserThread::PostTask(BrowserThread::UI, - FROM_HERE, - base::Bind(TakeDownBrowser, me)); + BrowserThread::PostTask( + BrowserThread::UI, + FROM_HERE, + base::Bind(&CFUrlRequestUnittestRunner::TakeDownBrowser, + base::Unretained(me))); return 0; } -// static -void CFUrlRequestUnittestRunner::TakeDownBrowser( - CFUrlRequestUnittestRunner* me) { - if (PromptAfterSetup()) +void CFUrlRequestUnittestRunner::TakeDownBrowser() { + if (prompt_after_setup_) MessageBoxA(NULL, "click ok to exit", "", MB_OK); - me->ShutDownHostBrowser(); + ShutDownHostBrowser(); BrowserThread::PostDelayedTask(BrowserThread::UI, FROM_HERE, MessageLoop::QuitClosure(), @@ -762,16 +760,6 @@ int main(int argc, char** argv) { g_argc = argc; g_argv = argv; - if (chrome_frame_test::GetInstalledIEVersion() >= IE_9) { - // Adding this here as the command line and the logging stuff gets - // initialized in the NetTestSuite constructor. Did not want to break that. - base::AtExitManager at_exit_manager; - CommandLine::Init(argc, argv); - CFUrlRequestUnittestRunner::InitializeLogging(); - LOG(INFO) << "Not running ChromeFrame net tests on IE9+"; - return 0; - } - google_breakpad::scoped_ptr<google_breakpad::ExceptionHandler> breakpad( InitializeCrashReporting(HEADLESS)); diff --git a/chrome_frame/test/net/fake_external_tab.h b/chrome_frame/test/net/fake_external_tab.h index aa807b4..4d27295 100644 --- a/chrome_frame/test/net/fake_external_tab.h +++ b/chrome_frame/test/net/fake_external_tab.h @@ -118,7 +118,7 @@ class CFUrlRequestUnittestRunner // will be called. static DWORD WINAPI RunAllUnittests(void* param); - static void TakeDownBrowser(CFUrlRequestUnittestRunner* me); + void TakeDownBrowser(); protected: base::win::ScopedHandle test_thread_; @@ -141,6 +141,9 @@ class CFUrlRequestUnittestRunner // See http://crbug.com/114369 . void OverrideHttpHost(); + bool launch_browser_; + bool prompt_after_setup_; + DISALLOW_COPY_AND_ASSIGN(CFUrlRequestUnittestRunner); }; |