browser/base/content/test/general/browser_bug517902.js

Thu, 15 Jan 2015 15:55:04 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 15:55:04 +0100
branch
TOR_BUG_9701
changeset 9
a63d609f5ebe
permissions
-rw-r--r--

Back out 97036ab72558 which inappropriately compared turds to third parties.

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

mercurial