michael@0: /* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- / michael@0: /* vim: set shiftwidth=4 tabstop=8 autoindent cindent expandtab: */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #if BOOTSTRAP michael@0: this.EXPORTED_SYMBOLS = ["OnRefTestLoad"]; michael@0: #endif michael@0: michael@0: michael@0: const CC = Components.classes; michael@0: const CI = Components.interfaces; michael@0: const CR = Components.results; michael@0: michael@0: const XHTML_NS = "http://www.w3.org/1999/xhtml"; michael@0: const XUL_NS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"; michael@0: michael@0: const NS_LOCAL_FILE_CONTRACTID = "@mozilla.org/file/local;1"; michael@0: const NS_GFXINFO_CONTRACTID = "@mozilla.org/gfx/info;1"; michael@0: const IO_SERVICE_CONTRACTID = "@mozilla.org/network/io-service;1"; michael@0: const DEBUG_CONTRACTID = "@mozilla.org/xpcom/debug;1"; michael@0: const NS_LOCALFILEINPUTSTREAM_CONTRACTID = michael@0: "@mozilla.org/network/file-input-stream;1"; michael@0: const NS_SCRIPTSECURITYMANAGER_CONTRACTID = michael@0: "@mozilla.org/scriptsecuritymanager;1"; michael@0: const NS_REFTESTHELPER_CONTRACTID = michael@0: "@mozilla.org/reftest-helper;1"; michael@0: const NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX = michael@0: "@mozilla.org/network/protocol;1?name="; michael@0: const NS_XREAPPINFO_CONTRACTID = michael@0: "@mozilla.org/xre/app-info;1"; michael@0: const NS_DIRECTORY_SERVICE_CONTRACTID = michael@0: "@mozilla.org/file/directory_service;1"; michael@0: const NS_OBSERVER_SERVICE_CONTRACTID = michael@0: "@mozilla.org/observer-service;1"; michael@0: michael@0: Components.utils.import("resource://gre/modules/FileUtils.jsm"); michael@0: michael@0: var gLoadTimeout = 0; michael@0: var gTimeoutHook = null; michael@0: var gRemote = false; michael@0: var gIgnoreWindowSize = false; michael@0: var gShuffle = false; michael@0: var gTotalChunks = 0; michael@0: var gThisChunk = 0; michael@0: var gContainingWindow = null; michael@0: var gURLFilterRegex = null; michael@0: const FOCUS_FILTER_ALL_TESTS = "all"; michael@0: const FOCUS_FILTER_NEEDS_FOCUS_TESTS = "needs-focus"; michael@0: const FOCUS_FILTER_NON_NEEDS_FOCUS_TESTS = "non-needs-focus"; michael@0: var gFocusFilterMode = FOCUS_FILTER_ALL_TESTS; michael@0: michael@0: // "" michael@0: const BLANK_URL_FOR_CLEARING = "data:text/html;charset=UTF-8,%3C%21%2D%2DCLEAR%2D%2D%3E"; michael@0: michael@0: var gBrowser; michael@0: // Are we testing web content loaded in a separate process? michael@0: var gBrowserIsRemote; // bool michael@0: // Are we using