Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / files / apply-blob-url-to-img.html
blob5dd2d0ca54c3b62e4e96b476e5d89a1d7aaea425
1 <!DOCTYPE html>
2 <html>
3 <body>
4 <input type="file" name="file" id="file" onchange="onInputFileChange()">
5 <img id='imgToReplace' src=''>
6 <pre id='console'></pre>
8 <script>
9 function log(message)
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);
23 function onImgLoad()
25 var img = document.getElementById('imgToReplace');
26 log("New image: " + img.width + " x " + img.height);
27 log("DONE");
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);
39 function runTests()
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;
51 </script>
52 </body>
53 </html>