summaryrefslogtreecommitdiffstats
path: root/chrome_frame/test/html_util_unittests.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chrome_frame/test/html_util_unittests.cc')
-rw-r--r--chrome_frame/test/html_util_unittests.cc24
1 files changed, 24 insertions, 0 deletions
diff --git a/chrome_frame/test/html_util_unittests.cc b/chrome_frame/test/html_util_unittests.cc
index 969e680..7884638 100644
--- a/chrome_frame/test/html_util_unittests.cc
+++ b/chrome_frame/test/html_util_unittests.cc
@@ -5,6 +5,8 @@
#include <windows.h>
#include <atlsecurity.h>
#include <shellapi.h>
+#include <string>
+#include <vector>
#include "base/basictypes.h"
#include "base/file_util.h"
@@ -22,6 +24,7 @@
#include "chrome_frame/chrome_frame_delegate.h"
#include "chrome_frame/html_utils.h"
#include "testing/gtest/include/gtest/gtest.h"
+#include "chrome/browser/automation/url_request_automation_job.h"
const char kChromeFrameUserAgent[] = "chromeframe";
@@ -360,4 +363,25 @@ TEST(HttpUtils, HasFrameBustingHeader) {
"X-Frame-Options: ALLOWall\r\n"));
}
+TEST(HttpCookieTest, IdentifyDuplicateCookieTest) {
+ std::vector<std::string> header_cookies;
+ header_cookies.push_back("BLAHHH; Path=/;");
+
+ EXPECT_FALSE(URLRequestAutomationJob::IsCookiePresentInCookieHeader(
+ "BLAHHH=1", header_cookies));
+
+ header_cookies.clear();
+
+ header_cookies.push_back("BLAHHH=1; Path=/;");
+
+ EXPECT_TRUE(URLRequestAutomationJob::IsCookiePresentInCookieHeader(
+ "BLAHHH=1", header_cookies));
+
+ header_cookies.clear();
+
+ header_cookies.push_back("BLAH=1; Path=/blah;");
+
+ EXPECT_FALSE(URLRequestAutomationJob::IsCookiePresentInCookieHeader(
+ "BLAH", header_cookies));
+}