3 <script src=
"inspector-test.js"></script>
7 function callback(result
)
9 for (var i
= 0; i
< result
.length
; ++i
)
10 output("[" + result
[i
] + "]");
13 evaluateInWebInspector("frontend_doitAndDump", callback
);
16 function frontend_doitAndDump()
19 frontend_createCookie("insecureOnlyWebkit", "1234567890", false, "webkit.org", "/"),
20 frontend_createCookie("insecureAllWebkit", "1234567890123456", false, ".webkit.org", "/"),
21 frontend_createCookie("insecureAllWebkitPath", "1234567890123456", false, ".webkit.org", "/path"),
22 frontend_createCookie("secureOnlyWebkitPath", "bar", true, "webkit.org", "/path"),
23 frontend_createCookie("secureAllWebkit", "foo", true, ".webkit.org", "/"),
24 frontend_createCookie("secureAllWebkitPath", "foo", true, ".webkit.org", "/path"),
25 frontend_createCookie("insecureOnlyWebkitPort", "1234567890", false, "webkit.org", "/", 80),
26 frontend_createCookie("insecureAllWebkitPort", "1234567890123456", false, ".webkit.org", "/", 80),
27 frontend_createCookie("insecureAllWebkitPathPort", "1234567890123456", false, ".webkit.org", "/path", 80),
28 frontend_createCookie("secureOnlyWebkitPathPort", "bar", true, "webkit.org", "/path", 80),
29 frontend_createCookie("secureAllWebkitPort", "foo", true, ".webkit.org", "/", 80),
30 frontend_createCookie("secureAllWebkitPathPort", "foo", true, ".webkit.org", "/path", 80),
31 frontend_createCookie("nonMatching1", "bar", false, "webkit.zoo", "/"),
32 frontend_createCookie("nonMatching2", "bar", false, "webkit.org", "/badPath"),
33 frontend_createCookie("nonMatching3", "bar", true, ".moo.com", "/")
37 "http://webkit.org", // 0
38 "http://www.webkit.org:81", // 1
39 "http://webkit.org/path", // 2
40 "http://www.webkit.org/path", // 3
41 "https://webkit.org/", // 4
42 "https://www.webkit.org/", // 5
43 "https://webkit.org:81/path", // 6
44 "https://www.webkit.org/path", // 7
46 "http://webkit.org:80", // 8
47 "http://www.webkit.org:80", // 9
48 "http://webkit.org:80/path", // 10
49 "http://www.webkit.org:80/path", // 11
50 "https://webkit.org:80/", // 12
51 "https://www.webkit.org:80/", // 13
52 "https://webkit.org:80/path", // 14
53 "https://www.webkit.org:80/path", // 15
55 "http://www.boo.com:80", // 16
56 "https://www.boo.com:80/path", // 17
57 "http://www.moo.com:80/", // 18
58 "http://www.boo.com:80", // 19
59 "https://www.boo.com:80/path", // 20
60 "http://www.moo.com:80/" // 21
64 for (var i
= 0; i
< cookies
.length
; ++i
) {
65 var cookieResult
= [];
66 for (var j
= 0; j
< resourceURLs
.length
; ++j
) {
67 if (WebInspector
.Cookies
.cookieMatchesResourceURL(cookies
[i
], resourceURLs
[j
]))
70 result
.push(cookieResult
);
75 function frontend_createCookie(name
, value
, secure
, domain
, path
, port
)
83 expires
: "Thu Jan 01 1970 00:00:00 GMT",
84 size
: name
.length
+ value
.length
,
94 <body onload=
"onload()">
96 Tests that cookies are matched up with resources correctly.