summaryrefslogtreecommitdiffstats
path: root/chrome_frame/test/http_negotiate_unittest.cc
diff options
context:
space:
mode:
authorananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-01 23:41:56 +0000
committerananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-01 23:41:56 +0000
commitaa2cf38beabe222641b145e1cf985c72acd46c1e (patch)
tree9859b7141aba180524b6792dc980e7fe9f24ed75 /chrome_frame/test/http_negotiate_unittest.cc
parent022001851f2f6be890f9b44c49fa45ea38fa80b2 (diff)
downloadchromium_src-aa2cf38beabe222641b145e1cf985c72acd46c1e.zip
chromium_src-aa2cf38beabe222641b145e1cf985c72acd46c1e.tar.gz
chromium_src-aa2cf38beabe222641b145e1cf985c72acd46c1e.tar.bz2
Fix a bug where in having ChromeFrame installed on the machine would cause a non chrome frame
email site to automatically logout after logging in. ChromeFrame appends the chromeframe string to the user agent to outgoing requests initiated from IE. However this was only done in the protocol sink patch for top level requests. Sub requests would carry the IE user agent which in this case would cause the web server to get confused and drop the connection. Fix is to resurrent the IHttpNegotiate vtable patch for the protocol patch as well. Removed the code which read the patch method from the registry and turned on the moniker or the httpequiv patch. It is unlikely that we will need this in the future. Cleaned up the http negotiate patch by removing references to the navigation manager and the ReportProgress patch which is not needed anymore. Fixes bug http://code.google.com/p/chromium/issues/detail?id=60745 Bug=60745 Review URL: http://codereview.chromium.org/4247001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@64688 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame/test/http_negotiate_unittest.cc')
-rw-r--r--chrome_frame/test/http_negotiate_unittest.cc90
1 files changed, 0 insertions, 90 deletions
diff --git a/chrome_frame/test/http_negotiate_unittest.cc b/chrome_frame/test/http_negotiate_unittest.cc
index 2fef40b..c56034b 100644
--- a/chrome_frame/test/http_negotiate_unittest.cc
+++ b/chrome_frame/test/http_negotiate_unittest.cc
@@ -185,96 +185,6 @@ END_COM_MAP()
base::win::ScopedComPtr<IWebBrowser2> browser_;
};
-TEST_F(HttpNegotiateTest, ReportProgress) {
- if (chrome_frame_test::GetInstalledIEVersion() == IE_6) {
- DVLOG(1) << "Not running test for IE6";
- return;
- }
- static const int kReportProgressIndex = 4;
- CComObjectStackEx<TestInternetProtocolSink> test_sink;
- IInternetProtocolSink_ReportProgress_Fn original =
- reinterpret_cast<IInternetProtocolSink_ReportProgress_Fn>(
- (*reinterpret_cast<void***>(
- static_cast<IInternetProtocolSink*>(
- &test_sink)))[kReportProgressIndex]);
-
- struct TestCase {
- bool mark_browser_;
- const ULONG status_;
- const std::wstring status_text_;
- const std::wstring expected_status_text_;
- } test_cases[] = {
- // Cases where we could switch the mime type.
- { true,
- BINDSTATUS_MIMETYPEAVAILABLE,
- L"text/html",
- kChromeMimeType },
- { false,
- BINDSTATUS_MIMETYPEAVAILABLE,
- L"text/html",
- L"text/html" },
- { true,
- BINDSTATUS_VERIFIEDMIMETYPEAVAILABLE,
- L"text/html",
- kChromeMimeType },
- { false,
- BINDSTATUS_VERIFIEDMIMETYPEAVAILABLE,
- L"text/html",
- L"text/html" },
- { true,
- LOCAL_BINDSTATUS_SERVER_MIMETYPEAVAILABLE,
- L"text/html",
- kChromeMimeType },
- { false,
- LOCAL_BINDSTATUS_SERVER_MIMETYPEAVAILABLE,
- L"text/html",
- L"text/html" },
-
- // Cases where we mark the browser but can't switch due to mime type.
- { true,
- BINDSTATUS_MIMETYPEAVAILABLE,
- L"application/pdf",
- L"application/pdf" },
- { true,
- BINDSTATUS_VERIFIEDMIMETYPEAVAILABLE,
- L"application/pdf",
- L"application/pdf" },
- { true,
- LOCAL_BINDSTATUS_SERVER_MIMETYPEAVAILABLE,
- L"application/pdf",
- L"application/pdf" },
-
- // Cases where we should do nothing.
- { false,
- BINDSTATUS_CONNECTING,
- L"foo",
- L"foo" },
- { false,
- BINDSTATUS_UPLOADINGDATA,
- L"bar",
- L"bar" },
- };
-
- base::win::ScopedComPtr<IBrowserService> browser;
- EXPECT_HRESULT_SUCCEEDED(GetBrowserServiceFromProtocolSink(&test_sink,
- browser.Receive()));
-
- for (int i = 0; i < arraysize(test_cases); ++i) {
- TestCase& test = test_cases[i];
- if (test.mark_browser_) {
- MarkBrowserOnThreadForCFNavigation(browser);
- }
-
- HRESULT hr = HttpNegotiatePatch::ReportProgress(original, &test_sink,
- test.status_, test.status_text_.c_str());
- EXPECT_EQ(S_OK, hr);
- // The TLS flag should always be cleared.
- EXPECT_FALSE(CheckForCFNavigation(browser, false));
- EXPECT_EQ(test.expected_status_text_, test_sink.last_status_text());
- EXPECT_EQ(test.status_, test_sink.last_status());
- }
-}
-
using testing::AllOf;
using testing::ContainsRegex;
using testing::HasSubstr;