diff options
author | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-22 02:30:03 +0000 |
---|---|---|
committer | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-22 02:30:03 +0000 |
commit | 1da35175c66788af1312547ec24d6e36234a0aa5 (patch) | |
tree | 43cb77c522b96a5ff903c1808fa1af26c24133ff | |
parent | db00e5d09920f72b7059a0bd2dc3853667a50353 (diff) | |
download | chromium_src-1da35175c66788af1312547ec24d6e36234a0aa5.zip chromium_src-1da35175c66788af1312547ec24d6e36234a0aa5.tar.gz chromium_src-1da35175c66788af1312547ec24d6e36234a0aa5.tar.bz2 |
The HttpNegotiateTest.ReportProgress test fails on IE6 as we fail to retrieve the IBrowserService interface.
Disabling this test for IE6 for now.
Review URL: http://codereview.chromium.org/1731003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@45277 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome_frame/chrome_frame.gyp | 6 | ||||
-rw-r--r-- | chrome_frame/test/chrome_frame_test_utils.cc | 32 | ||||
-rw-r--r-- | chrome_frame/test/chrome_frame_test_utils.h | 7 | ||||
-rw-r--r-- | chrome_frame/test/http_negotiate_unittest.cc | 5 |
4 files changed, 45 insertions, 5 deletions
diff --git a/chrome_frame/chrome_frame.gyp b/chrome_frame/chrome_frame.gyp index d067b0d..245bd3f 100644 --- a/chrome_frame/chrome_frame.gyp +++ b/chrome_frame/chrome_frame.gyp @@ -139,12 +139,18 @@ 'chrome_frame_unittest_main.cc', 'chrome_launcher_unittest.cc', 'function_stub_unittest.cc', + 'test/chrome_frame_test_utils.h', + 'test/chrome_frame_test_utils.cc', 'test/com_message_event_unittest.cc', 'test/html_util_unittests.cc', 'test/http_negotiate_unittest.cc', + 'test/simulate_input.h', + 'test/simulate_input.cc', 'test/urlmon_moniker_tests.h', 'test/urlmon_moniker_unittest.cc', 'test/util_unittests.cc', + 'test/window_watchdog.h', + 'test/window_watchdog.cc', 'unittest_precompile.h', 'unittest_precompile.cc', 'urlmon_upload_data_stream.cc', diff --git a/chrome_frame/test/chrome_frame_test_utils.cc b/chrome_frame/test/chrome_frame_test_utils.cc index e8d3889..8e985c0 100644 --- a/chrome_frame/test/chrome_frame_test_utils.cc +++ b/chrome_frame/test/chrome_frame_test_utils.cc @@ -734,6 +734,8 @@ HRESULT WebBrowserEventSink::CloseWebBrowser() { DCHECK(process_id_to_wait_for_ == 0); if (!web_browser2_) return E_FAIL; + + DisconnectFromChromeFrame(); web_browser2_->Quit(); return S_OK; } @@ -782,17 +784,37 @@ void WebBrowserEventSink::StopWatching() { window_watcher_.RemoveObserver(this); } +std::wstring GetExeVersion(const std::wstring& exe_path) { + scoped_ptr<FileVersionInfo> ie_version_info( + FileVersionInfo::CreateFileVersionInfo(FilePath(exe_path))); + return ie_version_info->product_version(); +} + +IEVersion GetInstalledIEVersion() { + std::wstring path = chrome_frame_test::GetExecutableAppPath(kIEImageName); + std::wstring version = GetExeVersion(path); + + switch (version[0]) { + case '6': + return IE_6; + case '7': + return IE_7; + case '8': + return IE_8; + default: + break; + } + + return IE_UNSUPPORTED; +} + FilePath GetProfilePathForIE() { FilePath profile_path; // Browsers without IDeleteBrowsingHistory in non-priv mode // have their profiles moved into "Temporary Internet Files". // The code below basically retrieves the version of IE and computes // the profile directory accordingly. - std::wstring path = chrome_frame_test::GetExecutableAppPath(kIEImageName); - scoped_ptr<FileVersionInfo> ie_version_info( - FileVersionInfo::CreateFileVersionInfo(FilePath(path))); - std::wstring ie_version = ie_version_info->product_version(); - if (ie_version[0] == L'8') { + if (GetInstalledIEVersion() == IE_8) { profile_path = GetProfilePath(kIEProfileName); } else { profile_path = GetIETemporaryFilesFolder(); diff --git a/chrome_frame/test/chrome_frame_test_utils.h b/chrome_frame/test/chrome_frame_test_utils.h index a3d032c..b7a3908 100644 --- a/chrome_frame/test/chrome_frame_test_utils.h +++ b/chrome_frame/test/chrome_frame_test_utils.h @@ -24,6 +24,7 @@ #include "chrome_frame/test_utils.h" #include "chrome_frame/test/simulate_input.h" #include "chrome_frame/test/window_watchdog.h" +#include "chrome_frame/utils.h" // Include without path to make GYP build see it. #include "chrome_tab.h" // NOLINT @@ -326,6 +327,12 @@ std::wstring GetExecutableAppPath(const std::wstring& file); // Returns the profile path to be used for IE. This varies as per version. FilePath GetProfilePathForIE(); +// Returns the version of the exe passed in. +std::wstring GetExeVersion(const std::wstring& exe_path); + +// Returns the version of Internet Explorer on the machine. +IEVersion GetInstalledIEVersion(); + } // namespace chrome_frame_test #endif // CHROME_FRAME_TEST_CHROME_FRAME_TEST_UTILS_H_ diff --git a/chrome_frame/test/http_negotiate_unittest.cc b/chrome_frame/test/http_negotiate_unittest.cc index a8d2228..b203f61 100644 --- a/chrome_frame/test/http_negotiate_unittest.cc +++ b/chrome_frame/test/http_negotiate_unittest.cc @@ -10,6 +10,7 @@ #include "base/string_util.h" #include "chrome_frame/http_negotiate.h" #include "chrome_frame/html_utils.h" +#include "chrome_frame/test/chrome_frame_test_utils.h" #include "chrome_frame/utils.h" #include "gtest/gtest.h" #include "gmock/gmock.h" @@ -183,6 +184,10 @@ END_COM_MAP() }; TEST_F(HttpNegotiateTest, ReportProgress) { + if (chrome_frame_test::GetInstalledIEVersion() == IE_6) { + DLOG(INFO) << "Not running test for IE6"; + return; + } static const int kReportProgressIndex = 4; CComObjectStackEx<TestInternetProtocolSink> test_sink; IInternetProtocolSink_ReportProgress_Fn original = |