Use relative paths for ref images and copy refs.
This commit is contained in:
parent
b51b051b82
commit
c15d81b58b
@ -110,6 +110,7 @@ var gMagZoom = 16; // size of the zoomed in pixels
|
|||||||
var gImage1Data; // ImageData object for the reference image
|
var gImage1Data; // ImageData object for the reference image
|
||||||
var gImage2Data; // ImageData object for the test output image
|
var gImage2Data; // ImageData object for the test output image
|
||||||
var gFlashingPixels = []; // array of <path> objects that should be flashed due to pixel color mismatch
|
var gFlashingPixels = []; // array of <path> objects that should be flashed due to pixel color mismatch
|
||||||
|
var gPath = ''; // path taken from #web= and prepended to ref/snp urls
|
||||||
|
|
||||||
function ID(id) {
|
function ID(id) {
|
||||||
if (!(id in gIDCache))
|
if (!(id in gIDCache))
|
||||||
@ -190,6 +191,11 @@ function show_phase(phaseid) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function loadFromWeb(url) {
|
function loadFromWeb(url) {
|
||||||
|
var lastSlash = url.lastIndexOf('/');
|
||||||
|
if (lastSlash) {
|
||||||
|
gPath = url.substring(0, lastSlash + 1);
|
||||||
|
}
|
||||||
|
|
||||||
var r = new XMLHttpRequest();
|
var r = new XMLHttpRequest();
|
||||||
r.open("GET", url);
|
r.open("GET", url);
|
||||||
r.onreadystatechange = function() {
|
r.onreadystatechange = function() {
|
||||||
@ -344,7 +350,7 @@ function get_image_data(src, whenReady) {
|
|||||||
|
|
||||||
whenReady(ctx.getImageData(0, 0, 800, 1000));
|
whenReady(ctx.getImageData(0, 0, 800, 1000));
|
||||||
};
|
};
|
||||||
img.src = src;
|
img.src = gPath + src;
|
||||||
}
|
}
|
||||||
|
|
||||||
function show_images(i) {
|
function show_images(i) {
|
||||||
@ -356,17 +362,17 @@ function show_images(i) {
|
|||||||
ID("diffrect").style.display = "none";
|
ID("diffrect").style.display = "none";
|
||||||
ID("imgcontrols").reset();
|
ID("imgcontrols").reset();
|
||||||
|
|
||||||
ID("image1").setAttributeNS(XLINK_NS, "xlink:href", item.images[0]);
|
ID("image1").setAttributeNS(XLINK_NS, "xlink:href", gPath + item.images[0]);
|
||||||
// Making the href be #image1 doesn't seem to work
|
// Making the href be #image1 doesn't seem to work
|
||||||
ID("feimage1").setAttributeNS(XLINK_NS, "xlink:href", item.images[0]);
|
ID("feimage1").setAttributeNS(XLINK_NS, "xlink:href", gPath + item.images[0]);
|
||||||
if (item.images.length == 1) {
|
if (item.images.length == 1) {
|
||||||
ID("imgcontrols").style.display = "none";
|
ID("imgcontrols").style.display = "none";
|
||||||
} else {
|
} else {
|
||||||
ID("imgcontrols").style.display = "";
|
ID("imgcontrols").style.display = "";
|
||||||
|
|
||||||
ID("image2").setAttributeNS(XLINK_NS, "xlink:href", item.images[1]);
|
ID("image2").setAttributeNS(XLINK_NS, "xlink:href", gPath + item.images[1]);
|
||||||
// Making the href be #image2 doesn't seem to work
|
// Making the href be #image2 doesn't seem to work
|
||||||
ID("feimage2").setAttributeNS(XLINK_NS, "xlink:href", item.images[1]);
|
ID("feimage2").setAttributeNS(XLINK_NS, "xlink:href", gPath + item.images[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
cell.style.display = "";
|
cell.style.display = "";
|
||||||
|
14
test/test.py
14
test/test.py
@ -694,12 +694,17 @@ def checkEq(task, results, browser, masterMode):
|
|||||||
handle.write(snapshot)
|
handle.write(snapshot)
|
||||||
handle.close()
|
handle.close()
|
||||||
|
|
||||||
|
refSnapshotPath = os.path.join(testSnapshotDir, str(page) + '_ref.png')
|
||||||
|
handle = open(refSnapshotPath, 'wb')
|
||||||
|
handle.write(ref)
|
||||||
|
handle.close()
|
||||||
|
|
||||||
# NB: this follows the format of Mozilla reftest
|
# NB: this follows the format of Mozilla reftest
|
||||||
# output so that we can reuse its reftest-analyzer
|
# output so that we can reuse its reftest-analyzer
|
||||||
# script
|
# script
|
||||||
eqLog.write('REFTEST TEST-UNEXPECTED-FAIL | ' + browser +'-'+ taskId +'-page'+ str(page) + ' | image comparison (==)\n')
|
eqLog.write('REFTEST TEST-UNEXPECTED-FAIL | ' + browser +'-'+ taskId +'-page'+ str(page) + ' | image comparison (==)\n')
|
||||||
eqLog.write('REFTEST IMAGE 1 (TEST): ' + '/test/' + testSnapshotPath + '\n')
|
eqLog.write('REFTEST IMAGE 1 (TEST): ' + testSnapshotPath + '\n')
|
||||||
eqLog.write('REFTEST IMAGE 2 (REFERENCE): ' + '/test/' + path + '\n')
|
eqLog.write('REFTEST IMAGE 2 (REFERENCE): ' + refSnapshotPath + '\n')
|
||||||
|
|
||||||
passed = False
|
passed = False
|
||||||
State.numEqFailures += 1
|
State.numEqFailures += 1
|
||||||
@ -793,6 +798,11 @@ def startReftest(browser, options):
|
|||||||
print "Completed reftest usage."
|
print "Completed reftest usage."
|
||||||
|
|
||||||
def runTests(options, browsers):
|
def runTests(options, browsers):
|
||||||
|
try:
|
||||||
|
shutil.rmtree(TEST_SNAPSHOTS);
|
||||||
|
except OSError, e:
|
||||||
|
if e.errno != 2: # folder doesn't exist
|
||||||
|
print >>sys.stderr, 'Deleting', dir, 'failed!'
|
||||||
t1 = time.time()
|
t1 = time.time()
|
||||||
try:
|
try:
|
||||||
startBrowsers(browsers, options, '/test/test_slave.html')
|
startBrowsers(browsers, options, '/test/test_slave.html')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user