diff options
author | tim@chromium.org <tim@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-25 01:45:44 +0000 |
---|---|---|
committer | tim@chromium.org <tim@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-25 01:45:44 +0000 |
commit | 4c3030ff6a6e15798d7d52a40e52de7d86db4057 (patch) | |
tree | 5053ad72c34da1368e759a694d2bcccc8c1799b4 /chrome/browser | |
parent | ce4f3bda0b09ed2cfd4773d493aeb432428a4cfc (diff) | |
download | chromium_src-4c3030ff6a6e15798d7d52a40e52de7d86db4057.zip chromium_src-4c3030ff6a6e15798d7d52a40e52de7d86db4057.tar.gz chromium_src-4c3030ff6a6e15798d7d52a40e52de7d86db4057.tar.bz2 |
Make HttpBridge::AllowSendingCookies return true for now.
TEST=HttpBridgeTest, sync integration
BUG=20182
Review URL: http://codereview.chromium.org/173325
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24206 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r-- | chrome/browser/sync/glue/http_bridge.h | 9 | ||||
-rw-r--r-- | chrome/browser/sync/glue/http_bridge_unittest.cc | 6 |
2 files changed, 13 insertions, 2 deletions
diff --git a/chrome/browser/sync/glue/http_bridge.h b/chrome/browser/sync/glue/http_bridge.h index bb2af84..b2f4cbf 100644 --- a/chrome/browser/sync/glue/http_bridge.h +++ b/chrome/browser/sync/glue/http_bridge.h @@ -63,7 +63,9 @@ class HttpBridge : public base::RefCountedThreadSafe<HttpBridge>, } virtual bool AllowSendingCookies(const URLRequest* request) const { - return false; // Never send cookies. + // TODO(chron): http://crbug.com/20182. Change this to return false once + // all clients use Authenticate: header auth mode. + return true; } private: @@ -83,6 +85,11 @@ class HttpBridge : public base::RefCountedThreadSafe<HttpBridge>, const char* content); virtual void AddCookieForRequest(const char* cookie); virtual bool MakeSynchronousPost(int* os_error_code, int* response_code); + + // WARNING: these response content methods are used to extract plain old data + // and not null terminated strings, so you should make sure you have read + // GetResponseContentLength() characters when using GetResponseContent. e.g + // string r(b->GetResponseContent(), b->GetResponseContentLength()). virtual int GetResponseContentLength() const; virtual const char* GetResponseContent() const; virtual int GetResponseCookieCount() const; diff --git a/chrome/browser/sync/glue/http_bridge_unittest.cc b/chrome/browser/sync/glue/http_bridge_unittest.cc index 6b585f4..b817a49 100644 --- a/chrome/browser/sync/glue/http_bridge_unittest.cc +++ b/chrome/browser/sync/glue/http_bridge_unittest.cc @@ -158,8 +158,12 @@ TEST_F(HttpBridgeTest, TestMakeSynchronousPostLiveComprehensive) { EXPECT_EQ(0, http_bridge->GetResponseCookieCount()); std::string response(http_bridge->GetResponseContent(), http_bridge->GetResponseContentLength()); - +#if BUG_20182_FIXED + // TODO(chron): Re-enable this expectation. EXPECT_EQ(std::string::npos, response.find("Cookie:")); +#else + EXPECT_NE(std::string::npos, response.find("Cookie:")); +#endif EXPECT_NE(std::string::npos, response.find("User-Agent: bob")); EXPECT_NE(std::string::npos, response.find(test_payload.c_str())); } |