4 <script src=
"../../resources/js-test.js"></script>
9 border:
5px solid blue;
13 <body onload=
"runTest()">
14 <p id=
"description"></p>
15 <div contenteditable=true
id=
"target"></div>
16 <div><object id=
"source" data=
"resources/apple.gif" type=
"image/png" itemprop=
"somedata" arbitrary=
"green" draggable=true
></object></div>
17 <div id=
"console"></div>
20 description('This test verifies dropping an image does nothing. To test manually, drag the image and drop it in the rect with a blue border.');
21 var jsTestIsAsync
= true;
22 var target
= document
.getElementById('target');
23 var imageIsInserted
= false;
25 function contentInserted() {
26 shouldBe('target.getElementsByTagName("object").length', '1');
27 shouldBe('target.getElementsByTagName("object")[0].attributes.length', '6');
28 shouldBeEqualToString('target.getElementsByTagName("object")[0].id', 'source');
29 shouldBeEqualToString('target.getElementsByTagName("object")[0].type', 'image/png');
30 shouldBeTrue('target.getElementsByTagName("object")[0].draggable');
31 shouldBeEqualToString('target.getElementsByTagName("object")[0].attributes["itemprop"].value', 'somedata');
32 shouldBeEqualToString('target.getElementsByTagName("object")[0].attributes["arbitrary"].value', 'green');
33 imageIsInserted
= true;
37 target
.addEventListener('DOMNodeInserted', contentInserted
, false);
39 document
.getElementById('source').addEventListener('dragend', function() {
40 shouldBeFalse('imageIsInserted');
44 if (!window
.testRunner
)
47 testRunner
.waitUntilDone();
49 e
= document
.getElementById("source");
50 x
= e
.offsetLeft
+ e
.offsetWidth
/ 2;
51 y
= e
.offsetTop
+ e
.offsetHeight
/ 2;
53 eventSender
.mouseMoveTo(x
, y
);
54 eventSender
.mouseDown();
55 eventSender
.leapForward(100);
56 e
= document
.getElementById("target");
57 x
= e
.offsetLeft
+ e
.offsetWidth
/ 2;
58 y
= e
.offsetTop
+ e
.offsetHeight
/ 2;
60 eventSender
.mouseMoveTo(x
, y
);
61 eventSender
.mouseUp();