| <!DOCTYPE html> |
| <html> |
| <head> |
| <script src="../../../resources/js-test.js"></script> |
| <script src="../../editing.js"></script> |
| </head> |
| <body> |
| <div id="dropzone" style="width: 200px; height: 200px; background-color: grey;"></div> |
| <script> |
| description("Basic test coverage for fileSystemEntry.getParent() on the root"); |
| jsTestIsAsync = true; |
| |
| var dropzone = document.getElementById('dropzone'); |
| dropzone.ondrop = function(e) { |
| e.preventDefault(); |
| dataTransfer = e.dataTransfer; |
| |
| let entry = dataTransfer.items[0].webkitGetAsEntry(); |
| entry.filesystem.root.getParent(function(parent) { |
| rootParent = parent; |
| |
| // Should be the root itself. |
| shouldBeEqualToString("rootParent.name", ""); |
| shouldBeEqualToString("rootParent.fullPath", "/"); |
| shouldBeTrue("rootParent.isDirectory"); |
| shouldBeFalse("rootParent.isFile"); |
| |
| finishJSTest(); |
| }, function(e) { |
| testFailed("getParent() call failed: " + e); |
| finishJSTest(); |
| }); |
| }; |
| |
| dropzone.ondragover = function(ev) { |
| ev.preventDefault(); |
| } |
| |
| onload = function() { |
| dragFilesOntoElement(dropzone, ['../../../fast/forms/resources/test.txt']); |
| } |
| </script> |
| </body> |
| </html> |