summaryrefslogtreecommitdiffstats
path: root/chrome_frame/test
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
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')
-rw-r--r--chrome_frame/test/http_negotiate_unittest.cc90
-rw-r--r--chrome_frame/test/navigation_test.cc22
-rw-r--r--chrome_frame/test/test_with_web_server.cc15
-rw-r--r--chrome_frame/test/ui_test.cc4
4 files changed, 5 insertions, 126 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;
diff --git a/chrome_frame/test/navigation_test.cc b/chrome_frame/test/navigation_test.cc
index b760857..c8861d9 100644
--- a/chrome_frame/test/navigation_test.cc
+++ b/chrome_frame/test/navigation_test.cc
@@ -69,10 +69,6 @@ TEST_P(FullTabNavigationTest, TypeUrl) {
// This tests navigation to a typed URL containing an fragment.
TEST_P(FullTabNavigationTest, TypeAnchorUrl) {
- if (IsIBrowserServicePatchEnabled()) {
- LOG(ERROR) << "Not running test. IBrowserServicePatch is in place.";
- return;
- }
MockAccEventObserver acc_observer;
EXPECT_CALL(acc_observer, OnAccDocLoad(_)).Times(testing::AnyNumber());
AccObjectMatcher address_matcher(L"Address", L"editable text");
@@ -284,10 +280,6 @@ TEST_P(FullTabNavigationTest, FLAKY_RestrictedSite) {
LOG(ERROR) << "Test disabled for this configuration.";
return;
}
- if (IsIBrowserServicePatchEnabled()) {
- LOG(ERROR) << "Not running test. IBrowserServicePatch is in place.";
- return;
- }
MockWindowObserver win_observer_mock;
ScopedComPtr<IInternetSecurityManager> security_manager;
@@ -300,8 +292,6 @@ TEST_P(FullTabNavigationTest, FLAKY_RestrictedSite) {
EXPECT_CALL(ie_mock_, OnFileDownload(_, _)).Times(testing::AnyNumber());
server_mock_.ExpectAndServeAnyRequests(GetParam());
- ProtocolPatchMethod patch_method = GetPatchMethod();
-
const char* kAlertDlgCaption = "Security Alert";
EXPECT_CALL(ie_mock_, OnBeforeNavigate2(
@@ -311,13 +301,11 @@ TEST_P(FullTabNavigationTest, FLAKY_RestrictedSite) {
.Times(1)
.WillOnce(WatchWindow(&win_observer_mock, kAlertDlgCaption, ""));
- if (patch_method == PATCH_METHOD_INET_PROTOCOL) {
- EXPECT_CALL(ie_mock_, OnBeforeNavigate2(
- _,
- testing::Field(&VARIANT::bstrVal, testing::HasSubstr(L"res://")),
- _, _, _, _, _))
- .Times(testing::AtMost(1));
- }
+ EXPECT_CALL(ie_mock_, OnBeforeNavigate2(
+ _,
+ testing::Field(&VARIANT::bstrVal, testing::HasSubstr(L"res://")),
+ _, _, _, _, _))
+ .Times(testing::AtMost(1));
EXPECT_CALL(ie_mock_, OnNavigateComplete2(_,
testing::Field(&VARIANT::bstrVal, StrEq(GetSimplePageUrl()))))
diff --git a/chrome_frame/test/test_with_web_server.cc b/chrome_frame/test/test_with_web_server.cc
index db057ff..0fca76c 100644
--- a/chrome_frame/test/test_with_web_server.cc
+++ b/chrome_frame/test/test_with_web_server.cc
@@ -921,22 +921,12 @@ const wchar_t kAnchorUrlNavigate[] =
L"fulltab_anchor_url_navigate.html#chrome_frame";
TEST_F(ChromeFrameTestWithWebServer, FullTabModeIE_AnchorUrlNavigateTest) {
- if (IsIBrowserServicePatchEnabled()) {
- LOG(ERROR) << "Not running test. IBrowserServicePatch is in place.";
- return;
- }
-
SimpleBrowserTest(IE, kAnchorUrlNavigate);
}
// Test whether POST-ing a form from an mshtml page to a CF page will cause
// the request to get reissued. It should not.
TEST_F(ChromeFrameTestWithWebServer, FullTabModeIE_TestPostReissue) {
- if (IsIBrowserServicePatchEnabled()) {
- LOG(ERROR) << "Not running test. IBrowserServicePatch is in place.";
- return;
- }
-
// The order of pages in this array is assumed to be mshtml, cf, script.
const wchar_t* kPages[] = {
L"full_tab_post_mshtml.html",
@@ -968,11 +958,6 @@ TEST_F(ChromeFrameTestWithWebServer, FullTabModeIE_TestPostReissue) {
// Test whether following a link from an mshtml page to a CF page will cause
// multiple network requests. It should not.
TEST_F(ChromeFrameTestWithWebServer, FullTabModeIE_TestMultipleGet) {
- if (IsIBrowserServicePatchEnabled()) {
- LOG(ERROR) << "Not running test. IBrowserServicePatch is in place.";
- return;
- }
-
// The order of pages in this array is assumed to be mshtml, cf, script.
const wchar_t* kPages[] = {
L"full_tab_get_mshtml.html",
diff --git a/chrome_frame/test/ui_test.cc b/chrome_frame/test/ui_test.cc
index a355d0e..169bcc1 100644
--- a/chrome_frame/test/ui_test.cc
+++ b/chrome_frame/test/ui_test.cc
@@ -193,10 +193,6 @@ TEST_P(FullTabUITest, FLAKY_CtrlW) {
// Test address bar navigation with Alt+d and URL.
TEST_P(FullTabUITest, FLAKY_AltD) {
- if (IsIBrowserServicePatchEnabled()) {
- LOG(ERROR) << "Not running test. IBrowserServicePatch is in place.";
- return;
- }
EXPECT_CALL(ie_mock_, OnLoad(GetParam().invokes_cf(),
StrEq(GetSimplePageUrl())))
.WillOnce(testing::DoAll(