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