Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / filesystem / simple-readonly-file-object.html
blob961ff9b81135d094bab1f558e335a1df6e1e9e2d
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script src="resources/fs-test-util.js"></script>
5 <script src="../../resources/js-test.js"></script>
6 </head>
7 <body>
8 <p id="description"></p>
9 <div id="console"></div>
10 <script>
11 description("Test readonly attributes of File.");
13 var fileSystem = null;
14 var testFileName = '/testFileEntry.txt';
15 var testFileEntry = null;
16 var testFile = null;
18 function setReadonlyProperty(property, value)
20 oldValue = eval(property);
21 debug("trying to set readonly property " + property);
22 evalAndLog(property + " = " + value);
23 newValue = eval(property);
24 if (oldValue == newValue) {
25 testPassed(property + " is still " + oldValue);
26 } else {
27 testFailed(property + " value was changed");
31 function errorCallback(error) {
32 testFailed("Error occured:" + error.name);
33 finishJSTest();
36 function fileCallback(file) {
37 testFile = file;
38 setReadonlyProperty("testFile.size", "1");
39 setReadonlyProperty("testFile.type", "'application/octet-stream'");
40 setReadonlyProperty("testFile.name", "'bar'");
41 finishJSTest();
44 function getFileFromEntry(entry) {
45 testFileEntry = entry;
46 evalAndLog("testFileEntry.file(fileCallback, errorCallback);");
49 function createTestFile() {
50 evalAndLog("fileSystem.root.getFile(testFileName, {create:true}, getFileFromEntry, errorCallback);");
53 function fileSystemCallback(fs) {
54 fileSystem = fs;
55 evalAndLog("removeAllInDirectory(fileSystem.root, createTestFile, errorCallback);");
58 var jsTestIsAsync = true;
59 evalAndLog("webkitRequestFileSystem(TEMPORARY, 100, fileSystemCallback, errorCallback);");
60 </script>
61 </body>
62 </html>