4 <input type=
"file" name=
"file" id=
"file" onchange=
"onInputFileChange()">
5 <img id='imgToReplace' src=''
>
6 <pre id='console'
></pre>
11 document
.getElementById('console').appendChild(document
.createTextNode(message
+ "\n"));
14 function onInputFileChange()
16 var file
= document
.getElementById("file").files
[0];
17 var img
= document
.getElementById('imgToReplace');
18 log("Old image: " + img
.width
+ " x " + img
.height
);
19 img
.onload
= onImgLoad
;
20 img
.src
= window
.URL
.createObjectURL(file
);
25 var img
= document
.getElementById('imgToReplace');
26 log("New image: " + img
.width
+ " x " + img
.height
);
28 if (testRunner
.notifyDone
)
29 testRunner
.notifyDone();
32 function moveMouseToCenterOfElement(element
)
34 var centerX
= element
.offsetLeft
+ element
.offsetWidth
/ 2;
35 var centerY
= element
.offsetTop
+ element
.offsetHeight
/ 2;
36 eventSender
.mouseMoveTo(centerX
, centerY
);
41 eventSender
.beginDragWithFiles(['resources/abe.png']);
42 moveMouseToCenterOfElement(document
.getElementById('file'));
43 eventSender
.mouseUp();
46 if (window
.eventSender
) {
47 testRunner
.dumpAsText();
48 testRunner
.waitUntilDone();
49 window
.onload
= runTests
;