diff options
author | tommi@chromium.org <tommi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-26 02:45:20 +0000 |
---|---|---|
committer | tommi@chromium.org <tommi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-26 02:45:20 +0000 |
commit | fb716b3026d6ae399d069c221bf1f59a1fd3d231 (patch) | |
tree | 180967d696fee840cd54970b19b61ef7aa55f217 /chrome_frame | |
parent | c679106f6b5f7ec51ff7330c2aaa844aba91b965 (diff) | |
download | chromium_src-fb716b3026d6ae399d069c221bf1f59a1fd3d231.zip chromium_src-fb716b3026d6ae399d069c221bf1f59a1fd3d231.tar.gz chromium_src-fb716b3026d6ae399d069c221bf1f59a1fd3d231.tar.bz2 |
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
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@42724 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame')
-rw-r--r-- | chrome_frame/test/urlmon_moniker_integration_test.cc | 19 | ||||
-rw-r--r-- | chrome_frame/urlmon_bind_status_callback.cc | 12 |
2 files changed, 27 insertions, 4 deletions
diff --git a/chrome_frame/test/urlmon_moniker_integration_test.cc b/chrome_frame/test/urlmon_moniker_integration_test.cc index 45b16b2..3103504 100644 --- a/chrome_frame/test/urlmon_moniker_integration_test.cc +++ b/chrome_frame/test/urlmon_moniker_integration_test.cc @@ -246,17 +246,30 @@ TEST_F(UrlmonMonikerTest, BindToStorageAsynchronous) { 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, DISABLED_BindToStorageSwitchContent) { +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( @@ -296,7 +309,7 @@ TEST_F(UrlmonMonikerTest, BindToStorageCachedContent) { 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 diff --git a/chrome_frame/urlmon_bind_status_callback.cc b/chrome_frame/urlmon_bind_status_callback.cc index 4b195b9..d7608ce 100644 --- a/chrome_frame/urlmon_bind_status_callback.cc +++ b/chrome_frame/urlmon_bind_status_callback.cc @@ -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 @@ HRESULT CFUrlmonBindStatusCallback::OnDataAvailable(DWORD bscf, DWORD size, 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. |