browser_bug517902.js
Go to the documentation of this file.
1 /* Make sure that "View Image Info" loads the correct image data */
2 
3 function test() {
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 testImg = doc.getElementById("test-image");
13  var pageInfo = BrowserPageInfo(doc, "mediaTab", testImg);
14 
15  pageInfo.addEventListener("load", function () {
16  pageInfo.onFinished.push(function () {
17  executeSoon(function () {
18  var pageInfoImg = pageInfo.document.getElementById("thepreviewimage");
19 
20  is(pageInfoImg.src, testImg.src, "selected image has the correct source");
21  is(pageInfoImg.width, testImg.width, "selected image has the correct width");
22  is(pageInfoImg.height, testImg.height, "selected image has the correct height");
23 
24  pageInfo.close();
25  gBrowser.removeCurrentTab();
26  finish();
27  });
28  });
29  }, true);
30  }, true);
31 
32  content.location =
33  "data:text/html," +
34  "<style type='text/css'>#test-image,#not-test-image {background-image: url('about:logo?c');}</style>" +
35  "<img src='about:logo?b' height=300 width=350 alt=2 id='not-test-image'>" +
36  "<img src='about:logo?b' height=300 width=350 alt=2>" +
37  "<img src='about:logo?a' height=200 width=250>" +
38  "<img src='about:logo?b' height=200 width=250 alt=1>" +
39  "<img src='about:logo?b' height=100 width=150 alt=2 id='test-image'>";
40 }
function doc() browser.contentDocument
function test()
function BrowserPageInfo(doc, initialTab, imageElement)
Definition: browser.js:2128
waitForExplicitFinish()
return!aWindow arguments!aWindow arguments[0]