2007-07-19 01:32:50 +04:00
|
|
|
/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- /
|
2006-09-06 01:50:54 +04:00
|
|
|
/* vim: set shiftwidth=4 tabstop=8 autoindent cindent expandtab: */
|
|
|
|
/* ***** BEGIN LICENSE BLOCK *****
|
|
|
|
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
|
|
|
*
|
|
|
|
* The contents of this file are subject to the Mozilla Public License Version
|
|
|
|
* 1.1 (the "License"); you may not use this file except in compliance with
|
|
|
|
* the License. You may obtain a copy of the License at
|
|
|
|
* http://www.mozilla.org/MPL/
|
|
|
|
*
|
|
|
|
* Software distributed under the License is distributed on an "AS IS" basis,
|
|
|
|
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
|
|
|
* for the specific language governing rights and limitations under the
|
|
|
|
* License.
|
|
|
|
*
|
|
|
|
* The Original Code is Mozilla's layout acceptance tests.
|
|
|
|
*
|
|
|
|
* The Initial Developer of the Original Code is the Mozilla Foundation.
|
|
|
|
* Portions created by the Initial Developer are Copyright (C) 2006
|
|
|
|
* the Initial Developer. All Rights Reserved.
|
|
|
|
*
|
|
|
|
* Contributor(s):
|
|
|
|
* L. David Baron <dbaron@dbaron.org>, Mozilla Corporation (original author)
|
|
|
|
*
|
|
|
|
* Alternatively, the contents of this file may be used under the terms of
|
|
|
|
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
|
|
|
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
|
|
|
* in which case the provisions of the GPL or the LGPL are applicable instead
|
|
|
|
* of those above. If you wish to allow use of your version of this file only
|
|
|
|
* under the terms of either the GPL or the LGPL, and not to allow others to
|
|
|
|
* use your version of this file under the terms of the MPL, indicate your
|
|
|
|
* decision by deleting the provisions above and replace them with the notice
|
|
|
|
* and other provisions required by the GPL or the LGPL. If you do not delete
|
|
|
|
* the provisions above, a recipient may use your version of this file under
|
|
|
|
* the terms of any one of the MPL, the GPL or the LGPL.
|
|
|
|
*
|
|
|
|
* ***** END LICENSE BLOCK ***** */
|
|
|
|
|
|
|
|
const CC = Components.classes;
|
|
|
|
const CI = Components.interfaces;
|
|
|
|
const CR = Components.results;
|
|
|
|
|
|
|
|
const XHTML_NS = "http://www.w3.org/1999/xhtml";
|
|
|
|
|
|
|
|
const NS_LOCAL_FILE_CONTRACTID = "@mozilla.org/file/local;1";
|
|
|
|
const IO_SERVICE_CONTRACTID = "@mozilla.org/network/io-service;1";
|
|
|
|
const NS_LOCALFILEINPUTSTREAM_CONTRACTID =
|
|
|
|
"@mozilla.org/network/file-input-stream;1";
|
2007-06-12 22:25:15 +04:00
|
|
|
const NS_SCRIPTSECURITYMANAGER_CONTRACTID =
|
|
|
|
"@mozilla.org/scriptsecuritymanager;1";
|
2007-08-03 06:28:55 +04:00
|
|
|
const NS_REFTESTHELPER_CONTRACTID =
|
|
|
|
"@mozilla.org/reftest-helper;1";
|
2008-08-07 02:38:44 +04:00
|
|
|
const NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX =
|
|
|
|
"@mozilla.org/network/protocol;1?name=";
|
2006-09-06 01:50:54 +04:00
|
|
|
|
2008-05-01 03:37:07 +04:00
|
|
|
const LOAD_FAILURE_TIMEOUT = 10000; // ms
|
2007-02-12 05:21:18 +03:00
|
|
|
|
2006-09-06 01:50:54 +04:00
|
|
|
var gBrowser;
|
2008-12-17 03:30:30 +03:00
|
|
|
var gCanvasTest, gCanvasRef;
|
2006-09-06 01:50:54 +04:00
|
|
|
var gURLs;
|
2008-12-08 03:48:36 +03:00
|
|
|
// Map from URI spec to the number of times it remains to be used
|
|
|
|
var gURIUseCounts;
|
|
|
|
// Map from URI spec to the canvas rendered for that URI
|
|
|
|
var gURICanvases;
|
2008-12-02 15:35:24 +03:00
|
|
|
var gTestResults = {
|
2008-12-12 02:48:32 +03:00
|
|
|
// Successful...
|
|
|
|
Pass: 0,
|
|
|
|
LoadOnly: 0,
|
|
|
|
// Unexpected...
|
2008-12-02 15:35:24 +03:00
|
|
|
Exception: 0,
|
|
|
|
FailedLoad: 0,
|
|
|
|
UnexpectedFail: 0,
|
|
|
|
UnexpectedPass: 0,
|
2008-12-12 02:48:32 +03:00
|
|
|
// Known problems...
|
2008-12-02 15:35:24 +03:00
|
|
|
KnownFail : 0,
|
|
|
|
Random : 0,
|
|
|
|
Skip: 0,
|
|
|
|
};
|
2008-07-20 00:54:47 +04:00
|
|
|
var gTotalTests = 0;
|
2006-09-06 01:50:54 +04:00
|
|
|
var gState;
|
2008-10-20 00:27:46 +04:00
|
|
|
var gCurrentURL;
|
2007-02-13 03:54:02 +03:00
|
|
|
var gFailureTimeout;
|
2008-10-20 00:27:46 +04:00
|
|
|
var gFailureReason;
|
2007-07-19 01:32:50 +04:00
|
|
|
var gServer;
|
|
|
|
var gCount = 0;
|
|
|
|
|
|
|
|
var gIOService;
|
2008-12-03 04:34:07 +03:00
|
|
|
var gWindowUtils;
|
2008-04-30 04:39:45 +04:00
|
|
|
|
2008-04-30 04:39:45 +04:00
|
|
|
var gCurrentTestStartTime;
|
|
|
|
var gSlowestTestTime = 0;
|
|
|
|
var gSlowestTestURL;
|
|
|
|
|
2007-02-08 22:24:43 +03:00
|
|
|
const EXPECTED_PASS = 0;
|
|
|
|
const EXPECTED_FAIL = 1;
|
|
|
|
const EXPECTED_RANDOM = 2;
|
2007-05-08 14:21:22 +04:00
|
|
|
const EXPECTED_DEATH = 3; // test must be skipped to avoid e.g. crash/hang
|
2007-10-04 01:27:04 +04:00
|
|
|
const EXPECTED_LOAD = 4; // test without a reference (just test that it does
|
|
|
|
// not assert, crash, hang, or leak)
|
2007-07-19 01:32:51 +04:00
|
|
|
|
2007-07-19 01:32:50 +04:00
|
|
|
const HTTP_SERVER_PORT = 4444;
|
|
|
|
|
2008-12-08 03:48:36 +03:00
|
|
|
var gRecycledCanvases = new Array();
|
|
|
|
|
|
|
|
function AllocateCanvas()
|
|
|
|
{
|
|
|
|
var windowElem = document.documentElement;
|
|
|
|
|
|
|
|
if (gRecycledCanvases.length > 0)
|
|
|
|
return gRecycledCanvases.shift();
|
|
|
|
|
|
|
|
var canvas = document.createElementNS(XHTML_NS, "canvas");
|
|
|
|
canvas.setAttribute("width", windowElem.getAttribute("width"));
|
|
|
|
canvas.setAttribute("height", windowElem.getAttribute("height"));
|
|
|
|
return canvas;
|
|
|
|
}
|
|
|
|
|
|
|
|
function ReleaseCanvas(canvas)
|
|
|
|
{
|
|
|
|
gRecycledCanvases.push(canvas);
|
|
|
|
}
|
|
|
|
|
2006-09-06 01:50:54 +04:00
|
|
|
function OnRefTestLoad()
|
|
|
|
{
|
|
|
|
gBrowser = document.getElementById("browser");
|
2007-02-12 05:21:18 +03:00
|
|
|
|
|
|
|
gBrowser.addEventListener("load", OnDocumentLoad, true);
|
2006-09-06 01:50:54 +04:00
|
|
|
|
2008-12-03 04:34:07 +03:00
|
|
|
try {
|
|
|
|
gWindowUtils = window.QueryInterface(CI.nsIInterfaceRequestor).getInterface(CI.nsIDOMWindowUtils);
|
|
|
|
if (gWindowUtils && !gWindowUtils.compareCanvases)
|
|
|
|
gWindowUtils = null;
|
2007-08-03 06:28:55 +04:00
|
|
|
} catch (e) {
|
2008-12-03 04:34:07 +03:00
|
|
|
gWindowUtils = null;
|
2007-08-03 06:28:55 +04:00
|
|
|
}
|
|
|
|
|
2006-09-06 01:50:54 +04:00
|
|
|
var windowElem = document.documentElement;
|
2007-08-03 06:28:55 +04:00
|
|
|
|
2007-07-19 01:32:50 +04:00
|
|
|
gIOService = CC[IO_SERVICE_CONTRACTID].getService(CI.nsIIOService);
|
|
|
|
|
2006-09-06 01:50:54 +04:00
|
|
|
try {
|
|
|
|
ReadTopManifest(window.arguments[0]);
|
2008-12-08 03:48:36 +03:00
|
|
|
BuildUseCounts();
|
2008-02-11 23:32:40 +03:00
|
|
|
if (gServer) {
|
|
|
|
gServer.registerContentType("sjs", "sjs");
|
2007-07-19 01:32:50 +04:00
|
|
|
gServer.start(HTTP_SERVER_PORT);
|
2008-02-11 23:32:40 +03:00
|
|
|
}
|
2008-07-20 00:54:47 +04:00
|
|
|
gTotalTests = gURLs.length;
|
2008-12-08 03:48:36 +03:00
|
|
|
gURICanvases = {};
|
2007-02-12 05:21:18 +03:00
|
|
|
StartCurrentTest();
|
2006-09-06 01:50:54 +04:00
|
|
|
} catch (ex) {
|
2007-08-02 12:53:53 +04:00
|
|
|
//gBrowser.loadURI('data:text/plain,' + ex);
|
2008-12-02 15:35:24 +03:00
|
|
|
++gTestResults.Exception;
|
2008-12-09 01:03:49 +03:00
|
|
|
dump("REFTEST TEST-UNEXPECTED-FAIL | | EXCEPTION: " + ex + "\n");
|
2007-08-02 12:53:53 +04:00
|
|
|
DoneTests();
|
2006-09-06 01:50:54 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function OnRefTestUnload()
|
|
|
|
{
|
2008-09-09 01:47:26 +04:00
|
|
|
/* Clear the sRGB forcing pref to leave the profile as we found it. */
|
|
|
|
var prefs = Components.classes["@mozilla.org/preferences-service;1"].
|
|
|
|
getService(Components.interfaces.nsIPrefBranch2);
|
|
|
|
prefs.clearUserPref("gfx.color_management.force_srgb");
|
|
|
|
|
2007-02-12 05:21:18 +03:00
|
|
|
gBrowser.removeEventListener("load", OnDocumentLoad, true);
|
2006-09-06 01:50:54 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
function ReadTopManifest(aFileURL)
|
|
|
|
{
|
|
|
|
gURLs = new Array();
|
2007-07-19 01:32:50 +04:00
|
|
|
var url = gIOService.newURI(aFileURL, null, null);
|
2006-09-06 01:50:54 +04:00
|
|
|
if (!url || !url.schemeIs("file"))
|
|
|
|
throw "Expected a file URL for the manifest.";
|
|
|
|
ReadManifest(url);
|
|
|
|
}
|
|
|
|
|
|
|
|
function ReadManifest(aURL)
|
|
|
|
{
|
|
|
|
var listURL = aURL.QueryInterface(CI.nsIFileURL);
|
|
|
|
|
2007-06-12 22:25:15 +04:00
|
|
|
var secMan = CC[NS_SCRIPTSECURITYMANAGER_CONTRACTID]
|
|
|
|
.getService(CI.nsIScriptSecurityManager);
|
|
|
|
|
2006-09-06 01:50:54 +04:00
|
|
|
var fis = CC[NS_LOCALFILEINPUTSTREAM_CONTRACTID].
|
|
|
|
createInstance(CI.nsIFileInputStream);
|
|
|
|
fis.init(listURL.file, -1, -1, false);
|
|
|
|
var lis = fis.QueryInterface(CI.nsILineInputStream);
|
|
|
|
|
2008-08-07 02:38:44 +04:00
|
|
|
// Build the sandbox for fails-if(), etc., condition evaluation.
|
2007-02-08 22:24:43 +03:00
|
|
|
var sandbox = new Components.utils.Sandbox(aURL.spec);
|
|
|
|
for (var prop in gAutoconfVars)
|
|
|
|
sandbox[prop] = gAutoconfVars[prop];
|
2008-08-07 02:38:44 +04:00
|
|
|
var hh = CC[NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX + "http"].
|
|
|
|
getService(CI.nsIHttpProtocolHandler);
|
|
|
|
sandbox.http = {};
|
|
|
|
for each (var prop in [ "userAgent", "appName", "appVersion",
|
|
|
|
"vendor", "vendorSub", "vendorComment",
|
|
|
|
"product", "productSub", "productComment",
|
|
|
|
"platform", "oscpu", "language", "misc" ])
|
|
|
|
sandbox.http[prop] = hh[prop];
|
2007-02-08 22:24:43 +03:00
|
|
|
|
2006-09-06 01:50:54 +04:00
|
|
|
var line = {value:null};
|
|
|
|
var lineNo = 0;
|
|
|
|
do {
|
|
|
|
var more = lis.readLine(line);
|
|
|
|
++lineNo;
|
|
|
|
var str = line.value;
|
2007-12-21 02:49:00 +03:00
|
|
|
if (str.charAt(0) == "#")
|
2006-10-27 23:56:49 +04:00
|
|
|
continue; // entire line was a comment
|
2007-12-21 02:49:00 +03:00
|
|
|
var i = str.search(/\s+#/);
|
|
|
|
if (i >= 0)
|
|
|
|
str = str.substring(0, i);
|
2006-10-28 08:17:21 +04:00
|
|
|
// strip leading and trailing whitespace
|
|
|
|
str = str.replace(/^\s*/, '').replace(/\s*$/, '');
|
2006-09-06 01:50:54 +04:00
|
|
|
if (!str || str == "")
|
|
|
|
continue;
|
|
|
|
var items = str.split(/\s+/); // split on whitespace
|
|
|
|
|
2007-02-08 22:24:43 +03:00
|
|
|
var expected_status = EXPECTED_PASS;
|
2007-05-08 14:21:22 +04:00
|
|
|
while (items[0].match(/^(fails|random|skip)/)) {
|
2007-02-08 22:24:43 +03:00
|
|
|
var item = items.shift();
|
|
|
|
var stat;
|
|
|
|
var cond;
|
2007-05-08 14:21:22 +04:00
|
|
|
var m = item.match(/^(fails|random|skip)-if(\(.*\))$/);
|
2007-02-08 22:24:43 +03:00
|
|
|
if (m) {
|
|
|
|
stat = m[1];
|
|
|
|
// Note: m[2] contains the parentheses, and we want them.
|
|
|
|
cond = Components.utils.evalInSandbox(m[2], sandbox);
|
2007-05-08 14:21:22 +04:00
|
|
|
} else if (item.match(/^(fails|random|skip)$/)) {
|
2007-02-08 22:24:43 +03:00
|
|
|
stat = item;
|
|
|
|
cond = true;
|
|
|
|
} else {
|
2007-02-28 07:35:47 +03:00
|
|
|
throw "Error in manifest file " + aURL.spec + " line " + lineNo;
|
2007-02-08 22:24:43 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
if (cond) {
|
|
|
|
if (stat == "fails") {
|
|
|
|
expected_status = EXPECTED_FAIL;
|
|
|
|
} else if (stat == "random") {
|
|
|
|
expected_status = EXPECTED_RANDOM;
|
2007-05-08 14:21:22 +04:00
|
|
|
} else if (stat == "skip") {
|
|
|
|
expected_status = EXPECTED_DEATH;
|
2007-02-08 22:24:43 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-11-08 19:35:54 +03:00
|
|
|
var runHttp = false;
|
|
|
|
var httpDepth;
|
|
|
|
if (items[0] == "HTTP") {
|
|
|
|
runHttp = true;
|
|
|
|
httpDepth = 0;
|
2007-07-19 01:32:50 +04:00
|
|
|
items.shift();
|
2008-11-08 19:35:54 +03:00
|
|
|
} else if (items[0].match(/HTTP\(\.\.(\/\.\.)*\)/)) {
|
|
|
|
// Accept HTTP(..), HTTP(../..), HTTP(../../..), etc.
|
|
|
|
runHttp = true;
|
|
|
|
httpDepth = (items[0].length - 5) / 3;
|
|
|
|
items.shift();
|
|
|
|
}
|
2007-07-19 01:32:50 +04:00
|
|
|
|
2006-09-06 01:50:54 +04:00
|
|
|
if (items[0] == "include") {
|
2007-07-19 01:32:50 +04:00
|
|
|
if (items.length != 2 || runHttp)
|
2007-10-04 01:27:04 +04:00
|
|
|
throw "Error in manifest file " + aURL.spec + " line " + lineNo;
|
2007-07-19 01:32:50 +04:00
|
|
|
var incURI = gIOService.newURI(items[1], null, listURL);
|
2007-06-12 22:25:15 +04:00
|
|
|
secMan.checkLoadURI(aURL, incURI,
|
|
|
|
CI.nsIScriptSecurityManager.DISALLOW_SCRIPT);
|
|
|
|
ReadManifest(incURI);
|
2007-10-04 01:27:04 +04:00
|
|
|
} else if (items[0] == "load") {
|
|
|
|
if (expected_status == EXPECTED_PASS)
|
|
|
|
expected_status = EXPECTED_LOAD;
|
|
|
|
if (items.length != 2 ||
|
|
|
|
(expected_status != EXPECTED_LOAD &&
|
|
|
|
expected_status != EXPECTED_DEATH))
|
|
|
|
throw "Error in manifest file " + aURL.spec + " line " + lineNo;
|
|
|
|
var [testURI] = runHttp
|
2008-11-08 19:35:54 +03:00
|
|
|
? ServeFiles(aURL, httpDepth,
|
2007-10-04 01:27:04 +04:00
|
|
|
listURL.file.parent, [items[1]])
|
|
|
|
: [gIOService.newURI(items[1], null, listURL)];
|
|
|
|
var prettyPath = runHttp
|
|
|
|
? gIOService.newURI(items[1], null, listURL).spec
|
|
|
|
: testURI.spec;
|
|
|
|
secMan.checkLoadURI(aURL, testURI,
|
|
|
|
CI.nsIScriptSecurityManager.DISALLOW_SCRIPT);
|
|
|
|
gURLs.push( { equal: true /* meaningless */,
|
|
|
|
expected: expected_status,
|
|
|
|
prettyPath: prettyPath,
|
2008-12-17 03:30:30 +03:00
|
|
|
urltest: testURI,
|
|
|
|
urlref: null } );
|
2007-02-08 22:24:43 +03:00
|
|
|
} else if (items[0] == "==" || items[0] == "!=") {
|
2006-09-06 01:50:54 +04:00
|
|
|
if (items.length != 3)
|
2007-02-28 07:35:47 +03:00
|
|
|
throw "Error in manifest file " + aURL.spec + " line " + lineNo;
|
2007-07-19 01:32:50 +04:00
|
|
|
var [testURI, refURI] = runHttp
|
2008-11-08 19:35:54 +03:00
|
|
|
? ServeFiles(aURL, httpDepth,
|
2007-10-04 01:27:04 +04:00
|
|
|
listURL.file.parent, [items[1], items[2]])
|
2007-07-19 01:32:50 +04:00
|
|
|
: [gIOService.newURI(items[1], null, listURL),
|
|
|
|
gIOService.newURI(items[2], null, listURL)];
|
|
|
|
var prettyPath = runHttp
|
|
|
|
? gIOService.newURI(items[1], null, listURL).spec
|
|
|
|
: testURI.spec;
|
2007-06-12 22:25:15 +04:00
|
|
|
secMan.checkLoadURI(aURL, testURI,
|
|
|
|
CI.nsIScriptSecurityManager.DISALLOW_SCRIPT);
|
|
|
|
secMan.checkLoadURI(aURL, refURI,
|
|
|
|
CI.nsIScriptSecurityManager.DISALLOW_SCRIPT);
|
2007-02-08 22:24:43 +03:00
|
|
|
gURLs.push( { equal: (items[0] == "=="),
|
|
|
|
expected: expected_status,
|
2007-07-19 01:32:50 +04:00
|
|
|
prettyPath: prettyPath,
|
2008-12-17 03:30:30 +03:00
|
|
|
urltest: testURI,
|
|
|
|
urlref: refURI } );
|
2006-09-06 01:50:54 +04:00
|
|
|
} else {
|
2007-02-28 07:35:47 +03:00
|
|
|
throw "Error in manifest file " + aURL.spec + " line " + lineNo;
|
2006-09-06 01:50:54 +04:00
|
|
|
}
|
|
|
|
} while (more);
|
|
|
|
}
|
|
|
|
|
2008-12-17 03:30:30 +03:00
|
|
|
function AddURIUseCount(which, uri)
|
2008-12-08 03:48:36 +03:00
|
|
|
{
|
|
|
|
if (uri == null)
|
|
|
|
return;
|
|
|
|
|
2008-12-17 03:30:30 +03:00
|
|
|
var spec = which + "-" + uri.spec;
|
2008-12-08 03:48:36 +03:00
|
|
|
if (spec in gURIUseCounts) {
|
|
|
|
gURIUseCounts[spec]++;
|
|
|
|
} else {
|
|
|
|
gURIUseCounts[spec] = 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function BuildUseCounts()
|
|
|
|
{
|
|
|
|
gURIUseCounts = {};
|
|
|
|
for (var i = 0; i < gURLs.length; ++i) {
|
|
|
|
var expected = gURLs[i].expected;
|
|
|
|
if (expected != EXPECTED_DEATH && expected != EXPECTED_LOAD) {
|
2008-12-17 03:30:30 +03:00
|
|
|
AddURIUseCount("test", gURLs[i].urltest);
|
|
|
|
AddURIUseCount("ref", gURLs[i].urlref);
|
2008-12-08 03:48:36 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-11-08 19:35:54 +03:00
|
|
|
function ServeFiles(manifestURL, depth, directory, files)
|
2007-07-19 01:32:50 +04:00
|
|
|
{
|
|
|
|
if (!gServer)
|
|
|
|
gServer = CC["@mozilla.org/server/jshttp;1"].
|
|
|
|
createInstance(CI.nsIHttpServer);
|
|
|
|
|
2008-11-08 19:35:54 +03:00
|
|
|
// Allow serving a tree that's an ancestor of the directory containing
|
|
|
|
// the files so that they can use resources in ../ (etc.).
|
|
|
|
var dirPath = "/";
|
|
|
|
while (depth > 0) {
|
|
|
|
dirPath = "/" + directory.leafName + dirPath;
|
|
|
|
directory = directory.parent;
|
|
|
|
--depth;
|
|
|
|
}
|
|
|
|
|
2007-07-19 01:32:50 +04:00
|
|
|
gCount++;
|
2008-11-08 19:35:54 +03:00
|
|
|
var path = "/" + gCount;
|
|
|
|
gServer.registerDirectory(path + "/", directory);
|
2007-07-19 01:32:50 +04:00
|
|
|
|
|
|
|
var secMan = CC[NS_SCRIPTSECURITYMANAGER_CONTRACTID]
|
|
|
|
.getService(CI.nsIScriptSecurityManager);
|
|
|
|
|
2008-11-08 19:35:54 +03:00
|
|
|
var testbase = gIOService.newURI("http://localhost:" + HTTP_SERVER_PORT +
|
|
|
|
path + dirPath,
|
|
|
|
null, null);
|
2008-11-08 19:35:54 +03:00
|
|
|
|
2007-10-04 01:27:04 +04:00
|
|
|
function FileToURI(file)
|
|
|
|
{
|
2008-11-08 19:35:54 +03:00
|
|
|
// Only serve relative URIs via the HTTP server, not absolute
|
|
|
|
// ones like about:blank.
|
|
|
|
var testURI = gIOService.newURI(file, null, testbase);
|
2007-10-04 01:27:04 +04:00
|
|
|
|
|
|
|
// XXX necessary? manifestURL guaranteed to be file, others always HTTP
|
|
|
|
secMan.checkLoadURI(manifestURL, testURI,
|
|
|
|
CI.nsIScriptSecurityManager.DISALLOW_SCRIPT);
|
2007-07-19 01:32:50 +04:00
|
|
|
|
2007-10-04 01:27:04 +04:00
|
|
|
return testURI;
|
|
|
|
}
|
|
|
|
|
|
|
|
return files.map(FileToURI);
|
2007-07-19 01:32:50 +04:00
|
|
|
}
|
|
|
|
|
2007-02-12 05:21:18 +03:00
|
|
|
function StartCurrentTest()
|
|
|
|
{
|
2007-05-08 14:21:22 +04:00
|
|
|
// make sure we don't run tests that are expected to kill the browser
|
|
|
|
while (gURLs.length > 0 && gURLs[0].expected == EXPECTED_DEATH) {
|
2008-12-02 15:35:24 +03:00
|
|
|
++gTestResults.Skip;
|
2008-12-17 03:30:30 +03:00
|
|
|
dump("REFTEST TEST-KNOWN-FAIL | " + gURLs[0].urltest.spec + " | (SKIP)\n");
|
2007-05-08 14:21:22 +04:00
|
|
|
gURLs.shift();
|
|
|
|
}
|
|
|
|
|
2008-07-20 00:54:47 +04:00
|
|
|
if (gURLs.length == 0) {
|
2007-02-12 05:21:18 +03:00
|
|
|
DoneTests();
|
2008-07-20 00:54:47 +04:00
|
|
|
}
|
|
|
|
else {
|
|
|
|
var currentTest = gTotalTests - gURLs.length;
|
2008-08-04 11:21:47 +04:00
|
|
|
document.title = "reftest: " + currentTest + " / " + gTotalTests +
|
2008-07-20 00:54:47 +04:00
|
|
|
" (" + Math.floor(100 * (currentTest / gTotalTests)) + "%)";
|
2008-12-17 03:30:30 +03:00
|
|
|
StartCurrentURI("test");
|
2008-07-20 00:54:47 +04:00
|
|
|
}
|
2007-02-12 05:21:18 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
function StartCurrentURI(aState)
|
2006-09-06 01:50:54 +04:00
|
|
|
{
|
2008-04-30 04:39:45 +04:00
|
|
|
gCurrentTestStartTime = Date.now();
|
2007-02-13 03:54:02 +03:00
|
|
|
gFailureTimeout = setTimeout(LoadFailed, LOAD_FAILURE_TIMEOUT);
|
2008-10-20 00:27:46 +04:00
|
|
|
gFailureReason = "timed out waiting for onload to fire";
|
2007-02-13 03:54:02 +03:00
|
|
|
|
2007-02-12 05:21:18 +03:00
|
|
|
gState = aState;
|
2008-10-20 00:27:46 +04:00
|
|
|
gCurrentURL = gURLs[0]["url" + aState].spec;
|
2008-12-08 03:48:36 +03:00
|
|
|
|
2008-12-17 03:30:30 +03:00
|
|
|
if (gURICanvases[aState + "-" + gCurrentURL] &&
|
|
|
|
gURLs[0].expected != EXPECTED_LOAD) {
|
2008-12-08 03:48:36 +03:00
|
|
|
// Pretend the document loaded --- DocumentLoaded will notice
|
|
|
|
// there's already a canvas for this URL
|
|
|
|
setTimeout(DocumentLoaded, 0);
|
|
|
|
} else {
|
|
|
|
gBrowser.loadURI(gCurrentURL);
|
|
|
|
}
|
2006-09-06 01:50:54 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
function DoneTests()
|
|
|
|
{
|
2008-04-30 04:39:45 +04:00
|
|
|
dump("REFTEST FINISHED: Slowest test took " + gSlowestTestTime +
|
|
|
|
"ms (" + gSlowestTestURL + ")\n");
|
|
|
|
|
2008-12-02 15:35:24 +03:00
|
|
|
dump("REFTEST INFO | Result summary:\n");
|
2008-12-12 02:48:32 +03:00
|
|
|
var count = gTestResults.Pass + gTestResults.LoadOnly;
|
|
|
|
dump("REFTEST INFO | Successful: " + count + " (" +
|
|
|
|
gTestResults.Pass + " pass, " +
|
|
|
|
gTestResults.LoadOnly + " load only)\n");
|
|
|
|
count = gTestResults.Exception + gTestResults.FailedLoad +
|
|
|
|
gTestResults.UnexpectedFail + gTestResults.UnexpectedPass;
|
|
|
|
dump("REFTEST INFO | Unexpected: " + count + " (" +
|
|
|
|
gTestResults.UnexpectedFail + " unexpected fail, " +
|
|
|
|
gTestResults.UnexpectedPass + " unexpected pass, " +
|
|
|
|
gTestResults.FailedLoad + " failed load, " +
|
|
|
|
gTestResults.Exception + " exception)\n");
|
|
|
|
count = gTestResults.KnownFail + gTestResults.Random + gTestResults.Skip;
|
|
|
|
dump("REFTEST INFO | Known problems: " + count + " (" +
|
|
|
|
gTestResults.KnownFail + " known fail, " +
|
|
|
|
gTestResults.Random + " random, " +
|
|
|
|
gTestResults.Skip + " skipped)\n");
|
2008-12-02 15:35:24 +03:00
|
|
|
|
2008-12-08 03:48:36 +03:00
|
|
|
dump("REFTEST INFO | Total canvas count = " + gRecycledCanvases.length + "\n");
|
|
|
|
|
2007-07-19 01:32:50 +04:00
|
|
|
if (gServer)
|
|
|
|
gServer.stop();
|
2007-01-08 21:22:48 +03:00
|
|
|
goQuitApplication();
|
2006-09-06 01:50:54 +04:00
|
|
|
}
|
|
|
|
|
2008-10-16 00:49:42 +04:00
|
|
|
function setupZoom(contentRootElement) {
|
|
|
|
if (!contentRootElement.hasAttribute('reftest-zoom'))
|
|
|
|
return;
|
|
|
|
gBrowser.markupDocumentViewer.fullZoom =
|
|
|
|
contentRootElement.getAttribute('reftest-zoom');
|
2006-09-06 01:50:54 +04:00
|
|
|
}
|
|
|
|
|
2008-10-16 00:49:42 +04:00
|
|
|
function resetZoom() {
|
|
|
|
gBrowser.markupDocumentViewer.fullZoom = 1.0;
|
|
|
|
}
|
|
|
|
|
2007-02-13 03:34:58 +03:00
|
|
|
function OnDocumentLoad(event)
|
2007-02-12 05:21:18 +03:00
|
|
|
{
|
2007-02-13 03:34:58 +03:00
|
|
|
if (event.target != gBrowser.contentDocument)
|
|
|
|
// Ignore load events for subframes.
|
|
|
|
return;
|
2008-10-20 00:27:46 +04:00
|
|
|
|
|
|
|
if (gBrowser.contentDocument.location.href != gCurrentURL)
|
|
|
|
// Ignore load events for previous documents.
|
|
|
|
return;
|
2007-02-13 03:34:58 +03:00
|
|
|
|
2007-03-27 22:06:35 +04:00
|
|
|
var contentRootElement = gBrowser.contentDocument.documentElement;
|
|
|
|
|
2007-03-07 22:50:02 +03:00
|
|
|
function shouldWait() {
|
2007-03-27 22:06:35 +04:00
|
|
|
// use getAttribute because className works differently in HTML and SVG
|
|
|
|
return contentRootElement.hasAttribute('class') &&
|
|
|
|
contentRootElement.getAttribute('class').split(/\s+/)
|
2007-03-21 09:07:42 +03:00
|
|
|
.indexOf("reftest-wait") != -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
function doPrintMode() {
|
2007-03-27 22:06:35 +04:00
|
|
|
// use getAttribute because className works differently in HTML and SVG
|
|
|
|
return contentRootElement.hasAttribute('class') &&
|
|
|
|
contentRootElement.getAttribute('class').split(/\s+/)
|
2007-03-21 09:07:42 +03:00
|
|
|
.indexOf("reftest-print") != -1;
|
2007-03-07 22:50:02 +03:00
|
|
|
}
|
|
|
|
|
2008-09-06 04:30:45 +04:00
|
|
|
function setupPrintMode() {
|
|
|
|
var PSSVC = Components.classes["@mozilla.org/gfx/printsettings-service;1"]
|
|
|
|
.getService(Components.interfaces.nsIPrintSettingsService);
|
|
|
|
var ps = PSSVC.newPrintSettings;
|
|
|
|
ps.paperWidth = 5;
|
|
|
|
ps.paperHeight = 3;
|
|
|
|
|
|
|
|
// Override any os-specific unwriteable margins
|
|
|
|
ps.unwriteableMarginTop = 0;
|
|
|
|
ps.unwriteableMarginLeft = 0;
|
|
|
|
ps.unwriteableMarginBottom = 0;
|
|
|
|
ps.unwriteableMarginRight = 0;
|
|
|
|
|
|
|
|
ps.headerStrLeft = "";
|
|
|
|
ps.headerStrCenter = "";
|
|
|
|
ps.headerStrRight = "";
|
|
|
|
ps.footerStrLeft = "";
|
|
|
|
ps.footerStrCenter = "";
|
|
|
|
ps.footerStrRight = "";
|
|
|
|
gBrowser.docShell.contentViewer.setPageMode(true, ps);
|
|
|
|
}
|
|
|
|
|
2008-10-16 00:49:42 +04:00
|
|
|
setupZoom(contentRootElement);
|
|
|
|
|
2007-03-07 22:50:02 +03:00
|
|
|
if (shouldWait()) {
|
|
|
|
// The testcase will let us know when the test snapshot should be made.
|
|
|
|
// Register a mutation listener to know when the 'reftest-wait' class
|
|
|
|
// gets removed.
|
2008-10-20 00:27:46 +04:00
|
|
|
gFailureReason = "timed out waiting for reftest-wait to be removed (after onload fired)"
|
2007-03-07 22:50:02 +03:00
|
|
|
contentRootElement.addEventListener(
|
|
|
|
"DOMAttrModified",
|
|
|
|
function(event) {
|
|
|
|
if (!shouldWait()) {
|
|
|
|
contentRootElement.removeEventListener(
|
|
|
|
"DOMAttrModified",
|
|
|
|
arguments.callee,
|
|
|
|
false);
|
2008-09-06 04:30:45 +04:00
|
|
|
if (doPrintMode())
|
|
|
|
setupPrintMode();
|
2007-03-07 22:50:02 +03:00
|
|
|
setTimeout(DocumentLoaded, 0);
|
|
|
|
}
|
|
|
|
}, false);
|
|
|
|
} else {
|
2008-09-06 04:30:45 +04:00
|
|
|
if (doPrintMode())
|
|
|
|
setupPrintMode();
|
2007-03-21 09:07:42 +03:00
|
|
|
|
2007-03-07 22:50:02 +03:00
|
|
|
// Since we can't use a bubbling-phase load listener from chrome,
|
|
|
|
// this is a capturing phase listener. So do setTimeout twice, the
|
|
|
|
// first to get us after the onload has fired in the content, and
|
|
|
|
// the second to get us after any setTimeout(foo, 0) in the content.
|
|
|
|
setTimeout(setTimeout, 0, DocumentLoaded, 0);
|
|
|
|
}
|
2007-02-12 05:21:18 +03:00
|
|
|
}
|
|
|
|
|
2008-12-17 03:30:30 +03:00
|
|
|
function UpdateCanvasCache(which, url, canvas)
|
2008-12-08 03:48:36 +03:00
|
|
|
{
|
2008-12-17 03:30:30 +03:00
|
|
|
var spec = which + "-" + url.spec;
|
2008-12-08 03:48:36 +03:00
|
|
|
|
|
|
|
--gURIUseCounts[spec];
|
|
|
|
if (gURIUseCounts[spec] == 0) {
|
|
|
|
ReleaseCanvas(canvas);
|
|
|
|
delete gURICanvases[spec];
|
|
|
|
} else if (gURIUseCounts[spec] > 0) {
|
|
|
|
gURICanvases[spec] = canvas;
|
|
|
|
} else {
|
|
|
|
throw "Use counts were computed incorrectly";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2006-09-06 01:50:54 +04:00
|
|
|
function DocumentLoaded()
|
|
|
|
{
|
2008-04-30 04:39:45 +04:00
|
|
|
// Keep track of which test was slowest, and how long it took.
|
|
|
|
var currentTestRunTime = Date.now() - gCurrentTestStartTime;
|
|
|
|
if (currentTestRunTime > gSlowestTestTime) {
|
|
|
|
gSlowestTestTime = currentTestRunTime;
|
2008-12-08 03:48:36 +03:00
|
|
|
gSlowestTestURL = gCurrentURL;
|
2008-04-30 04:39:45 +04:00
|
|
|
}
|
|
|
|
|
2007-03-07 22:50:02 +03:00
|
|
|
clearTimeout(gFailureTimeout);
|
2008-10-20 00:27:46 +04:00
|
|
|
gFailureReason = null;
|
2007-08-03 06:28:55 +04:00
|
|
|
|
2007-10-04 01:27:04 +04:00
|
|
|
if (gURLs[0].expected == EXPECTED_LOAD) {
|
2008-12-02 15:35:24 +03:00
|
|
|
++gTestResults.LoadOnly;
|
2008-10-20 00:27:46 +04:00
|
|
|
dump("REFTEST TEST-PASS | " + gURLs[0].prettyPath + " | (LOAD ONLY)\n");
|
2007-10-04 01:27:04 +04:00
|
|
|
gURLs.shift();
|
|
|
|
StartCurrentTest();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2008-12-17 03:30:30 +03:00
|
|
|
// To catch cases where page rendering doesn't paint opaque color
|
|
|
|
// over the entire viewport (e.g. bug 453566), we avoid having
|
|
|
|
// drawWindow erase the requested rectangle before rendering.
|
|
|
|
// Instead, we manually erase the canvas to white, then fill the
|
|
|
|
// bounding box reported by the document's root with different
|
|
|
|
// colors for test and reference.
|
|
|
|
//
|
|
|
|
// We can't just fill the canvas with different colors for the
|
|
|
|
// test and reference, because the viewport can be smaller than
|
|
|
|
// the rectangle requested in the drawWindow call; the bounding
|
|
|
|
// box reported by the document root is the closest approximation
|
|
|
|
// to the viewport rectangle that's available in the DOM.
|
|
|
|
|
2007-08-03 06:28:55 +04:00
|
|
|
var canvas;
|
2008-12-17 03:30:30 +03:00
|
|
|
var bgcolor;
|
|
|
|
var cachespec = gState + "-" + gCurrentURL;
|
|
|
|
if (gURICanvases[cachespec]) {
|
|
|
|
canvas = gURICanvases[cachespec];
|
2008-12-08 03:48:36 +03:00
|
|
|
} else {
|
|
|
|
canvas = AllocateCanvas();
|
|
|
|
|
2008-12-17 03:30:30 +03:00
|
|
|
if (gState == "test") {
|
|
|
|
bgcolor = "rgb(255,0,123)";
|
|
|
|
} else {
|
|
|
|
bgcolor = "rgb(255,74,0)";
|
|
|
|
}
|
|
|
|
|
2008-12-08 03:48:36 +03:00
|
|
|
var win = gBrowser.contentWindow;
|
|
|
|
var ctx = canvas.getContext("2d");
|
2008-12-17 03:30:30 +03:00
|
|
|
var bbox = gBrowser.contentDocument.documentElement.getBoundingClientRect();
|
2008-12-08 03:48:36 +03:00
|
|
|
var scale = gBrowser.markupDocumentViewer.fullZoom;
|
|
|
|
ctx.save();
|
2008-12-17 03:30:30 +03:00
|
|
|
ctx.fillStyle = "white";
|
|
|
|
ctx.fillRect(0, 0, canvas.width, canvas.height);
|
|
|
|
|
|
|
|
// drawWindow always draws one canvas pixel for each CSS pixel
|
|
|
|
// in the source window, so scale the drawing to show the zoom
|
|
|
|
// (making each canvas pixel be one device pixel instead).
|
|
|
|
// Fill all pixels that should be *fully* painted by the
|
|
|
|
// drawWindow call with bgcolor. This fill is scaled manually
|
|
|
|
// so we can snap it to pixel boundaries.
|
|
|
|
ctx.fillStyle = bgcolor;
|
|
|
|
var bbtop = Math.ceil(bbox.top * scale);
|
|
|
|
var bbleft = Math.ceil(bbox.left * scale);
|
|
|
|
var bbright = Math.floor(bbox.right * scale);
|
|
|
|
var bbbottom = Math.floor(bbox.bottom * scale);
|
|
|
|
ctx.fillRect(bbleft, bbtop, bbright - bbleft, bbbottom - bbtop);
|
|
|
|
|
2008-12-08 03:48:36 +03:00
|
|
|
ctx.scale(scale, scale);
|
2008-12-17 03:30:30 +03:00
|
|
|
|
|
|
|
// Using "transparent" for the last argument prevents
|
|
|
|
// drawWindow from clearing the canvas, which would negate all
|
|
|
|
// of the setup above.
|
2008-12-08 03:48:36 +03:00
|
|
|
ctx.drawWindow(win, win.scrollX, win.scrollY,
|
2008-12-17 03:30:30 +03:00
|
|
|
Math.ceil(canvas.width / scale),
|
|
|
|
Math.ceil(canvas.height / scale),
|
2008-12-17 03:30:30 +03:00
|
|
|
"transparent");
|
2008-12-08 03:48:36 +03:00
|
|
|
ctx.restore();
|
|
|
|
}
|
2007-08-03 06:28:55 +04:00
|
|
|
|
2008-12-17 03:30:30 +03:00
|
|
|
if (gState == "test") {
|
|
|
|
gCanvasTest = canvas;
|
2008-12-08 03:48:36 +03:00
|
|
|
} else {
|
2008-12-17 03:30:30 +03:00
|
|
|
gCanvasRef = canvas;
|
2008-12-08 03:48:36 +03:00
|
|
|
}
|
2008-10-16 00:49:42 +04:00
|
|
|
|
|
|
|
resetZoom();
|
2007-08-03 06:28:55 +04:00
|
|
|
|
2006-09-06 01:50:54 +04:00
|
|
|
switch (gState) {
|
2008-12-17 03:30:30 +03:00
|
|
|
case "test":
|
2007-08-03 06:28:55 +04:00
|
|
|
// First document has been loaded.
|
|
|
|
// Proceed to load the second document.
|
2006-09-06 01:50:54 +04:00
|
|
|
|
2008-12-17 03:30:30 +03:00
|
|
|
StartCurrentURI("ref");
|
2006-09-06 01:50:54 +04:00
|
|
|
break;
|
2008-12-17 03:30:30 +03:00
|
|
|
case "ref":
|
2007-03-01 09:26:23 +03:00
|
|
|
// Both documents have been loaded. Compare the renderings and see
|
|
|
|
// if the comparison result matches the expected result specified
|
|
|
|
// in the manifest.
|
2007-08-03 06:28:55 +04:00
|
|
|
|
|
|
|
// number of different pixels
|
|
|
|
var differences;
|
2007-03-01 09:26:23 +03:00
|
|
|
// whether the two renderings match:
|
2007-08-03 06:28:55 +04:00
|
|
|
var equal;
|
|
|
|
|
2008-12-03 04:34:07 +03:00
|
|
|
if (gWindowUtils) {
|
2008-12-17 03:30:30 +03:00
|
|
|
differences = gWindowUtils.compareCanvases(gCanvasTest, gCanvasRef, {});
|
2007-08-03 06:28:55 +04:00
|
|
|
equal = (differences == 0);
|
|
|
|
} else {
|
|
|
|
differences = -1;
|
2008-12-17 03:30:30 +03:00
|
|
|
var k1 = gCanvasTest.toDataURL();
|
|
|
|
var k2 = gCanvasRef.toDataURL();
|
2007-08-03 06:28:55 +04:00
|
|
|
equal = (k1 == k2);
|
|
|
|
}
|
|
|
|
|
2007-03-01 09:26:23 +03:00
|
|
|
// whether the comparison result matches what is in the manifest
|
2006-09-06 01:50:54 +04:00
|
|
|
var test_passed = (equal == gURLs[0].equal);
|
2007-03-01 09:26:23 +03:00
|
|
|
// what is expected on this platform (PASS, FAIL, or RANDOM)
|
2007-02-08 22:24:43 +03:00
|
|
|
var expected = gURLs[0].expected;
|
2007-03-01 09:26:23 +03:00
|
|
|
|
|
|
|
var outputs = {};
|
2008-07-16 09:47:12 +04:00
|
|
|
const randomMsg = "(EXPECTED RANDOM)";
|
2008-12-02 15:35:24 +03:00
|
|
|
outputs[EXPECTED_PASS] = {
|
|
|
|
true: {s: "TEST-PASS" , n: "Pass"},
|
|
|
|
false: {s: "TEST-UNEXPECTED-FAIL" , n: "UnexpectedFail"}
|
|
|
|
};
|
|
|
|
outputs[EXPECTED_FAIL] = {
|
|
|
|
true: {s: "TEST-UNEXPECTED-PASS" , n: "UnexpectedPass"},
|
|
|
|
false: {s: "TEST-KNOWN-FAIL" , n: "KnownFail"}
|
|
|
|
};
|
|
|
|
outputs[EXPECTED_RANDOM] = {
|
|
|
|
true: {s: "TEST-PASS" + randomMsg , n: "Random"},
|
|
|
|
false: {s: "TEST-KNOWN-FAIL" + randomMsg, n: "Random"}
|
|
|
|
};
|
|
|
|
|
|
|
|
++gTestResults[outputs[expected][test_passed].n];
|
|
|
|
|
|
|
|
var result = "REFTEST " + outputs[expected][test_passed].s + " | " +
|
|
|
|
gURLs[0].prettyPath + " | "; // the URL being tested
|
2006-09-06 01:50:54 +04:00
|
|
|
if (!gURLs[0].equal) {
|
|
|
|
result += "(!=) ";
|
|
|
|
}
|
|
|
|
dump(result + "\n");
|
2008-12-02 15:35:24 +03:00
|
|
|
|
2007-11-26 11:36:53 +03:00
|
|
|
if (!test_passed && expected == EXPECTED_PASS ||
|
|
|
|
test_passed && expected == EXPECTED_FAIL) {
|
2007-11-28 19:45:02 +03:00
|
|
|
if (!equal) {
|
2008-12-17 03:30:30 +03:00
|
|
|
dump("REFTEST IMAGE 1 (TEST): " + gCanvasTest.toDataURL() + "\n");
|
|
|
|
dump("REFTEST IMAGE 2 (REFERENCE): " + gCanvasRef.toDataURL() + "\n");
|
2007-11-26 11:36:53 +03:00
|
|
|
dump("REFTEST number of differing pixels: " + differences + "\n");
|
|
|
|
} else {
|
2008-12-17 03:30:30 +03:00
|
|
|
dump("REFTEST IMAGE: " + gCanvasTest.toDataURL() + "\n");
|
2007-11-26 11:36:53 +03:00
|
|
|
}
|
2006-09-06 01:50:54 +04:00
|
|
|
}
|
|
|
|
|
2008-12-17 03:30:30 +03:00
|
|
|
UpdateCanvasCache("test", gURLs[0].urltest, gCanvasTest);
|
|
|
|
UpdateCanvasCache("ref", gURLs[0].urlref, gCanvasRef);
|
2008-12-08 03:48:36 +03:00
|
|
|
|
2006-09-06 01:50:54 +04:00
|
|
|
gURLs.shift();
|
2007-02-12 05:21:18 +03:00
|
|
|
StartCurrentTest();
|
2006-09-06 01:50:54 +04:00
|
|
|
break;
|
|
|
|
default:
|
2007-07-19 01:32:50 +04:00
|
|
|
throw "Unexpected state.";
|
2006-09-06 01:50:54 +04:00
|
|
|
}
|
|
|
|
}
|
2007-02-13 03:54:02 +03:00
|
|
|
|
|
|
|
function LoadFailed()
|
|
|
|
{
|
2008-12-02 15:35:24 +03:00
|
|
|
++gTestResults.FailedLoad;
|
2008-07-16 09:47:12 +04:00
|
|
|
dump("REFTEST TEST-UNEXPECTED-FAIL | " +
|
2008-10-20 00:27:46 +04:00
|
|
|
gURLs[0]["url" + gState].spec + " | " + gFailureReason + "\n");
|
2007-02-13 03:54:02 +03:00
|
|
|
gURLs.shift();
|
|
|
|
StartCurrentTest();
|
|
|
|
}
|