mirror of
https://github.com/pocoproject/poco.git
synced 2024-12-13 10:32:57 +01:00
Added tests around the Priority attribute of cookies.
This commit is contained in:
parent
7e2faf3bdf
commit
715a09ff47
@ -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\"");
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user