summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/forms/file/input-file-re-render.html
blob: 24de2b3bfd6cac496f2449851260705986bc6392 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<!DOCTYPE html>
<html>
<body>
<form>
  <input type="file" name="file" multiple id="file">
</form>
<p>The file upload control above should have text '2 files,' not a filename.</p>

<script>
function startTest()
{
    var input = document.getElementById('file');

    // Drop 2 files to the control.
    eventSender.beginDragWithFiles(['input-file-re-render.html', 'script-tests/TEMPLATE.html']);
    eventSender.mouseMoveTo(10, 10);
    eventSender.mouseUp();

    // Delete the renderer.
    input.style.display = 'none';
    input.offsetWidth; // Force to do layout

    // Attach a renderer again.
    input.style.display = 'inline-block';

    layoutTestController.notifyDone();
}

if (window.eventSender) {
    window.onload = startTest;
    layoutTestController.waitUntilDone();
}
</script>
</body>
</html>