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 | /* Make sure that "View Image Info" loads the correct image data */ |
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 testImg = doc.getElementById("test-image"); |
michael@0 | 13 | var pageInfo = BrowserPageInfo(doc, "mediaTab", testImg); |
michael@0 | 14 | |
michael@0 | 15 | pageInfo.addEventListener("load", function () { |
michael@0 | 16 | pageInfo.removeEventListener("load", arguments.callee, true); |
michael@0 | 17 | pageInfo.onImagePreviewShown.push(function () { |
michael@0 | 18 | executeSoon(function () { |
michael@0 | 19 | var pageInfoImg = pageInfo.document.getElementById("thepreviewimage"); |
michael@0 | 20 | |
michael@0 | 21 | is(pageInfoImg.src, testImg.src, "selected image has the correct source"); |
michael@0 | 22 | is(pageInfoImg.width, testImg.width, "selected image has the correct width"); |
michael@0 | 23 | is(pageInfoImg.height, testImg.height, "selected image has the correct height"); |
michael@0 | 24 | |
michael@0 | 25 | pageInfo.close(); |
michael@0 | 26 | gBrowser.removeCurrentTab(); |
michael@0 | 27 | finish(); |
michael@0 | 28 | }); |
michael@0 | 29 | }); |
michael@0 | 30 | }, true); |
michael@0 | 31 | }, true); |
michael@0 | 32 | |
michael@0 | 33 | content.location = |
michael@0 | 34 | "data:text/html," + |
michael@0 | 35 | "<style type='text/css'>%23test-image,%23not-test-image {background-image: url('about:logo?c');}</style>" + |
michael@0 | 36 | "<img src='about:logo?b' height=300 width=350 alt=2 id='not-test-image'>" + |
michael@0 | 37 | "<img src='about:logo?b' height=300 width=350 alt=2>" + |
michael@0 | 38 | "<img src='about:logo?a' height=200 width=250>" + |
michael@0 | 39 | "<img src='about:logo?b' height=200 width=250 alt=1>" + |
michael@0 | 40 | "<img src='about:logo?b' height=100 width=150 alt=2 id='test-image'>"; |
michael@0 | 41 | } |