Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / forms / input-file-set-value.html
blob7ea0275b162454f7b4e0cf7945baa780b6e539c0
1 <!DOCTYPE html>
2 <script src="../../resources/js-test.js"></script>
4 <body>
6 <script>
7 description("Tests that setting the value of input type=file throws and changing type resets.");
9 input = document.createElement("input");
10 document.body.appendChild(input);
12 input.value = "example.txt";
13 shouldBeEqualToString("input.value", "example.txt");
14 input.type = "file";
15 shouldBeEqualToString("input.value", "");
16 shouldThrow('input.value = "foo"', '"InvalidStateError: Failed to set the \'value\' property on \'HTMLInputElement\': This input element accepts a filename, which may only be programmatically set to the empty string."');
17 input.value = "";
18 </script>