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