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 | const RELATIVE_DIR = "image/test/browser/"; |
michael@0 | 2 | const TESTROOT = "http://example.com/browser/" + RELATIVE_DIR; |
michael@0 | 3 | const TESTROOT2 = "http://example.org/browser/" + RELATIVE_DIR; |
michael@0 | 4 | |
michael@0 | 5 | var chrome_root = getRootDirectory(gTestPath); |
michael@0 | 6 | const CHROMEROOT = chrome_root; |
michael@0 | 7 | |
michael@0 | 8 | function getImageLoading(doc, id) { |
michael@0 | 9 | var htmlImg = doc.getElementById(id); |
michael@0 | 10 | return htmlImg.QueryInterface(Ci.nsIImageLoadingContent); |
michael@0 | 11 | } |
michael@0 | 12 | |
michael@0 | 13 | // Tries to get the Moz debug image, imgIContainerDebug. Only works |
michael@0 | 14 | // in a debug build. If we succeed, we call func(). |
michael@0 | 15 | function actOnMozImage(doc, id, func) { |
michael@0 | 16 | var imgContainer = getImageLoading(doc, id).getRequest(Ci.nsIImageLoadingContent.CURRENT_REQUEST).image; |
michael@0 | 17 | var mozImage; |
michael@0 | 18 | try { |
michael@0 | 19 | mozImage = imgContainer.QueryInterface(Ci.imgIContainerDebug); |
michael@0 | 20 | } |
michael@0 | 21 | catch (e) { |
michael@0 | 22 | return false; |
michael@0 | 23 | } |
michael@0 | 24 | func(mozImage); |
michael@0 | 25 | return true; |
michael@0 | 26 | } |