1 | void testMissingPath0() throws Exception {↵ | | 1 | void testRootPath0() throws Exception {↵
|
2 | URL url = new URL("http://d.e.f/goo.html");↵ | | 2 | URL url = new URL("http://d.e.f/goo.html");↵
|
3 | man.addCookieFromHeader("test=moo", url);↵ | | 3 | man.addCookieFromHeader("test=moo;path=/", url);↵
|
4 | String s = man.getCookieHeaderForURL(new URL("http://d.e.f/"));↵ | | 4 | String s = man.getCookieHeaderForURL(new URL("http://d.e.f/"));↵
|
5 | assertNotNull(s);↵ | | 5 | assertNotNull(s);↵
|
6 | assertEquals("test=moo", s);↵ | | 6 | assertEquals("test=moo", s);↵
|
7 | }↵ | | 7 | }↵
|
8 | ↵ | | 8 | ↵
|
9 | /** Tests missing cookie path for a non-trivial URL fetch from the ↵ | | 9 | /** Tests explicit root path with a non-trivial URL fetch from the ↵
|
10 | * domain. Note that this fails prior to a fix for BUG 38256↵ | | |
|
11 | */↵ | | 10 | domain */↵
|
12 | public void testMissingPath1() throws Exception {↵ | | 11 | public void testRootPath1() throws Exception {↵
|
13 | URL url = new URL("http://d.e.f/moo.html");↵ | | 12 | URL url = new URL("http://d.e.f/moo.html");↵
|
14 | man.addCookieFromHeader("test=moo", url);↵ | | 13 | man.addCookieFromHeader("test=moo;path=/", url);↵
|
15 | String s = man.getCookieHeaderForURL(new URL("http://d.e.f/goo.html"));↵ | | 14 | String s = man.getCookieHeaderForURL(new URL("http://d.e.f/goo.html"));↵
|
16 | assertNotNull(s);↵ | | 15 | assertNotNull(s);↵
|
17 | assertEquals("test=moo", s);↵ | | 16 | assertEquals("test=moo", s);↵
|
18 | } | | 17 | }
|