diff options
author | tommi@chromium.org <tommi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-01-22 02:01:50 +0000 |
---|---|---|
committer | tommi@chromium.org <tommi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-01-22 02:01:50 +0000 |
commit | 0a5210ff6726192d2d6058b1df1c993d8b592b69 (patch) | |
tree | 130003c1a44957cb1ab2cfe012e4d7d4f10ddc2c /chrome_frame/test/html_util_unittests.cc | |
parent | 675a578e829ebcc891b62b6343b04077075b1863 (diff) | |
download | chromium_src-0a5210ff6726192d2d6058b1df1c993d8b592b69.zip chromium_src-0a5210ff6726192d2d6058b1df1c993d8b592b69.tar.gz chromium_src-0a5210ff6726192d2d6058b1df1c993d8b592b69.tar.bz2 |
Fix for FullTabModeIE_ChromeFrameDeleteCookieTest and issues with deleting persistent cookies as reported in bug 30786.
TEST=Run FullTabModeIE_ChromeFrameDeleteCookieTest.
BUG=32546,30786
Review URL: http://codereview.chromium.org/551101
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@36831 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame/test/html_util_unittests.cc')
-rw-r--r-- | chrome_frame/test/html_util_unittests.cc | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/chrome_frame/test/html_util_unittests.cc b/chrome_frame/test/html_util_unittests.cc index 7884638..5670055 100644 --- a/chrome_frame/test/html_util_unittests.cc +++ b/chrome_frame/test/html_util_unittests.cc @@ -385,3 +385,23 @@ TEST(HttpCookieTest, IdentifyDuplicateCookieTest) { "BLAH", header_cookies)); } +TEST(HttpCookieTest, SetCookiePathToRootIfNotPresentTest) { + struct TestCase { + std::string input; + std::string expected; + } test_cases[] = { + { "", "" }, + { "Cookie=value", "Cookie=value; path=/" }, + { "Cookie=value;", "Cookie=value; path=/" }, + { "Cookie=value; ", "Cookie=value; path=/" }, + { " Cookie=value; ", "Cookie=value; path=/" }, + { "Cookie=", "Cookie=; path=/" }, + { "Cookie=foo; path=/bar", "Cookie=foo; path=/bar" }, + }; + + for (int i = 0; i < arraysize(test_cases); ++i) { + std::string& cookie(test_cases[i].input); + URLRequestAutomationJob::SetCookiePathToRootIfNotPresent(&cookie); + EXPECT_EQ(cookie, test_cases[i].expected); + } +} |