1 <html manifest=
"resources/cyrillic-uri.manifest">
3 <meta charset=
"koi8-r">
6 <p>Test that non-ASCII URIs work correctly in cache manifests.
</p>
7 <p>Should be a series of PASS messages, followed with DONE.
</p>
11 if (window
.testRunner
) {
12 testRunner
.dumpAsText();
13 testRunner
.waitUntilDone();
18 document
.getElementById("result").innerHTML
+= message
+ "<br>";
23 var req
= new XMLHttpRequest
;
24 req
.open("GET", url
, false);
26 return req
.responseText
;
32 var req
= new XMLHttpRequest
;
33 req
.open("GET", url
, false);
41 function shouldBeLoadable(url
)
43 log((canLoad(url
) ? "PASS: " : "FAIL: ") + url
);
48 // Path is always UTF-8.
49 shouldBeLoadable("resources/intercept/cached-ðÒÏ×ÅÒËÁ");
50 shouldBeLoadable("resources/intercept/cached-%D0%9F%D1%80%D0%BE%D0%B2%D0%B5%D1%80%D0%BA%D0%B0");
51 shouldBeLoadable("resources/intercept/cached2-ðÒÏ×ÅÒËÁ");
52 shouldBeLoadable("resources/intercept/cached2-%D0%9F%D1%80%D0%BE%D0%B2%D0%B5%D1%80%D0%BA%D0%B0");
53 shouldBeLoadable("resources/intercept/network-ðÒÏ×ÅÒËÁ-PASS");
54 shouldBeLoadable("resources/intercept/network-%D0%9F%D1%80%D0%BE%D0%B2%D0%B5%D1%80%D0%BA%D0%B0-PASS");
55 shouldBeLoadable("resources/does-not-exist-ðÒÏ×ÅÒËÁ");
57 // To test encodings other than UTF-8, we need to simulate form submission (for XHR, Firefox
58 // always uses UTF-8, even in query part).
59 applicationCache
.onnoupdate
= null;
60 applicationCache
.oncached
= null;
61 window
.addEventListener("message", frameDone
, false);
62 var ifr
= document
.createElement("iframe");
63 ifr
.setAttribute("src", "resources/cyrillic-uri-form.html");
64 document
.body
.appendChild(ifr
);
67 function frameDone(evt
)
70 if (window
.testRunner
)
71 testRunner
.notifyDone();
74 applicationCache
.onnoupdate = function() { test() }
75 applicationCache
.oncached = function() { test() }
77 applicationCache
.onupdateready = function() { log("FAIL: received unexpected updateready event") }
78 applicationCache
.onerror = function() { log("FAIL: received unexpected error event") }