1 if (this.importScripts
) {
2 importScripts('../resources/fs-worker-common.js');
3 importScripts('../../../resources/js-test.js');
4 importScripts('../resources/fs-test-util.js');
7 description("FileSystem API readonly attributes test.");
13 function setReadonlyProperty(property
, value
)
15 oldValue
= eval(property
);
16 debug("trying to set readonly property " + property
);
17 evalAndLog(property
+ " = " + value
);
18 newValue
= eval(property
);
19 if (oldValue
== newValue
) {
20 testPassed(property
+ " is still " + oldValue
);
22 testFailed(property
+ " value was changed");
26 function errorCallback(err
) {
31 function getFileCallback(entry
) {
33 setReadonlyProperty("fileEntry.isFile", "false");
34 setReadonlyProperty("fileEntry.isDirectory", "true");
35 setReadonlyProperty("fileEntry.name", "'bar'");
36 setReadonlyProperty("fileEntry.fullPath", "'bar'");
37 setReadonlyProperty("fileEntry.filesystem", "null");
41 function successCallback(fs
) {
43 setReadonlyProperty("fileSystem.name", "'bar'");
44 root
= evalAndLog("root = fileSystem.root");
45 evalAndLog("root.getFile('foo', {create:true}, getFileCallback, errorCallback)");
48 var jsTestIsAsync
= true;
49 evalAndLog("webkitRequestFileSystem(TEMPORARY, 100, successCallback, errorCallback)");