blob: b2ee4ff96e9a53faaa184efcd9400932c1b48528 [file] [log] [blame]
<!DOCTYPE html>
<meta charset=utf-8>
<title>Controlled frame for Cache API test with credentials</title>
<script>
function xhr(url, username, password) {
return new Promise(function(resolve, reject) {
var xhr = new XMLHttpRequest(), async = true;
xhr.open('GET', url, async, username, password);
xhr.send();
xhr.onreadystatechange = function() {
if (xhr.readyState !== XMLHttpRequest.DONE)
return;
if (xhr.status === 200) {
resolve(xhr.responseText);
} else {
reject(new Error(xhr.statusText));
}
};
});
}
</script>