r42885 - in branches/360/src/chrome_frame: . test

0 views
Skip to first unread message

am...@chromium.org

unread,
Mar 26, 2010, 9:01:01 PM3/26/10
to chromium...@chromium.org
Author: am...@chromium.org
Date: Fri Mar 26 18:01:01 2010
New Revision: 42885

Log:
Merge 42724 - Provide the chrome frame content type from tests which is what we handle in our CFUrlmonBindStatusCallback. Also check for the tls browser service flag in OnDataAvailable.

TEST=Fixes BindToStorageSwitchContent and BindToStorageCacheContent
BUG=39415
TBR=amit

Review URL: http://codereview.chromium.org/1361003

TBR=to...@chromium.org

Modified:
branches/360/src/chrome_frame/test/urlmon_moniker_integration_test.cc
branches/360/src/chrome_frame/urlmon_bind_status_callback.cc

Modified: branches/360/src/chrome_frame/test/urlmon_moniker_integration_test.cc
==============================================================================
--- branches/360/src/chrome_frame/test/urlmon_moniker_integration_test.cc (original)
+++ branches/360/src/chrome_frame/test/urlmon_moniker_integration_test.cc Fri Mar 26 18:01:01 2010
@@ -246,15 +246,30 @@
EXPECT_FALSE(test.nav_manager().HasRequestData());
}

+// Responds with the Chrome mime type.
+class ResponseWithContentType : public test_server::SimpleResponse {
+ public:
+ ResponseWithContentType(const char* request_path,
+ const std::string& contents)
+ : test_server::SimpleResponse(request_path, contents) {
+ }
+ virtual bool GetContentType(std::string* content_type) const {
+ *content_type = WideToASCII(kChromeMimeType);
+ return true;
+ }
+};
+
// Downloads a document asynchronously and then verifies that the downloaded
// contents were cached and the cache contents are correct.
+// TODO(tommi): Fix and re-enable.
+// http://code.google.com/p/chromium/issues/detail?id=39415
TEST_F(UrlmonMonikerTest, BindToStorageSwitchContent) {
const wchar_t test_url[] = L"http://localhost:43210/";
UrlmonMonikerTestManager test(test_url);
UrlmonMonikerTestCallback callback(&test);

test_server::SimpleWebServer server(43210);
- test_server::SimpleResponse default_response("/", kTestContent);
+ ResponseWithContentType default_response("/", kTestContent);
server.AddResponse(&default_response);

callback.SetCallbackExpectations(
@@ -294,7 +309,7 @@
UrlmonMonikerTestCallback callback(&test);

test_server::SimpleWebServer server(43210);
- test_server::SimpleResponse default_response("/", kTestContent);
+ ResponseWithContentType default_response("/", kTestContent);
server.AddResponse(&default_response);

// First set of expectations. Download the contents

Modified: branches/360/src/chrome_frame/urlmon_bind_status_callback.cc
==============================================================================
--- branches/360/src/chrome_frame/urlmon_bind_status_callback.cc (original)
+++ branches/360/src/chrome_frame/urlmon_bind_status_callback.cc Fri Mar 26 18:01:01 2010
@@ -4,6 +4,8 @@

#include "chrome_frame/urlmon_bind_status_callback.h"

+#include <shlguid.h>
+
#include "base/logging.h"
#include "base/string_util.h"

@@ -190,7 +192,15 @@
if (hr == INET_E_TERMINATED_BIND) {
// Check if the content type is CF's mime type.
UINT cf_format = ::RegisterClipboardFormatW(kChromeMimeType);
- if (format_etc->cfFormat == cf_format) {
+ bool override_bind_results = (format_etc->cfFormat == cf_format);
+ if (!override_bind_results) {
+ ScopedComPtr<IBrowserService> browser_service;
+ DoQueryService(SID_SShellBrowser, delegate_, browser_service.Receive());
+ override_bind_results = (browser_service != NULL) &&
+ CheckForCFNavigation(browser_service, false);
+ }
+
+ if (override_bind_results) {
// We want to complete fetching the entire document even though the
// delegate isn't interested in continuing.
// This happens when we switch from mshtml to CF.

Reply all
Reply to author
Forward
0 new messages