Update web-platform-tests to revision 0d318188757a9c996e20b82db201fd04de5aa255

This commit is contained in:
James Graham 2015-03-27 09:15:38 +00:00
parent b2a5225831
commit 1a81b18b9f
12321 changed files with 544385 additions and 6 deletions

View file

@ -0,0 +1,23 @@
<!DOCTYPE HTML>
<html manifest="../resources/manifest/clock.manifest">
<head>
<title>Offline Application Cache - API_status_CHECKING</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
</head>
<body>
<ol>
<li>Refresh the page.</li>
</ol>
<div id="log"></div>
<script>
var t = async_test("checking status test"),
cache = window.applicationCache;
cache.onchecking = t.step_func_done(function() {
assert_equals(cache.status, cache.CHECKING, "cache.status should equals cache.CHECKING");
});
</script>
</body>
</html>

View file

@ -0,0 +1,24 @@
<!DOCTYPE HTML>
<html manifest="../resources/manifest/clock.manifest">
<head>
<title>Offline Application Cache - API_status_DOWNLOADING</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
</head>
<body>
<ol>
<li>Modify the commented part in the manifest file (manifest/clock.manifest) on the server.</li>
<li>Refresh the page.</li>
</ol>
<div id="log"></div>
<script>
var t = async_test("downloading status test"),
cache = window.applicationCache;
cache.ondownloading = t.step_func_done(function() {
assert_equals(cache.status, cache.DOWNLOADING, "cache.status should equals cache.DOWNLOADING");
});
</script>
</body>
</html>

View file

@ -0,0 +1,22 @@
<!DOCTYPE HTML>
<html manifest="../resources/manifest/clock.manifest">
<head>
<title>Offline Application Cache - API_status_IDLE</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
</head>
<body>
<div id="log"></div>
<script>
var t = async_test("idle status test"),
cache = window.applicationCache;
setTimeout(function(){
t.step(function() {
assert_equals(cache.status, cache.IDLE, "cache.status should equals cache.IDLE");
});
t.done();
}, 3000);
</script>
</body>
</html>

View file

@ -0,0 +1,24 @@
<!DOCTYPE HTML>
<html manifest="../resources/manifest/clock.manifest">
<head>
<title>Offline Application Cache - API_status_OBSOLETE</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
</head>
<body>
<ol>
<li>Remove the manifest file (manifest/clock.manifest) from the server.</li>
<li>Refresh the page.</li>
</ol>
<div id="log"></div>
<script>
var t = async_test("obsolete status test"),
cache = window.applicationCache;
cache.onobsolete = t.step_func_done(function() {
assert_equals(cache.status, cache.OBSOLETE, "cache.status should equals cache.OBSOLETE");
});
</script>
</body>
</html>

View file

@ -0,0 +1,19 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Offline Application Cache - API_status_UNCACHED</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
</head>
<body>
<div id="log"></div>
<script>
var cache = window.applicationCache;
test(function(){
assert_equals(cache.status, cache.UNCACHED, "uncached status test");
});
</script>
</body>
</html>

View file

@ -0,0 +1,25 @@
<!DOCTYPE HTML>
<html manifest="../resources/manifest/clock.manifest">
<head>
<title>Offline Application Cache - API_status_UPDATEREADY</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
</head>
<body>
<ol>
<li>Modify the commented part in the manifest file (manifest/clock.manifest) on the server.</li>
<li>Refresh the page.</li>
</ol>
<div id="log"></div>
<script>
var t = async_test("updateready status test"),
cache = window.applicationCache;
cache.onupdateready = t.step_func_done(function() {
assert_equals(cache.status, cache.UPDATEREADY, "cache.status should equals cache.UPDATEREADY");
});
</script>
</body>
</html>

View file

@ -0,0 +1,30 @@
<!DOCTYPE HTML>
<html manifest="../resources/manifest/clock.manifest">
<head>
<title>Offline Application Cache - API_swapCache</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
</head>
<body>
<ol>
<li>Modify the part of comment in manifest file of server.</li>
<li>Refresh the page.</li>
</ol>
<div id="log"></div>
<script>
var t = async_test("swapCache method test");
var cache = window.applicationCache;
cache.onupdateready = t.step_func(function() {
try {
cache.swapCache();
t.done();
} catch (e) {
assert_unreached("swapCache method failed.");
}
});
</script>
</body>
</html>

View file

@ -0,0 +1,19 @@
<!DOCTYPE HTML>
<html manifest="../resources/manifest/clock.manifest">
<head>
<title>Offline Application Cache - API_swapCache_error</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
</head>
<body>
<div id="log"></div>
<script>
var cache = window.applicationCache;
test(function() {
assert_throws("INVALID_STATE_ERR", function(){cache.swapCache();});
}, "INVALID_STATE_ERR error test")
</script>
</body>
</html>

View file

@ -0,0 +1,24 @@
<!DOCTYPE HTML>
<html manifest="../resources/manifest/clock.manifest">
<head>
<title>Offline Application Cache - API_update</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
</head>
<body>
<div id="log"></div>
<script>
var cache = window.applicationCache;
test(function() {
try {
cache.update()
assert_true(true, "update method test")
} catch (e) {
assert_unreached("update method failed.");
}
});
</script>
</body>
</html>

View file

@ -0,0 +1,24 @@
<!DOCTYPE HTML>
<html manifest="../resources/manifest/clock.manifest">
<head>
<title>Offline Application Cache - API_update_error</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
</head>
<body>
<ol>
<li>Remove the manifest file (manifest/clock.manifest) from the server.</li>
<li>Refresh the page, then calling update() will throw InvalidStateError exception.</li>
</ol>
<div id="log"></div>
<script>
var cache = window.applicationCache;
test(function() {
assert_throws("INVALID_STATE_ERR", function(){cache.update();});
}, "INVALID_STATE_ERR error test")
</script>
</body>
</html>