From 715a09ff47f7bbd64b07ccec2c3619d38512869f Mon Sep 17 00:00:00 2001 From: karlr42 Date: Thu, 6 Mar 2014 16:29:17 +0000 Subject: [PATCH] Added tests around the Priority attribute of cookies. --- Net/testsuite/src/HTTPCookieTest.cpp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/Net/testsuite/src/HTTPCookieTest.cpp b/Net/testsuite/src/HTTPCookieTest.cpp index 641a23a1c..a64339c9f 100644 --- a/Net/testsuite/src/HTTPCookieTest.cpp +++ b/Net/testsuite/src/HTTPCookieTest.cpp @@ -80,8 +80,15 @@ void HTTPCookieTest::testCookie() assert (cookie.toString() == "name=value; domain=appinf.com; path=/; secure"); cookie.setHttpOnly(true); assert (cookie.toString() == "name=value; domain=appinf.com; path=/; secure; HttpOnly"); + cookie.setPriority("Low"); + assert (cookie.toString() == "name=value; domain=appinf.com; path=/; Priority=Low; secure; HttpOnly"); + cookie.setPriority("Medium"); + assert (cookie.toString() == "name=value; domain=appinf.com; path=/; Priority=Medium; secure; HttpOnly"); + cookie.setPriority("High"); + assert (cookie.toString() == "name=value; domain=appinf.com; path=/; Priority=High; secure; HttpOnly"); + cookie.setPriority(""); cookie.setHttpOnly(false); - + cookie.setVersion(1); assert (cookie.toString() == "name=\"value\"; Comment=\"comment\"; Domain=\"appinf.com\"; Path=\"/\"; secure; Version=\"1\""); @@ -91,6 +98,14 @@ void HTTPCookieTest::testCookie() cookie.setHttpOnly(true); assert (cookie.toString() == "name=\"value\"; Comment=\"comment\"; Domain=\"appinf.com\"; Path=\"/\"; Max-Age=\"100\"; HttpOnly; Version=\"1\""); + + cookie.setPriority("Low"); + assert (cookie.toString() == "name=\"value\"; Comment=\"comment\"; Domain=\"appinf.com\"; Path=\"/\"; Priority=\"Low\"; Max-Age=\"100\"; HttpOnly; Version=\"1\""); + cookie.setPriority("Medium"); + assert (cookie.toString() == "name=\"value\"; Comment=\"comment\"; Domain=\"appinf.com\"; Path=\"/\"; Priority=\"Medium\"; Max-Age=\"100\"; HttpOnly; Version=\"1\""); + cookie.setPriority("High"); + assert (cookie.toString() == "name=\"value\"; Comment=\"comment\"; Domain=\"appinf.com\"; Path=\"/\"; Priority=\"High\"; Max-Age=\"100\"; HttpOnly; Version=\"1\""); + }