diff options
author | jochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-02 18:24:55 +0000 |
---|---|---|
committer | jochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-02 18:24:55 +0000 |
commit | 9fb83e856fc12168151094df31e57177e4844417 (patch) | |
tree | 57e9721150e4f940a3bb1e6444e8423108005805 /net/url_request/url_request_unittest.cc | |
parent | 00b5930321cc07dd3ccf726a15f1e25fd78e2577 (diff) | |
download | chromium_src-9fb83e856fc12168151094df31e57177e4844417.zip chromium_src-9fb83e856fc12168151094df31e57177e4844417.tar.gz chromium_src-9fb83e856fc12168151094df31e57177e4844417.tar.bz2 |
Store blocked and accessed cookies in the tab contents.
This will enable chrome to display all cookies used/blocked on the current site to the user instead of just the information that something was blocked. The cookies are collected in data structures suitable for displaying them using the cookies tree model.
BUG=45230
TEST=none
Review URL: http://codereview.chromium.org/2370001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@51545 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/url_request/url_request_unittest.cc')
-rw-r--r-- | net/url_request/url_request_unittest.cc | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/net/url_request/url_request_unittest.cc b/net/url_request/url_request_unittest.cc index a15d82f..026038f 100644 --- a/net/url_request/url_request_unittest.cc +++ b/net/url_request/url_request_unittest.cc @@ -1265,7 +1265,7 @@ TEST_F(URLRequestTest, DoNotSendCookies) { EXPECT_TRUE(d.data_received().find("Cookie: CookieToNotSend=1") == std::string::npos); - // LOAD_DO_NOT_SEND_COOKIES does not trigger OnGetCookiesBlocked. + // LOAD_DO_NOT_SEND_COOKIES does not trigger OnGetCookies. EXPECT_EQ(0, d.blocked_get_cookies_count()); EXPECT_EQ(0, d.blocked_set_cookie_count()); } @@ -1288,6 +1288,7 @@ TEST_F(URLRequestTest, DoNotSaveCookies) { EXPECT_EQ(0, d.blocked_get_cookies_count()); EXPECT_EQ(0, d.blocked_set_cookie_count()); + EXPECT_EQ(1, d.set_cookie_count()); } // Try to set-up another cookie and update the previous cookie. @@ -1301,9 +1302,10 @@ TEST_F(URLRequestTest, DoNotSaveCookies) { MessageLoop::current()->Run(); - // LOAD_DO_NOT_SAVE_COOKIES does not trigger OnSetCookieBlocked. + // LOAD_DO_NOT_SAVE_COOKIES does not trigger OnSetCookie. EXPECT_EQ(0, d.blocked_get_cookies_count()); EXPECT_EQ(0, d.blocked_set_cookie_count()); + EXPECT_EQ(0, d.set_cookie_count()); } // Verify the cookies weren't saved or updated. @@ -1321,6 +1323,7 @@ TEST_F(URLRequestTest, DoNotSaveCookies) { EXPECT_EQ(0, d.blocked_get_cookies_count()); EXPECT_EQ(0, d.blocked_set_cookie_count()); + EXPECT_EQ(0, d.set_cookie_count()); } } @@ -1578,7 +1581,7 @@ TEST_F(URLRequestTest, CancelTest_During_CookiePolicy) { MessageLoop::current()->RunAllPending(); } -TEST_F(URLRequestTest, CancelTest_During_OnGetCookiesBlocked) { +TEST_F(URLRequestTest, CancelTest_During_OnGetCookies) { scoped_refptr<HTTPTestServer> server = HTTPTestServer::CreateServer(L"", NULL); ASSERT_TRUE(NULL != server.get()); @@ -1607,7 +1610,7 @@ TEST_F(URLRequestTest, CancelTest_During_OnGetCookiesBlocked) { context->set_cookie_policy(NULL); } -TEST_F(URLRequestTest, CancelTest_During_OnSetCookieBlocked) { +TEST_F(URLRequestTest, CancelTest_During_OnSetCookie) { scoped_refptr<HTTPTestServer> server = HTTPTestServer::CreateServer(L"", NULL); ASSERT_TRUE(NULL != server.get()); @@ -1630,9 +1633,9 @@ TEST_F(URLRequestTest, CancelTest_During_OnSetCookieBlocked) { EXPECT_EQ(URLRequestStatus::CANCELED, req.status().status()); // Even though the response will contain 3 set-cookie headers, we expect - // only one to be blocked as that first one will cause OnSetCookieBlocked - // to be called, which will cancel the request. Once canceled, it should - // not attempt to set further cookies. + // only one to be blocked as that first one will cause OnSetCookie to be + // called, which will cancel the request. Once canceled, it should not + // attempt to set further cookies. EXPECT_EQ(0, d.blocked_get_cookies_count()); EXPECT_EQ(1, d.blocked_set_cookie_count()); |