4 <script src=
"../../http/tests/inspector/inspector-test.js"></script>
5 <script src=
"../../http/tests/inspector/elements-test.js"></script>
12 InspectorTest
.nodeWithId("image", step1
);
16 InspectorTest
.firstElementsTreeOutline()._loadDimensionsForNode(node
, step2
);
19 function step2(dimensions
)
21 const EXPECTED_WIDTH
= 215;
22 const EXPECTED_HEIGHT
= 174;
25 InspectorTest
.addResult("FAILED, no dimensions on treeElement.");
27 if (dimensions
.offsetWidth
=== dimensions
.naturalWidth
&& dimensions
.offsetHeight
== dimensions
.naturalHeight
28 && dimensions
.offsetWidth
=== EXPECTED_WIDTH
&& dimensions
.offsetHeight
=== EXPECTED_HEIGHT
)
29 InspectorTest
.addResult("PASSED, image dimensions for tooltip: " + EXPECTED_WIDTH
+ "x" + EXPECTED_HEIGHT
+ ".");
31 InspectorTest
.addResult("FAILED, image dimensions for tooltip: " + formatDimensions(dimensions
) + " (should be " + EXPECTED_WIDTH
+ "x" + EXPECTED_HEIGHT
+ ").");
33 InspectorTest
.completeTest();
36 function formatDimensions(dimensions
)
38 return dimensions
.offsetWidth
+ "x" + dimensions
.offsetHeight
+ " (natural: " + dimensions
.naturalWidth
+ "x" + dimensions
.naturalHeight
+ ")";
45 <body onload=
"runTest()">
47 Tests the tooltip for the image on hover.
50 <img id=
"image" src=
"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAANcAAACuCAIAAAAqMg/rAAAAAXNSR0IArs4c6QAAAU9JREFUeNrt0jERAAAIxDDAv+dHAxNLIqHXTlLwaiTAheBCXAguxIXgQlwILsSF4EJcCC7EheBCXAguxIXgQlwILsSF4EJcCC7EheBCXAguxIXgQlwILsSF4EJcCC7EheBCXAguxIXgQlwILsSF4EJcCC7EheBCXAguxIXgQlwILsSF4EJcCC7EheBCXAguxIXgQlwILsSF4EJcCC7EheBCXAguxIXgQlwILsSF4EJcCC7EheBCXAguxIXgQlwILsSF4EJcCC7EheBCXAguxIXgQlwILsSF4EJcCC7EheBCXAguxIXgQlwILsSF4EJcCC7EheBCXAguxIXgQlwILsSFEuBCcCEuBBfiQnAhLgQX4kJwIS4EF+JCcCEuBBfiQnAhLgQX4kJwIS4EF+JCcCEuBBfiQnAhLgQX4kJwIS4EF+JCcCEuBBfiQnAhLoSDBZXqBFnkRyeqAAAAAElFTkSuQmCC"/>