blob: 9ee52a71acc2266e6f9e5e1bfe173cb21b08ea02 [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<script src="../../../resources/js-test.js"></script>
<script src="resources/file-drag-common.js"></script>
</head>
<body>
<input type="file" name="file" id="file">
<script>
description("This tests the value attribute in file input forms with page zoom in");
if (window.testRunner) {
testRunner.zoomPageIn();
testRunner.zoomPageIn();
testRunner.zoomPageIn();
var file = document.getElementById("file");
dragFilesOntoInput(file, ["foo.txt"]);
shouldBeEqualToString("file.value", "C:\\fakepath\\foo.txt");
shouldBe("file.files.length", "1");
shouldThrow("file.value = 'foo'");
shouldBeEqualToString("file.value", "C:\\fakepath\\foo.txt");
shouldBe("file.files.length", "1");
file.value = "";
shouldBeEqualToString("file.value", "");
shouldBe("file.files.length", "0");
}
</script>
</body>
</html>