|
1 /* Check proper image url retrieval from all kinds of elements/styles */ |
|
2 |
|
3 function test() { |
|
4 waitForExplicitFinish(); |
|
5 |
|
6 gBrowser.selectedTab = gBrowser.addTab(); |
|
7 |
|
8 gBrowser.selectedBrowser.addEventListener("load", function () { |
|
9 gBrowser.selectedBrowser.removeEventListener("load", arguments.callee, true); |
|
10 |
|
11 var doc = gBrowser.contentDocument; |
|
12 var pageInfo = BrowserPageInfo(doc, "mediaTab"); |
|
13 |
|
14 pageInfo.addEventListener("load", function () { |
|
15 pageInfo.removeEventListener("load", arguments.callee, true); |
|
16 pageInfo.onFinished.push(function () { |
|
17 executeSoon(function () { |
|
18 var imageTree = pageInfo.document.getElementById("imagetree"); |
|
19 var imageRowsNum = imageTree.view.rowCount; |
|
20 |
|
21 ok(imageTree, "Image tree is null (media tab is broken)"); |
|
22 |
|
23 ok(imageRowsNum == 7, "Number of images listed: " + |
|
24 imageRowsNum + ", should be 7"); |
|
25 |
|
26 pageInfo.close(); |
|
27 gBrowser.removeCurrentTab(); |
|
28 finish(); |
|
29 }); |
|
30 }); |
|
31 }, true); |
|
32 }, true); |
|
33 |
|
34 content.location = |
|
35 "data:text/html," + |
|
36 "<html>" + |
|
37 " <head>" + |
|
38 " <title>Test for media tab</title>" + |
|
39 " <link rel='shortcut icon' href='file:///dummy_icon.ico'>" + // Icon |
|
40 " </head>" + |
|
41 " <body style='background-image:url(about:logo?a);'>" + // Background |
|
42 " <img src='file:///dummy_image.gif'>" + // Image |
|
43 " <ul>" + |
|
44 " <li style='list-style:url(about:logo?b);'>List Item 1</li>" + // Bullet |
|
45 " </ul> " + |
|
46 " <div style='-moz-border-image: url(about:logo?c) 20 20 20 20;'>test</div>" + // Border |
|
47 " <a href='' style='cursor: url(about:logo?d),default;'>test link</a>" + // Cursor |
|
48 " <object type='image/svg+xml' width=20 height=20 data='file:///dummy_object.svg'></object>" + // Object |
|
49 " </body>" + |
|
50 "</html>"; |
|
51 } |