summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/filesystem/null-arguments.html
blob: ba87454981545e43a5c2b53b6133be805e1c28ad (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<html>
<head>
<script src="../../resources/js-test.js"></script>
<script src="resources/fs-test-util.js"></script>
</head>
<body>
<script>
description('This test tries calling various filesystem functions with null arguments.');

function errorCallback(error)
{
    debug("Error occured: " + error.name);
    finishJSTest();
}

function successCallback(fs)
{
    window.fileSystem = fs;
    debug("Successfully obtained FileSystem: " + fileSystem.name);

    shouldThrow("fileSystem.root.moveTo(null)");
    shouldThrow("fileSystem.root.copyTo(null)");
    fileSystem.root.getFile("/test", { create: true }, function(entry) {
        entry.createWriter(function(writer) {
            window.writer = writer;
            shouldBeNull("writer.error");
            shouldThrow("writer.write(null)");
            shouldBeNull("writer.error");
            finishJSTest();
        });
    });
}

if (window.webkitRequestFileSystem) {
    webkitRequestFileSystem(window.TEMPORARY, 100, successCallback, errorCallback);
    window.jsTestIsAsync = true;
} else {
    debug("This test requires FileSystem API support.");
}
</script>
</body>
</html>