mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-04 13:07:52 +00:00
Rollup of bug 615386, parts 1-6. Teach the reftest harness about <browser remote>. r=dbaron,roc,ted a=a
--HG-- rename : layout/tools/reftest/reftest.js => layout/tools/reftest/reftest-content.js
This commit is contained in:
parent
bdf44f5f2e
commit
97685d6934
@ -1,11 +1,11 @@
|
||||
== input-load.html input-ref.html
|
||||
== input-create.html input-ref.html
|
||||
== button-load.html button-ref.html
|
||||
== button-create.html button-ref.html
|
||||
== textarea-load.html textarea-ref.html
|
||||
== textarea-create.html textarea-ref.html
|
||||
== select-load.html select-ref.html
|
||||
== select-create.html select-ref.html
|
||||
== autofocus-after-load.html autofocus-after-load-ref.html
|
||||
== autofocus-leaves-iframe.html autofocus-leaves-iframe-ref.html
|
||||
== autofocus-after-body-focus.html autofocus-after-body-focus-ref.html
|
||||
needs-focus == input-load.html input-ref.html
|
||||
needs-focus == input-create.html input-ref.html
|
||||
needs-focus == button-load.html button-ref.html
|
||||
needs-focus == button-create.html button-ref.html
|
||||
needs-focus == textarea-load.html textarea-ref.html
|
||||
needs-focus == textarea-create.html textarea-ref.html
|
||||
needs-focus == select-load.html select-ref.html
|
||||
needs-focus == select-create.html select-ref.html
|
||||
needs-focus == autofocus-after-load.html autofocus-after-load-ref.html
|
||||
needs-focus == autofocus-leaves-iframe.html autofocus-leaves-iframe-ref.html
|
||||
needs-focus == autofocus-after-body-focus.html autofocus-after-body-focus-ref.html
|
||||
|
@ -11,7 +11,7 @@ load 448329-2.html
|
||||
load 448329-3.html
|
||||
load 456727-1.html
|
||||
load 456727-2.html
|
||||
asserts(2) load 467647-1.html # bug 382210, bug 414178
|
||||
needs-focus asserts(2) load 467647-1.html # bug 382210, bug 414178
|
||||
load 499844-1.html
|
||||
load 503709-1.xhtml
|
||||
load 513375-1.xhtml
|
||||
|
@ -1,2 +1,2 @@
|
||||
asserts(3) load 407072-1.html # bug 382210?
|
||||
needs-focus asserts(3) load 407072-1.html # bug 382210?
|
||||
load 449006-1.html
|
||||
|
@ -93,7 +93,7 @@ load 337476-1.xul
|
||||
load 338703-1.html
|
||||
load 339651-1.html
|
||||
load 340093-1.xul
|
||||
load 341858-1.html
|
||||
asserts-if(browserIsRemote,1) load 341858-1.html # bug 622188
|
||||
load 342145-1.xhtml
|
||||
load 343293-1.xhtml
|
||||
load 343293-2.xhtml
|
||||
@ -103,7 +103,7 @@ load 344064-1.html
|
||||
load 344300-1.html
|
||||
load 344300-2.html
|
||||
load 344340-1.xul
|
||||
load 347898-1.html
|
||||
asserts-if(browserIsRemote,1) load 347898-1.html # bug 622188
|
||||
load 348126-1.html
|
||||
load 348688-1.html
|
||||
load 348708-1.xhtml
|
||||
|
@ -35,7 +35,7 @@ load 342322-1.html
|
||||
load 343206-1.xhtml
|
||||
load 345139-1.xhtml
|
||||
load 345617-1.html
|
||||
load 348887-1.html
|
||||
skip load 348887-1.html # bug 623091
|
||||
load 348991-1.xhtml
|
||||
load 354458-1.html
|
||||
load 354458-2.html
|
||||
|
@ -147,7 +147,7 @@ random == 99850-1b.html 99850-1-ref.html # bug 471629
|
||||
== 180085-2.html 180085-2-ref.html
|
||||
== 185388-1.html 185388-1-ref.html
|
||||
== 192902-1.html 192902-ref.html
|
||||
!= 200774-1.html about:blank # really a crashtest
|
||||
!= 200774-1.html about:blank
|
||||
== 201215-1.html 201215-1-ref.html
|
||||
== 201293-1a.html 201293-1-ref.html
|
||||
== 201293-1b.html 201293-1-ref.html
|
||||
@ -1355,7 +1355,7 @@ random-if(cocoaWidget&&layersGPUAccelerated) == 502288-1.html 502288-1-ref.html
|
||||
== 503399.html 503399-ref.html
|
||||
# Reftest for bug 503531 marked as failing; should be re-enabled when
|
||||
# bug 607548 gets resolved.
|
||||
fails == 503531-1.html 503531-1-ref.html
|
||||
needs-focus fails == 503531-1.html 503531-1-ref.html
|
||||
== 504032-1.html 504032-1-ref.html
|
||||
== 505743-1.html about:blank
|
||||
== 506481-1.html 506481-1-ref.html
|
||||
@ -1428,9 +1428,9 @@ asserts(5) == 528038-2.html 528038-2-ref.html # bug 512749
|
||||
== 539949-1.html#test2 539949-1-ref.html#test2
|
||||
== 541382-1.html 541382-1-ref.html
|
||||
random-if(!haveTestPlugin) == 541406-1.html 541406-1-ref.html
|
||||
!= 542116-1.html 542116-1-ref.html
|
||||
asserts(1) != 542116-2.html 542116-2-ref.html # bug 596901
|
||||
!= 542116-3.html 542116-3-ref.html
|
||||
needs-focus != 542116-1.html 542116-1-ref.html
|
||||
needs-focus asserts(1) != 542116-2.html 542116-2-ref.html # bug 596901
|
||||
needs-focus != 542116-3.html 542116-3-ref.html
|
||||
== 542317-1.html 542317-1-ref.html
|
||||
== 542605-hidden-unscrollable.xul 542605-hidden-unscrollable-ref.xul
|
||||
== 542620-1.html 542620-1-ref.html
|
||||
@ -1488,7 +1488,7 @@ random-if(d2d) == 555388-1.html 555388-1-ref.html
|
||||
random-if(layersGPUAccelerated) == 564991-1.html 564991-1-ref.html
|
||||
== 565819-1.html 565819-ref.html
|
||||
== 565819-2.html 565819-ref.html
|
||||
== 568441.html 568441-ref.html
|
||||
needs-focus == 568441.html 568441-ref.html
|
||||
== 569006-1.html 569006-1-ref.html
|
||||
== 571281-1a.html 571281-1-ref.html
|
||||
== 571281-1b.html 571281-1-ref.html
|
||||
@ -1553,15 +1553,15 @@ fails-if(!haveTestPlugin) == 599476.html 599476-ref.html
|
||||
== 605157-1.xhtml 605157-1-ref.xhtml
|
||||
== 609272-1.html 609272-1-ref.html
|
||||
== 608636-1.html 608636-1-ref.html
|
||||
== 613433-1.html 613433-1-ref.html
|
||||
== 613433-1.html 613433-2-ref.html
|
||||
== 613433-1.html 613433-3-ref.html
|
||||
== 613433-2.html 613433-1-ref.html
|
||||
== 613433-2.html 613433-2-ref.html
|
||||
== 613433-2.html 613433-3-ref.html
|
||||
== 613433-3.html 613433-1-ref.html
|
||||
== 613433-3.html 613433-2-ref.html
|
||||
== 613433-3.html 613433-3-ref.html
|
||||
needs-focus == 613433-1.html 613433-1-ref.html
|
||||
needs-focus == 613433-1.html 613433-2-ref.html
|
||||
needs-focus == 613433-1.html 613433-3-ref.html
|
||||
needs-focus == 613433-2.html 613433-1-ref.html
|
||||
needs-focus == 613433-2.html 613433-2-ref.html
|
||||
needs-focus == 613433-2.html 613433-3-ref.html
|
||||
needs-focus == 613433-3.html 613433-1-ref.html
|
||||
needs-focus == 613433-3.html 613433-2-ref.html
|
||||
needs-focus == 613433-3.html 613433-3-ref.html
|
||||
== 614272-1.svg 614272-1-ref.svg
|
||||
HTTP(..) == 615121-1.html 615121-1-ref.html
|
||||
HTTP(..) != 615121-2.html 615121-2-notref.html
|
||||
|
@ -1,6 +1,6 @@
|
||||
== placeholder-simple.html placeholder-simple-ref.html
|
||||
== placeholder-focus.html placeholder-focus-ref.html
|
||||
== placeholder-blur.html placeholder-simple-ref.html
|
||||
needs-focus == placeholder-focus.html placeholder-focus-ref.html
|
||||
needs-focus == placeholder-blur.html placeholder-simple-ref.html
|
||||
== placeholder-value.html placeholder-value-ref.html
|
||||
== placeholder-empty-string.html placeholder-empty-string-ref.html
|
||||
== placeholder-complex.html placeholder-complex-ref.html
|
||||
|
@ -1,6 +1,6 @@
|
||||
== placeholder-simple.html placeholder-simple-ref.html
|
||||
== placeholder-focus.html placeholder-focus-ref.html
|
||||
== placeholder-blur.html placeholder-simple-ref.html
|
||||
needs-focus == placeholder-focus.html placeholder-focus-ref.html
|
||||
needs-focus == placeholder-blur.html placeholder-simple-ref.html
|
||||
== placeholder-value.html placeholder-value-ref.html
|
||||
== placeholder-empty-string.html placeholder-empty-string-ref.html
|
||||
== placeholder-complex.html placeholder-complex-ref.html
|
||||
|
@ -4,8 +4,8 @@
|
||||
== select.html select-ref.html
|
||||
== fieldset.html fieldset-ref.html
|
||||
== output.html output-ref.html
|
||||
== input-focus.html input-focus-ref.html
|
||||
== button-focus.html button-focus-ref.html
|
||||
== textarea-focus.html textarea-focus-ref.html
|
||||
== select-focus.html select-focus-ref.html
|
||||
== textarea-focus.html textarea-focus-ref.html
|
||||
needs-focus == input-focus.html input-focus-ref.html
|
||||
needs-focus == button-focus.html button-focus-ref.html
|
||||
needs-focus == textarea-focus.html textarea-focus-ref.html
|
||||
needs-focus == select-focus.html select-focus-ref.html
|
||||
|
||||
|
@ -13,7 +13,7 @@ include xul/reftest.list
|
||||
== passwd-1.html passwd-ref.html
|
||||
!= passwd-2.html passwd-ref.html
|
||||
== passwd-3.html passwd-ref.html
|
||||
asserts(1) == passwd-4.html passwd-ref.html # bug 596901
|
||||
needs-focus asserts(1) == passwd-4.html passwd-ref.html # bug 596901
|
||||
== emptypasswd-1.html emptypasswd-ref.html
|
||||
== emptypasswd-2.html emptypasswd-ref.html
|
||||
== caret_on_positioned.html caret_on_positioned-ref.html
|
||||
@ -41,9 +41,9 @@ asserts(1) == passwd-4.html passwd-ref.html # bug 596901
|
||||
!= spellcheck-textarea-property-dynamic-override.html spellcheck-textarea-ref.html
|
||||
!= spellcheck-textarea-property-dynamic-override-inherit.html spellcheck-textarea-ref.html
|
||||
== caret_on_focus.html caret_on_focus-ref.html
|
||||
!= caret_on_textarea_lastline.html caret_on_textarea_lastline-ref.html
|
||||
== input-text-onfocus-reframe.html input-text-onfocus-reframe-ref.html
|
||||
== input-text-notheme-onfocus-reframe.html input-text-notheme-onfocus-reframe-ref.html
|
||||
== caret_after_reframe.html caret_after_reframe-ref.html
|
||||
needs-focus != caret_on_textarea_lastline.html caret_on_textarea_lastline-ref.html
|
||||
needs-focus == input-text-onfocus-reframe.html input-text-onfocus-reframe-ref.html
|
||||
needs-focus == input-text-notheme-onfocus-reframe.html input-text-notheme-onfocus-reframe-ref.html
|
||||
needs-focus == caret_after_reframe.html caret_after_reframe-ref.html
|
||||
== nobogusnode-1.html nobogusnode-ref.html
|
||||
== nobogusnode-2.html nobogusnode-ref.html
|
||||
|
@ -8,19 +8,19 @@
|
||||
== placeholder-5.html placeholder-visible-ref.html
|
||||
== placeholder-6.html placeholder-overflow-ref.html
|
||||
== placeholder-6-textarea.html placeholder-overflow-textarea-ref.html
|
||||
== placeholder-7.html placeholder-focus-ref.html
|
||||
== placeholder-8.html placeholder-focus-ref.html
|
||||
== placeholder-9.html placeholder-focus-ref.html
|
||||
== placeholder-10.html placeholder-visible-ref.html
|
||||
needs-focus == placeholder-7.html placeholder-focus-ref.html
|
||||
needs-focus == placeholder-8.html placeholder-focus-ref.html
|
||||
needs-focus == placeholder-9.html placeholder-focus-ref.html
|
||||
needs-focus == placeholder-10.html placeholder-visible-ref.html
|
||||
== placeholder-11.html placeholder-visible-ref.html
|
||||
== placeholder-12.html placeholder-visible-ref.html
|
||||
== placeholder-13.html placeholder-visible-ref.html
|
||||
== placeholder-14.html placeholder-visible-ref.html
|
||||
== placeholder-15.html placeholder-focus-ref.html
|
||||
== placeholder-16.html placeholder-focus-ref.html
|
||||
== placeholder-17.html placeholder-focus-ref.html
|
||||
needs-focus == placeholder-15.html placeholder-focus-ref.html
|
||||
needs-focus == placeholder-16.html placeholder-focus-ref.html
|
||||
needs-focus == placeholder-17.html placeholder-focus-ref.html
|
||||
== placeholder-18.html placeholder-overridden-ref.html
|
||||
== placeholder-19.xul placeholder-overridden-ref.xul
|
||||
== placeholder-20.html placeholder-focus-ref.html
|
||||
== placeholder-21.html placeholder-focus-ref.html
|
||||
== placeholder-22.html placeholder-focus-ref.html
|
||||
needs-focus == placeholder-20.html placeholder-focus-ref.html
|
||||
needs-focus == placeholder-21.html placeholder-focus-ref.html
|
||||
needs-focus == placeholder-22.html placeholder-focus-ref.html
|
||||
|
14
layout/reftests/reftest-sanity/needs-focus.html
Normal file
14
layout/reftests/reftest-sanity/needs-focus.html
Normal file
@ -0,0 +1,14 @@
|
||||
<!DOCTYPE html>
|
||||
<html class="reftest-wait">
|
||||
<script type="text/javascript">
|
||||
function focusInput() {
|
||||
document.getElementById('i').focus();
|
||||
}
|
||||
function done() {
|
||||
document.documentElement.className = '';
|
||||
}
|
||||
</script>
|
||||
<body onload="focusInput();">
|
||||
<input type="text" id="i" onfocus="done();">
|
||||
</body>
|
||||
</html>
|
@ -78,3 +78,6 @@ include urlprefixtests.list
|
||||
!= page-height-2in.html page-height-2.1in.html
|
||||
== page-height-2in.html page-height-nobreak.html
|
||||
== page-height-2.1in.html page-height-forcebreak.html
|
||||
|
||||
# Check that tests that need focus are skipped when it's not available
|
||||
needs-focus load needs-focus.html
|
||||
|
@ -58,6 +58,9 @@ must be one of the following:
|
||||
conditions of <type>. If the condition is not met,
|
||||
the test passes if the conditions of <type> are met.
|
||||
|
||||
needs-focus The test fails or times out if the reftest window is not
|
||||
focused.
|
||||
|
||||
random The results of the test are random and therefore not to be
|
||||
considered in the output.
|
||||
|
||||
|
@ -2,6 +2,7 @@ reftest.jar:
|
||||
% content reftest %content/
|
||||
* content/quit.js (quit.js)
|
||||
* content/reftest.js (reftest.js)
|
||||
content/reftest-content.js (reftest-content.js)
|
||||
content/reftest.xul (reftest.xul)
|
||||
content/MozillaFileLogger.js (../../../testing/mochitest/tests/SimpleTest/MozillaFileLogger.js)
|
||||
#ifdef XPI_NAME
|
||||
|
@ -39,7 +39,7 @@
|
||||
import sys, os.path, re
|
||||
|
||||
commentRE = re.compile(r"\s+#")
|
||||
conditionsRE = re.compile(r"^(fails|random|skip|asserts)")
|
||||
conditionsRE = re.compile(r"^(fails|needs-focus|random|skip|asserts)")
|
||||
httpRE = re.compile(r"HTTP\((\.\.(\/\.\.)*)\)")
|
||||
protocolRE = re.compile(r"^\w+:")
|
||||
|
||||
|
783
layout/tools/reftest/reftest-content.js
Normal file
783
layout/tools/reftest/reftest-content.js
Normal file
@ -0,0 +1,783 @@
|
||||
/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- /
|
||||
/* 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;
|
||||
|
||||
/**
|
||||
* FIXME/bug 622224: work around lack of reliable setTimeout available
|
||||
* to frame scripts.
|
||||
*/
|
||||
// This gives us >=2^30 unique timer IDs, enough for 1 per ms for 12.4
|
||||
// days. Should be fine as a temporary workaround.
|
||||
var gNextTimeoutId = 0;
|
||||
var gTimeoutTable = { }; // int -> nsITimer
|
||||
|
||||
function setTimeout(callbackFn, delayMs) {
|
||||
var id = gNextTimeoutId++;
|
||||
var timer = CC["@mozilla.org/timer;1"].createInstance(CI.nsITimer);
|
||||
timer.initWithCallback({
|
||||
notify: function notify_callback() {
|
||||
clearTimeout(id);
|
||||
callbackFn();
|
||||
}
|
||||
},
|
||||
delayMs,
|
||||
timer.TYPE_ONE_SHOT);
|
||||
|
||||
gTimeoutTable[id] = timer;
|
||||
|
||||
return id;
|
||||
}
|
||||
|
||||
function clearTimeout(id) {
|
||||
var timer = gTimeoutTable[id];
|
||||
if (timer) {
|
||||
timer.cancel();
|
||||
delete gTimeoutTable[id];
|
||||
}
|
||||
}
|
||||
|
||||
const XHTML_NS = "http://www.w3.org/1999/xhtml";
|
||||
|
||||
const DEBUG_CONTRACTID = "@mozilla.org/xpcom/debug;1";
|
||||
const PRINTSETTINGS_CONTRACTID = "@mozilla.org/gfx/printsettings-service;1";
|
||||
|
||||
// "<!--CLEAR-->"
|
||||
const BLANK_URL_FOR_CLEARING = "data:text/html,%3C%21%2D%2DCLEAR%2D%2D%3E";
|
||||
|
||||
var gBrowserIsRemote;
|
||||
var gHaveCanvasSnapshot = false;
|
||||
// Plugin layers can be updated asynchronously, so to make sure that all
|
||||
// layer surfaces have the right content, we need to listen for explicit
|
||||
// "MozPaintWait" and "MozPaintWaitFinished" events that signal when it's OK
|
||||
// to take snapshots. We cannot take a snapshot while the number of
|
||||
// "MozPaintWait" events fired exceeds the number of "MozPaintWaitFinished"
|
||||
// events fired. We count the number of such excess events here. When
|
||||
// the counter reaches zero we call gExplicitPendingPaintsCompleteHook.
|
||||
var gExplicitPendingPaintCount = 0;
|
||||
var gExplicitPendingPaintsCompleteHook;
|
||||
var gCurrentURL;
|
||||
var gCurrentTestType;
|
||||
var gTimeoutHook = null;
|
||||
var gFailureTimeout = null;
|
||||
var gFailureReason;
|
||||
var gAssertionCount = 0;
|
||||
|
||||
var gDebug;
|
||||
|
||||
var gCurrentTestStartTime;
|
||||
var gClearingForAssertionCheck = false;
|
||||
|
||||
const TYPE_SCRIPT = 'script'; // test contains individual test results
|
||||
|
||||
function markupDocumentViewer() {
|
||||
return docShell.contentViewer.QueryInterface(CI.nsIMarkupDocumentViewer);
|
||||
}
|
||||
|
||||
function webNavigation() {
|
||||
return docShell.QueryInterface(CI.nsIWebNavigation);
|
||||
}
|
||||
|
||||
function windowUtils() {
|
||||
return content.QueryInterface(CI.nsIInterfaceRequestor)
|
||||
.getInterface(CI.nsIDOMWindowUtils);
|
||||
}
|
||||
|
||||
function IDForEventTarget(event)
|
||||
{
|
||||
try {
|
||||
return "'" + event.target.getAttribute('id') + "'";
|
||||
} catch (ex) {
|
||||
return "<unknown>";
|
||||
}
|
||||
}
|
||||
|
||||
function PaintWaitListener(event)
|
||||
{
|
||||
LogInfo("MozPaintWait received for ID " + IDForEventTarget(event));
|
||||
gExplicitPendingPaintCount++;
|
||||
}
|
||||
|
||||
function PaintWaitFinishedListener(event)
|
||||
{
|
||||
LogInfo("MozPaintWaitFinished received for ID " + IDForEventTarget(event));
|
||||
gExplicitPendingPaintCount--;
|
||||
if (gExplicitPendingPaintCount < 0) {
|
||||
LogWarning("Underrun in gExplicitPendingPaintCount\n");
|
||||
gExplicitPendingPaintCount = 0;
|
||||
}
|
||||
if (gExplicitPendingPaintCount == 0 &&
|
||||
gExplicitPendingPaintsCompleteHook) {
|
||||
gExplicitPendingPaintsCompleteHook();
|
||||
}
|
||||
}
|
||||
|
||||
function OnInitialLoad()
|
||||
{
|
||||
removeEventListener("load", OnInitialLoad, true);
|
||||
|
||||
gDebug = CC[DEBUG_CONTRACTID].getService(CI.nsIDebug2);
|
||||
|
||||
RegisterMessageListeners();
|
||||
|
||||
var initInfo = SendContentReady();
|
||||
gBrowserIsRemote = initInfo.remote;
|
||||
|
||||
addEventListener("load", OnDocumentLoad, true);
|
||||
|
||||
addEventListener("MozPaintWait", PaintWaitListener, true);
|
||||
addEventListener("MozPaintWaitFinished", PaintWaitFinishedListener, true);
|
||||
|
||||
LogWarning("Using browser remote="+ gBrowserIsRemote +"\n");
|
||||
}
|
||||
|
||||
function StartTestURI(type, uri, timeout)
|
||||
{
|
||||
// Reset gExplicitPendingPaintCount in case there was a timeout or
|
||||
// the count is out of sync for some other reason
|
||||
if (gExplicitPendingPaintCount != 0) {
|
||||
LogWarning("Resetting gExplicitPendingPaintCount to zero (currently " +
|
||||
gExplicitPendingPaintCount + "\n");
|
||||
gExplicitPendingPaintCount = 0;
|
||||
}
|
||||
|
||||
gCurrentTestType = type;
|
||||
gCurrentURL = uri;
|
||||
|
||||
gCurrentTestStartTime = Date.now();
|
||||
if (gFailureTimeout != null) {
|
||||
SendException("program error managing timeouts\n");
|
||||
}
|
||||
gFailureTimeout = setTimeout(LoadFailed, timeout);
|
||||
|
||||
LoadURI(gCurrentURL);
|
||||
}
|
||||
|
||||
function setupZoom(contentRootElement) {
|
||||
if (!contentRootElement || !contentRootElement.hasAttribute('reftest-zoom'))
|
||||
return;
|
||||
markupDocumentViewer().fullZoom =
|
||||
contentRootElement.getAttribute('reftest-zoom');
|
||||
}
|
||||
|
||||
function resetZoom() {
|
||||
markupDocumentViewer().fullZoom = 1.0;
|
||||
}
|
||||
|
||||
function doPrintMode(contentRootElement) {
|
||||
// use getAttribute because className works differently in HTML and SVG
|
||||
return contentRootElement &&
|
||||
contentRootElement.hasAttribute('class') &&
|
||||
contentRootElement.getAttribute('class').split(/\s+/)
|
||||
.indexOf("reftest-print") != -1;
|
||||
}
|
||||
|
||||
function setupPrintMode() {
|
||||
var PSSVC =
|
||||
CC[PRINTSETTINGS_CONTRACTID].getService(CI.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 = "";
|
||||
docShell.contentViewer.setPageMode(true, ps);
|
||||
}
|
||||
|
||||
function shouldWaitForExplicitPaintWaiters() {
|
||||
return gExplicitPendingPaintCount > 0;
|
||||
}
|
||||
|
||||
function shouldWaitForPendingPaints() {
|
||||
// if gHaveCanvasSnapshot is false, we're not taking snapshots so
|
||||
// there is no need to wait for pending paints to be flushed.
|
||||
return gHaveCanvasSnapshot && windowUtils().isMozAfterPaintPending;
|
||||
}
|
||||
|
||||
function shouldWaitForReftestWaitRemoval(contentRootElement) {
|
||||
// use getAttribute because className works differently in HTML and SVG
|
||||
return contentRootElement &&
|
||||
contentRootElement.hasAttribute('class') &&
|
||||
contentRootElement.getAttribute('class').split(/\s+/)
|
||||
.indexOf("reftest-wait") != -1;
|
||||
}
|
||||
|
||||
// Initial state. When the document has loaded and all MozAfterPaint events and
|
||||
// all explicit paint waits are flushed, we can fire the MozReftestInvalidate
|
||||
// event and move to the next state.
|
||||
const STATE_WAITING_TO_FIRE_INVALIDATE_EVENT = 0;
|
||||
// When reftest-wait has been removed from the root element, we can move to the
|
||||
// next state.
|
||||
const STATE_WAITING_FOR_REFTEST_WAIT_REMOVAL = 1;
|
||||
// When all MozAfterPaint events and all explicit paint waits are flushed, we're
|
||||
// done and can move to the COMPLETED state.
|
||||
const STATE_WAITING_TO_FINISH = 2;
|
||||
const STATE_COMPLETED = 3;
|
||||
|
||||
function WaitForTestEnd(contentRootElement, inPrintMode) {
|
||||
var stopAfterPaintReceived = false;
|
||||
var currentDoc = content.document;
|
||||
var state = STATE_WAITING_TO_FIRE_INVALIDATE_EVENT;
|
||||
|
||||
function FlushRendering() {
|
||||
var anyPendingPaintsGeneratedInDescendants = false;
|
||||
|
||||
function flushWindow(win) {
|
||||
var utils = win.QueryInterface(CI.nsIInterfaceRequestor)
|
||||
.getInterface(CI.nsIDOMWindowUtils);
|
||||
var afterPaintWasPending = utils.isMozAfterPaintPending;
|
||||
|
||||
try {
|
||||
// Flush pending restyles and reflows for this window
|
||||
win.document.documentElement.getBoundingClientRect();
|
||||
} catch (e) {
|
||||
LogWarning("flushWindow failed: " + e + "\n");
|
||||
}
|
||||
|
||||
if (!afterPaintWasPending && utils.isMozAfterPaintPending) {
|
||||
LogInfo("FlushRendering generated paint for window " + win.location.href);
|
||||
anyPendingPaintsGeneratedInDescendants = true;
|
||||
}
|
||||
|
||||
for (var i = 0; i < win.frames.length; ++i) {
|
||||
flushWindow(win.frames[i]);
|
||||
}
|
||||
}
|
||||
|
||||
flushWindow(content);
|
||||
|
||||
if (anyPendingPaintsGeneratedInDescendants &&
|
||||
!windowUtils().isMozAfterPaintPending) {
|
||||
LogWarning("Internal error: descendant frame generated a MozAfterPaint event, but the root document doesn't have one!");
|
||||
}
|
||||
}
|
||||
|
||||
function AfterPaintListener(event) {
|
||||
LogInfo("AfterPaintListener in " + event.target.document.location.href);
|
||||
if (event.target.document != currentDoc) {
|
||||
// ignore paint events for subframes or old documents in the window.
|
||||
// Invalidation in subframes will cause invalidation in the toplevel document anyway.
|
||||
return;
|
||||
}
|
||||
|
||||
SendUpdateCanvasForEvent(event);
|
||||
// These events are fired immediately after a paint. Don't
|
||||
// confuse ourselves by firing synchronously if we triggered the
|
||||
// paint ourselves.
|
||||
setTimeout(MakeProgress, 0);
|
||||
}
|
||||
|
||||
function AttrModifiedListener() {
|
||||
LogInfo("AttrModifiedListener fired");
|
||||
// Wait for the next return-to-event-loop before continuing --- for
|
||||
// example, the attribute may have been modified in an subdocument's
|
||||
// load event handler, in which case we need load event processing
|
||||
// to complete and unsuppress painting before we check isMozAfterPaintPending.
|
||||
setTimeout(MakeProgress, 0);
|
||||
}
|
||||
|
||||
function ExplicitPaintsCompleteListener() {
|
||||
LogInfo("ExplicitPaintsCompleteListener fired");
|
||||
// Since this can fire while painting, don't confuse ourselves by
|
||||
// firing synchronously. It's fine to do this asynchronously.
|
||||
setTimeout(MakeProgress, 0);
|
||||
}
|
||||
|
||||
function RemoveListeners() {
|
||||
// OK, we can end the test now.
|
||||
removeEventListener("MozAfterPaint", AfterPaintListener, false);
|
||||
if (contentRootElement) {
|
||||
contentRootElement.removeEventListener("DOMAttrModified", AttrModifiedListener, false);
|
||||
}
|
||||
gExplicitPendingPaintsCompleteHook = null;
|
||||
gTimeoutHook = null;
|
||||
// Make sure we're in the COMPLETED state just in case
|
||||
// (this may be called via the test-timeout hook)
|
||||
state = STATE_COMPLETED;
|
||||
}
|
||||
|
||||
// Everything that could cause shouldWaitForXXX() to
|
||||
// change from returning true to returning false is monitored via some kind
|
||||
// of event listener which eventually calls this function.
|
||||
function MakeProgress() {
|
||||
if (state >= STATE_COMPLETED) {
|
||||
LogInfo("MakeProgress: STATE_COMPLETED");
|
||||
return;
|
||||
}
|
||||
|
||||
FlushRendering();
|
||||
|
||||
switch (state) {
|
||||
case STATE_WAITING_TO_FIRE_INVALIDATE_EVENT: {
|
||||
LogInfo("MakeProgress: STATE_WAITING_TO_FIRE_INVALIDATE_EVENT");
|
||||
if (shouldWaitForExplicitPaintWaiters() || shouldWaitForPendingPaints()) {
|
||||
gFailureReason = "timed out waiting for pending paint count to reach zero";
|
||||
if (shouldWaitForExplicitPaintWaiters()) {
|
||||
gFailureReason += " (waiting for MozPaintWaitFinished)";
|
||||
LogInfo("MakeProgress: waiting for MozPaintWaitFinished");
|
||||
}
|
||||
if (shouldWaitForPendingPaints()) {
|
||||
gFailureReason += " (waiting for MozAfterPaint)";
|
||||
LogInfo("MakeProgress: waiting for MozAfterPaint");
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
state = STATE_WAITING_FOR_REFTEST_WAIT_REMOVAL;
|
||||
var hasReftestWait = shouldWaitForReftestWaitRemoval(contentRootElement);
|
||||
// Notify the test document that now is a good time to test some invalidation
|
||||
LogInfo("MakeProgress: dispatching MozReftestInvalidate");
|
||||
if (contentRootElement) {
|
||||
var notification = content.document.createEvent("Events");
|
||||
notification.initEvent("MozReftestInvalidate", true, false);
|
||||
contentRootElement.dispatchEvent(notification);
|
||||
}
|
||||
if (hasReftestWait && !shouldWaitForReftestWaitRemoval(contentRootElement)) {
|
||||
// MozReftestInvalidate handler removed reftest-wait.
|
||||
// We expect something to have been invalidated...
|
||||
FlushRendering();
|
||||
if (!shouldWaitForPendingPaints() && !shouldWaitForExplicitPaintWaiters()) {
|
||||
LogWarning("MozInvalidateEvent didn't invalidate");
|
||||
}
|
||||
}
|
||||
// Try next state
|
||||
MakeProgress();
|
||||
return;
|
||||
}
|
||||
|
||||
case STATE_WAITING_FOR_REFTEST_WAIT_REMOVAL:
|
||||
LogInfo("MakeProgress: STATE_WAITING_FOR_REFTEST_WAIT_REMOVAL");
|
||||
if (shouldWaitForReftestWaitRemoval(contentRootElement)) {
|
||||
gFailureReason = "timed out waiting for reftest-wait to be removed";
|
||||
LogInfo("MakeProgress: waiting for reftest-wait to be removed");
|
||||
return;
|
||||
}
|
||||
state = STATE_WAITING_TO_FINISH;
|
||||
if (!inPrintMode && doPrintMode(contentRootElement)) {
|
||||
LogInfo("MakeProgress: setting up print mode");
|
||||
setupPrintMode();
|
||||
}
|
||||
// Try next state
|
||||
MakeProgress();
|
||||
return;
|
||||
|
||||
case STATE_WAITING_TO_FINISH:
|
||||
LogInfo("MakeProgress: STATE_WAITING_TO_FINISH");
|
||||
if (shouldWaitForExplicitPaintWaiters() || shouldWaitForPendingPaints()) {
|
||||
gFailureReason = "timed out waiting for pending paint count to " +
|
||||
"reach zero (after reftest-wait removed and switch to print mode)";
|
||||
if (shouldWaitForExplicitPaintWaiters()) {
|
||||
gFailureReason += " (waiting for MozPaintWaitFinished)";
|
||||
LogInfo("MakeProgress: waiting for MozPaintWaitFinished");
|
||||
}
|
||||
if (shouldWaitForPendingPaints()) {
|
||||
gFailureReason += " (waiting for MozAfterPaint)";
|
||||
LogInfo("MakeProgress: waiting for MozAfterPaint");
|
||||
}
|
||||
return;
|
||||
}
|
||||
LogInfo("MakeProgress: Completed");
|
||||
state = STATE_COMPLETED;
|
||||
gFailureReason = "timed out while taking snapshot (bug in harness?)";
|
||||
RemoveListeners();
|
||||
setTimeout(RecordResult, 0);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
LogInfo("WaitForTestEnd: Adding listeners");
|
||||
addEventListener("MozAfterPaint", AfterPaintListener, false);
|
||||
// If contentRootElement is null then shouldWaitForReftestWaitRemoval will
|
||||
// always return false so we don't need a listener anyway
|
||||
if (contentRootElement) {
|
||||
contentRootElement.addEventListener("DOMAttrModified", AttrModifiedListener, false);
|
||||
}
|
||||
gExplicitPendingPaintsCompleteHook = ExplicitPaintsCompleteListener;
|
||||
gTimeoutHook = RemoveListeners;
|
||||
|
||||
// Take a full snapshot now that all our listeners are set up. This
|
||||
// ensures it's impossible for us to miss updates between taking the snapshot
|
||||
// and adding our listeners.
|
||||
SendInitCanvasWithSnapshot();
|
||||
MakeProgress();
|
||||
}
|
||||
|
||||
function OnDocumentLoad(event)
|
||||
{
|
||||
var currentDoc = content.document;
|
||||
if (event.target != currentDoc)
|
||||
// Ignore load events for subframes.
|
||||
return;
|
||||
|
||||
if (gClearingForAssertionCheck &&
|
||||
currentDoc.location.href == BLANK_URL_FOR_CLEARING) {
|
||||
DoAssertionCheck();
|
||||
return;
|
||||
}
|
||||
|
||||
if (currentDoc.location.href != gCurrentURL) {
|
||||
LogInfo("OnDocumentLoad fired for previous document");
|
||||
// Ignore load events for previous documents.
|
||||
return;
|
||||
}
|
||||
|
||||
var contentRootElement = currentDoc ? currentDoc.documentElement : null;
|
||||
setupZoom(contentRootElement);
|
||||
var inPrintMode = false;
|
||||
|
||||
function AfterOnLoadScripts() {
|
||||
// Take a snapshot now. We need to do this before we check whether
|
||||
// we should wait, since this might trigger dispatching of
|
||||
// MozPaintWait events and make shouldWaitForExplicitPaintWaiters() true
|
||||
// below.
|
||||
var painted = SendInitCanvasWithSnapshot();
|
||||
|
||||
if (shouldWaitForExplicitPaintWaiters() ||
|
||||
(!inPrintMode && doPrintMode(contentRootElement)) ||
|
||||
// If we didn't force a paint above, in
|
||||
// InitCurrentCanvasWithSnapshot, so we should wait for a
|
||||
// paint before we consider them done.
|
||||
!painted) {
|
||||
LogInfo("AfterOnLoadScripts belatedly entering WaitForTestEnd");
|
||||
// Go into reftest-wait mode belatedly.
|
||||
WaitForTestEnd(contentRootElement, inPrintMode);
|
||||
} else {
|
||||
RecordResult();
|
||||
}
|
||||
}
|
||||
|
||||
if (shouldWaitForReftestWaitRemoval(contentRootElement) ||
|
||||
shouldWaitForExplicitPaintWaiters()) {
|
||||
// Go into reftest-wait mode immediately after painting has been
|
||||
// unsuppressed, after the onload event has finished dispatching.
|
||||
gFailureReason = "timed out waiting for test to complete (trying to get into WaitForTestEnd)";
|
||||
LogInfo("OnDocumentLoad triggering WaitForTestEnd");
|
||||
setTimeout(function () { WaitForTestEnd(contentRootElement, inPrintMode); }, 0);
|
||||
} else {
|
||||
if (doPrintMode(contentRootElement)) {
|
||||
LogInfo("OnDocumentLoad setting up print mode");
|
||||
setupPrintMode();
|
||||
inPrintMode = true;
|
||||
}
|
||||
|
||||
// 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.
|
||||
gFailureReason = "timed out waiting for test to complete (waiting for onload scripts to complete)";
|
||||
LogInfo("OnDocumentLoad triggering AfterOnLoadScripts");
|
||||
setTimeout(function () { setTimeout(AfterOnLoadScripts, 0); }, 0);
|
||||
}
|
||||
}
|
||||
|
||||
function UpdateCurrentCanvasForEvent(event)
|
||||
{
|
||||
if (!gCurrentCanvas)
|
||||
return;
|
||||
|
||||
var ctx = gCurrentCanvas.getContext("2d");
|
||||
var rectList = event.clientRects;
|
||||
for (var i = 0; i < rectList.length; ++i) {
|
||||
var r = rectList[i];
|
||||
// Set left/top/right/bottom to pixel boundaries
|
||||
var left = Math.floor(r.left);
|
||||
var top = Math.floor(r.top);
|
||||
var right = Math.ceil(r.right);
|
||||
var bottom = Math.ceil(r.bottom);
|
||||
|
||||
ctx.save();
|
||||
ctx.translate(left, top);
|
||||
DoDrawWindow(ctx, left, top, right - left, bottom - top);
|
||||
ctx.restore();
|
||||
}
|
||||
}
|
||||
|
||||
function RecordResult()
|
||||
{
|
||||
LogInfo("RecordResult fired");
|
||||
|
||||
var currentTestRunTime = Date.now() - gCurrentTestStartTime;
|
||||
|
||||
clearTimeout(gFailureTimeout);
|
||||
gFailureReason = null;
|
||||
gFailureTimeout = null;
|
||||
|
||||
if (gCurrentTestType == TYPE_SCRIPT) {
|
||||
var error = '';
|
||||
var testwindow = content;
|
||||
|
||||
if (testwindow.wrappedJSObject)
|
||||
testwindow = testwindow.wrappedJSObject;
|
||||
|
||||
var testcases;
|
||||
if (!testwindow.getTestCases || typeof testwindow.getTestCases != "function") {
|
||||
// Force an unexpected failure to alert the test author to fix the test.
|
||||
error = "test must provide a function getTestCases(). (SCRIPT)\n";
|
||||
}
|
||||
else if (!(testcases = testwindow.getTestCases())) {
|
||||
// Force an unexpected failure to alert the test author to fix the test.
|
||||
error = "test's getTestCases() must return an Array-like Object. (SCRIPT)\n";
|
||||
}
|
||||
else if (testcases.length == 0) {
|
||||
// This failure may be due to a JavaScript Engine bug causing
|
||||
// early termination of the test. If we do not allow silent
|
||||
// failure, the driver will report an error.
|
||||
}
|
||||
|
||||
var results = [ ];
|
||||
if (!error) {
|
||||
// FIXME/bug 618176: temporary workaround
|
||||
for (var i = 0; i < testcases.length; ++i) {
|
||||
var test = testcases[i];
|
||||
results.push({ passed: test.testPassed(),
|
||||
description: test.testDescription() });
|
||||
}
|
||||
//results = testcases.map(function(test) {
|
||||
// return { passed: test.testPassed(),
|
||||
// description: test.testDescription() };
|
||||
}
|
||||
|
||||
SendScriptResults(currentTestRunTime, error, results);
|
||||
FinishTestItem();
|
||||
return;
|
||||
}
|
||||
|
||||
SendTestDone(currentTestRunTime);
|
||||
FinishTestItem();
|
||||
}
|
||||
|
||||
function LoadFailed()
|
||||
{
|
||||
if (gTimeoutHook) {
|
||||
gTimeoutHook();
|
||||
}
|
||||
gFailureTimeout = null;
|
||||
SendFailedLoad(gFailureReason);
|
||||
}
|
||||
|
||||
function FinishTestItem()
|
||||
{
|
||||
gHaveCanvasSnapshot = false;
|
||||
}
|
||||
|
||||
function DoAssertionCheck()
|
||||
{
|
||||
gClearingForAssertionCheck = false;
|
||||
|
||||
var numAsserts = 0;
|
||||
if (gDebug.isDebugBuild) {
|
||||
var newAssertionCount = gDebug.assertionCount;
|
||||
numAsserts = newAssertionCount - gAssertionCount;
|
||||
gAssertionCount = newAssertionCount;
|
||||
}
|
||||
SendAssertionCount(numAsserts);
|
||||
}
|
||||
|
||||
function LoadURI(uri)
|
||||
{
|
||||
var flags = webNavigation().LOAD_FLAGS_NONE;
|
||||
webNavigation().loadURI(uri, flags, null, null, null);
|
||||
}
|
||||
|
||||
function LogWarning(str)
|
||||
{
|
||||
sendAsyncMessage("reftest:Log", { type: "warning", msg: str });
|
||||
}
|
||||
|
||||
function LogInfo(str)
|
||||
{
|
||||
sendAsyncMessage("reftest:Log", { type: "info", msg: str });
|
||||
}
|
||||
|
||||
var gDummyCanvas = null;
|
||||
function SynchronizeForSnapshot()
|
||||
{
|
||||
if (gDummyCanvas == null) {
|
||||
gDummyCanvas = content.document.createElementNS(XHTML_NS, "canvas");
|
||||
gDummyCanvas.setAttribute("width", 1);
|
||||
gDummyCanvas.setAttribute("height", 1);
|
||||
}
|
||||
|
||||
var ctx = gDummyCanvas.getContext("2d");
|
||||
var flags = ctx.DRAWWINDOW_DRAW_CARET | ctx.DRAWWINDOW_DRAW_VIEW | ctx.DRAWWINDOW_USE_WIDGET_LAYERS;
|
||||
ctx.drawWindow(content, 0, 0, 1, 1, "rgb(255,255,255)", flags);
|
||||
}
|
||||
|
||||
function RegisterMessageListeners()
|
||||
{
|
||||
addMessageListener(
|
||||
"reftest:Clear",
|
||||
function (m) { RecvClear() }
|
||||
);
|
||||
addMessageListener(
|
||||
"reftest:LoadScriptTest",
|
||||
function (m) { RecvLoadScriptTest(m.json.uri, m.json.timeout); }
|
||||
);
|
||||
addMessageListener(
|
||||
"reftest:LoadTest",
|
||||
function (m) { RecvLoadTest(m.json.type, m.json.uri, m.json.timeout); }
|
||||
);
|
||||
addMessageListener(
|
||||
"reftest:ResetZoom",
|
||||
function (m) { RecvResetZoom(); }
|
||||
);
|
||||
}
|
||||
|
||||
function RecvClear()
|
||||
{
|
||||
gClearingForAssertionCheck = true;
|
||||
LoadURI(BLANK_URL_FOR_CLEARING);
|
||||
}
|
||||
|
||||
function RecvLoadTest(type, uri, timeout)
|
||||
{
|
||||
StartTestURI(type, uri, timeout);
|
||||
}
|
||||
|
||||
function RecvLoadScriptTest(uri, timeout)
|
||||
{
|
||||
StartTestURI(TYPE_SCRIPT, uri, timeout);
|
||||
}
|
||||
|
||||
function RecvResetZoom()
|
||||
{
|
||||
resetZoom();
|
||||
}
|
||||
|
||||
function SendAssertionCount(numAssertions)
|
||||
{
|
||||
sendAsyncMessage("reftest:AssertionCount", { count: numAssertions });
|
||||
}
|
||||
|
||||
function SendContentReady()
|
||||
{
|
||||
return sendSyncMessage("reftest:ContentReady")[0];
|
||||
}
|
||||
|
||||
function SendException(what)
|
||||
{
|
||||
sendAsyncMessage("reftest:Exception", { what: what });
|
||||
}
|
||||
|
||||
function SendFailedLoad(why)
|
||||
{
|
||||
sendAsyncMessage("reftest:FailedLoad", { why: why });
|
||||
}
|
||||
|
||||
// Return true if a snapshot was taken.
|
||||
function SendInitCanvasWithSnapshot()
|
||||
{
|
||||
// If we're in the same process as the top-level XUL window, then
|
||||
// drawing that window will also update our layers, so no
|
||||
// synchronization is needed.
|
||||
//
|
||||
// NB: this is a test-harness optimization only, it must not
|
||||
// affect the validity of the tests.
|
||||
if (gBrowserIsRemote) {
|
||||
SynchronizeForSnapshot();
|
||||
}
|
||||
|
||||
// For in-process browser, we have to make a synchronous request
|
||||
// here to make the above optimization valid, so that MozWaitPaint
|
||||
// events dispatched (synchronously) during painting are received
|
||||
// before we check the paint-wait counter. For out-of-process
|
||||
// browser though, it doesn't wrt correctness whether this request
|
||||
// is sync or async.
|
||||
var ret = sendSyncMessage("reftest:InitCanvasWithSnapshot")[0];
|
||||
|
||||
gHaveCanvasSnapshot = ret.painted;
|
||||
return ret.painted;
|
||||
}
|
||||
|
||||
function SendScriptResults(runtimeMs, error, results)
|
||||
{
|
||||
sendAsyncMessage("reftest:ScriptResults",
|
||||
{ runtimeMs: runtimeMs, error: error, results: results });
|
||||
}
|
||||
|
||||
function SendTestDone(runtimeMs)
|
||||
{
|
||||
sendAsyncMessage("reftest:TestDone", { runtimeMs: runtimeMs });
|
||||
}
|
||||
|
||||
function roundTo(x, fraction)
|
||||
{
|
||||
return Math.round(x/fraction)*fraction;
|
||||
}
|
||||
|
||||
function SendUpdateCanvasForEvent(event)
|
||||
{
|
||||
var win = content;
|
||||
var scale = markupDocumentViewer().fullZoom;
|
||||
|
||||
var rects = [ ];
|
||||
var rectList = event.clientRects;
|
||||
for (var i = 0; i < rectList.length; ++i) {
|
||||
var r = rectList[i];
|
||||
// Set left/top/right/bottom to "device pixel" boundaries
|
||||
var left = Math.floor(roundTo(r.left*scale, 0.001));
|
||||
var top = Math.floor(roundTo(r.top*scale, 0.001));
|
||||
var right = Math.ceil(roundTo(r.right*scale, 0.001));
|
||||
var bottom = Math.ceil(roundTo(r.bottom*scale, 0.001));
|
||||
|
||||
rects.push({ left: left, top: top, right: right, bottom: bottom });
|
||||
}
|
||||
|
||||
// See comments in SendInitCanvasWithSnapshot() re: the split
|
||||
// logic here.
|
||||
if (!gBrowserIsRemote) {
|
||||
sendSyncMessage("reftest:UpdateCanvasForInvalidation", { rects: rects });
|
||||
} else {
|
||||
SynchronizeForSnapshot();
|
||||
sendAsyncMessage("reftest:UpdateCanvasForInvalidation", { rects: rects });
|
||||
}
|
||||
}
|
||||
|
||||
addEventListener("load", OnInitialLoad, true);
|
@ -41,6 +41,7 @@ const CI = Components.interfaces;
|
||||
const CR = Components.results;
|
||||
|
||||
const XHTML_NS = "http://www.w3.org/1999/xhtml";
|
||||
const XUL_NS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
|
||||
|
||||
const NS_LOCAL_FILE_CONTRACTID = "@mozilla.org/file/local;1";
|
||||
const NS_GFXINFO_CONTRACTID = "@mozilla.org/gfx/info;1";
|
||||
@ -67,6 +68,9 @@ var gThisChunk = 0;
|
||||
const BLANK_URL_FOR_CLEARING = "data:text/html,%3C%21%2D%2DCLEAR%2D%2D%3E";
|
||||
|
||||
var gBrowser;
|
||||
// Are we testing web content loaded in a separate process?
|
||||
var gBrowserIsRemote; // bool
|
||||
var gBrowserMessageManager;
|
||||
var gCanvas1, gCanvas2;
|
||||
// gCurrentCanvas is non-null between InitCurrentCanvasWithSnapshot and the next
|
||||
// RecordResult.
|
||||
@ -96,18 +100,7 @@ var gTestResults = {
|
||||
};
|
||||
var gTotalTests = 0;
|
||||
var gState;
|
||||
// Plugin layers can be updated asynchronously, so to make sure that all
|
||||
// layer surfaces have the right content, we need to listen for explicit
|
||||
// "MozPaintWait" and "MozPaintWaitFinished" events that signal when it's OK
|
||||
// to take snapshots. We cannot take a snapshot while the number of
|
||||
// "MozPaintWait" events fired exceeds the number of "MozPaintWaitFinished"
|
||||
// events fired. We count the number of such excess events here. When
|
||||
// the counter reaches zero we call gExplicitPendingPaintsCompleteHook.
|
||||
var gExplicitPendingPaintCount = 0;
|
||||
var gExplicitPendingPaintsCompleteHook;
|
||||
var gCurrentURL;
|
||||
var gFailureTimeout = null;
|
||||
var gFailureReason;
|
||||
var gTestLog = [];
|
||||
var gServer;
|
||||
var gCount = 0;
|
||||
@ -117,10 +110,8 @@ var gIOService;
|
||||
var gDebug;
|
||||
var gWindowUtils;
|
||||
|
||||
var gCurrentTestStartTime;
|
||||
var gSlowestTestTime = 0;
|
||||
var gSlowestTestURL;
|
||||
var gClearingForAssertionCheck = false;
|
||||
|
||||
var gDrawWindowFlags;
|
||||
|
||||
@ -151,6 +142,10 @@ var gRecycledCanvases = new Array();
|
||||
// By default we just log to stdout
|
||||
var gDumpLog = dump;
|
||||
|
||||
// Only dump the sandbox once, because it doesn't depend on the
|
||||
// manifest URL (yet!).
|
||||
var gDumpedConditionSandbox = false;
|
||||
|
||||
function LogWarning(str)
|
||||
{
|
||||
gDumpLog("REFTEST INFO | " + str + "\n");
|
||||
@ -159,7 +154,7 @@ function LogWarning(str)
|
||||
|
||||
function LogInfo(str)
|
||||
{
|
||||
// gDumpLog("REFTEST INFO | " + str + "\n");
|
||||
// gDumpLog("REFTEST INFO | " + str + "\n");
|
||||
gTestLog.push(str);
|
||||
}
|
||||
|
||||
@ -202,30 +197,35 @@ function IDForEventTarget(event)
|
||||
}
|
||||
}
|
||||
|
||||
function PaintWaitListener(event)
|
||||
{
|
||||
LogInfo("MozPaintWait received for ID " + IDForEventTarget(event));
|
||||
gExplicitPendingPaintCount++;
|
||||
}
|
||||
|
||||
function PaintWaitFinishedListener(event)
|
||||
{
|
||||
LogInfo("MozPaintWaitFinished received for ID " + IDForEventTarget(event));
|
||||
gExplicitPendingPaintCount--;
|
||||
if (gExplicitPendingPaintCount < 0) {
|
||||
LogWarning("Underrun in gExplicitPendingPaintCount\n");
|
||||
gExplicitPendingPaintCount = 0;
|
||||
}
|
||||
if (gExplicitPendingPaintCount == 0 &&
|
||||
gExplicitPendingPaintsCompleteHook) {
|
||||
gExplicitPendingPaintsCompleteHook();
|
||||
}
|
||||
}
|
||||
|
||||
function OnRefTestLoad()
|
||||
{
|
||||
gBrowser = document.getElementById("browser");
|
||||
var prefs = Components.classes["@mozilla.org/preferences-service;1"].
|
||||
getService(Components.interfaces.nsIPrefBranch2);
|
||||
try {
|
||||
gBrowserIsRemote = prefs.getBoolPref("browser.tabs.remote");
|
||||
} catch (e) {
|
||||
gBrowserIsRemote = false;
|
||||
}
|
||||
|
||||
gBrowser = document.createElementNS(XUL_NS, "xul:browser");
|
||||
gBrowser.setAttribute("id", "browser");
|
||||
gBrowser.setAttribute("type", "content-primary");
|
||||
gBrowser.setAttribute("remote", gBrowserIsRemote ? "true" : "false");
|
||||
// Make sure the browser element is exactly 800x1000, no matter
|
||||
// what size our window is
|
||||
gBrowser.setAttribute("style", "min-width: 800px; min-height: 1000px; max-width: 800px; max-height: 1000px");
|
||||
|
||||
document.getElementById("reftest-window").appendChild(gBrowser);
|
||||
|
||||
gBrowserMessageManager = gBrowser.QueryInterface(CI.nsIFrameLoaderOwner)
|
||||
.frameLoader.messageManager;
|
||||
// The content script waits for the initial onload, then notifies
|
||||
// us.
|
||||
RegisterMessageListenersAndLoadContentScript();
|
||||
}
|
||||
|
||||
function InitAndStartRefTests()
|
||||
{
|
||||
/* set the gLoadTimeout */
|
||||
try {
|
||||
var prefs = Components.classes["@mozilla.org/preferences-service;1"].
|
||||
@ -260,8 +260,6 @@ function OnRefTestLoad()
|
||||
gThisChunk = 0;
|
||||
}
|
||||
|
||||
gBrowser.addEventListener("load", OnDocumentLoad, true);
|
||||
|
||||
try {
|
||||
gWindowUtils = window.QueryInterface(CI.nsIInterfaceRequestor).getInterface(CI.nsIDOMWindowUtils);
|
||||
if (gWindowUtils && !gWindowUtils.compareCanvases)
|
||||
@ -294,10 +292,6 @@ function OnRefTestLoad()
|
||||
// Focus the content browser
|
||||
gBrowser.focus();
|
||||
|
||||
// Connect to async rendering notifications
|
||||
gBrowser.addEventListener("MozPaintWait", PaintWaitListener, true);
|
||||
gBrowser.addEventListener("MozPaintWaitFinished", PaintWaitFinishedListener, true);
|
||||
|
||||
StartTests();
|
||||
}
|
||||
|
||||
@ -359,7 +353,6 @@ function StartTests()
|
||||
|
||||
function OnRefTestUnload()
|
||||
{
|
||||
gBrowser.removeEventListener("load", OnDocumentLoad, true);
|
||||
MozillaFileLogger.close();
|
||||
}
|
||||
|
||||
@ -397,7 +390,7 @@ function BuildConditionSandbox(aURL) {
|
||||
|
||||
try {
|
||||
// nsIGfxInfo is currently only implemented on Windows
|
||||
sandbox.d2d = CC[NS_GFXINFO_CONTRACTID].getService(CI.nsIGfxInfo).D2DEnabled;
|
||||
sandbox.d2d = (NS_GFXINFO_CONTRACTID in CC) && CC[NS_GFXINFO_CONTRACTID].getService(CI.nsIGfxInfo).D2DEnabled;
|
||||
} catch(e) {
|
||||
sandbox.d2d = false;
|
||||
}
|
||||
@ -492,8 +485,15 @@ function BuildConditionSandbox(aURL) {
|
||||
return testPluginIsOOP;
|
||||
};
|
||||
|
||||
gDumpLog("REFTEST INFO | Dumping JSON representation of sandbox \n");
|
||||
gDumpLog("REFTEST INFO | " + JSON.stringify(sandbox) + " \n");
|
||||
// Tests shouldn't care about this except for when they need to
|
||||
// crash the content process
|
||||
sandbox.browserIsRemote = gBrowserIsRemote;
|
||||
|
||||
if (!gDumpedConditionSandbox) {
|
||||
dump("REFTEST INFO | Dumping JSON representation of sandbox \n");
|
||||
dump("REFTEST INFO | " + JSON.stringify(sandbox) + " \n");
|
||||
gDumpedConditionSandbox = true;
|
||||
}
|
||||
|
||||
return sandbox;
|
||||
}
|
||||
@ -555,8 +555,9 @@ function ReadManifest(aURL)
|
||||
var allow_silent_fail = false;
|
||||
var minAsserts = 0;
|
||||
var maxAsserts = 0;
|
||||
var needs_focus = false;
|
||||
var slow = false;
|
||||
while (items[0].match(/^(fails|random|skip|asserts|slow|silentfail)/)) {
|
||||
while (items[0].match(/^(fails|needs-focus|random|skip|asserts|slow|silentfail)/)) {
|
||||
var item = items.shift();
|
||||
var stat;
|
||||
var cond;
|
||||
@ -568,6 +569,8 @@ function ReadManifest(aURL)
|
||||
} else if (item.match(/^(fails|random|skip)$/)) {
|
||||
stat = item;
|
||||
cond = true;
|
||||
} else if (item == "needs-focus") {
|
||||
needs_focus = true;
|
||||
} else if ((m = item.match(/^asserts\((\d+)(-\d+)?\)$/))) {
|
||||
cond = false;
|
||||
minAsserts = Number(m[1]);
|
||||
@ -665,6 +668,7 @@ function ReadManifest(aURL)
|
||||
prettyPath: prettyPath,
|
||||
minAsserts: minAsserts,
|
||||
maxAsserts: maxAsserts,
|
||||
needsFocus: needs_focus,
|
||||
slow: slow,
|
||||
url1: testURI,
|
||||
url2: null } );
|
||||
@ -686,6 +690,7 @@ function ReadManifest(aURL)
|
||||
prettyPath: prettyPath,
|
||||
minAsserts: minAsserts,
|
||||
maxAsserts: maxAsserts,
|
||||
needsFocus: needs_focus,
|
||||
slow: slow,
|
||||
url1: testURI,
|
||||
url2: null } );
|
||||
@ -710,6 +715,7 @@ function ReadManifest(aURL)
|
||||
prettyPath: prettyPath,
|
||||
minAsserts: minAsserts,
|
||||
maxAsserts: maxAsserts,
|
||||
needsFocus: needs_focus,
|
||||
slow: slow,
|
||||
url1: testURI,
|
||||
url2: refURI } );
|
||||
@ -787,6 +793,26 @@ function ServeFiles(manifestURL, depth, aURL, files)
|
||||
return files.map(FileToURI);
|
||||
}
|
||||
|
||||
// Return true iff this window is focused when this function returns.
|
||||
function Focus()
|
||||
{
|
||||
// FIXME/bug 583976: focus doesn't yet work with out-of-process
|
||||
// content.
|
||||
if (gBrowserIsRemote) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// FIXME/bug 623625: determine if the window is focused and/or try
|
||||
// to acquire focus if it's not.
|
||||
//
|
||||
// NB: we can't add anything here that would return false on
|
||||
// tinderbox, otherwise we could lose testing coverage due to
|
||||
// problems on the test machines. We might want a require-focus
|
||||
// mode, defaulting to false for developers, but that's true on
|
||||
// tinderbox.
|
||||
return true;
|
||||
}
|
||||
|
||||
function StartCurrentTest()
|
||||
{
|
||||
gTestLog = [];
|
||||
@ -798,6 +824,10 @@ function StartCurrentTest()
|
||||
++gTestResults.Skip;
|
||||
gDumpLog("REFTEST TEST-KNOWN-FAIL | " + test.url1.spec + " | (SKIP)\n");
|
||||
gURLs.shift();
|
||||
} else if (test.needsFocus && !Focus()) {
|
||||
++gTestResults.Skip;
|
||||
gDumpLog("REFTEST TEST-KNOWN-FAIL | " + test.url1.spec + " | (SKIPPED; COULDN'T GET FOCUS)\n");
|
||||
gURLs.shift();
|
||||
} else if (test.slow && !gRunSlowTests) {
|
||||
++gTestResults.Slow;
|
||||
gDumpLog("REFTEST TEST-KNOWN-SLOW | " + test.url1.spec + " | (SLOW)\n");
|
||||
@ -820,24 +850,8 @@ function StartCurrentTest()
|
||||
|
||||
function StartCurrentURI(aState)
|
||||
{
|
||||
gCurrentTestStartTime = Date.now();
|
||||
if (gFailureTimeout != null) {
|
||||
gDumpLog("REFTEST TEST-UNEXPECTED-FAIL | " +
|
||||
"| program error managing timeouts\n");
|
||||
++gTestResults.Exception;
|
||||
}
|
||||
gFailureTimeout = setTimeout(LoadFailed, gLoadTimeout);
|
||||
gFailureReason = "timed out waiting for onload to fire";
|
||||
|
||||
gState = aState;
|
||||
gCurrentURL = gURLs[0]["url" + aState].spec;
|
||||
// Reset gExplicitPendingPaintCount in case there was a timeout or
|
||||
// the count is out of sync for some other reason
|
||||
if (gExplicitPendingPaintCount != 0) {
|
||||
LogWarning("Resetting gExplicitPendingPaintCount to zero (currently " +
|
||||
gExplicitPendingPaintCount + "\n");
|
||||
gExplicitPendingPaintCount = 0;
|
||||
}
|
||||
|
||||
if (gURICanvases[gCurrentURL] &&
|
||||
(gURLs[0].type == TYPE_REFTEST_EQUAL ||
|
||||
@ -849,7 +863,12 @@ function StartCurrentURI(aState)
|
||||
} else {
|
||||
gDumpLog("REFTEST TEST-START | " + gCurrentURL + "\n");
|
||||
LogInfo("START " + gCurrentURL);
|
||||
gBrowser.loadURI(gCurrentURL);
|
||||
var type = gURLs[0].type
|
||||
if (TYPE_SCRIPT == type) {
|
||||
SendLoadScriptTest(gCurrentURL, gLoadTimeout);
|
||||
} else {
|
||||
SendLoadTest(type, gCurrentURL, gLoadTimeout);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -895,330 +914,6 @@ function DoneTests()
|
||||
onStopped();
|
||||
}
|
||||
|
||||
function setupZoom(contentRootElement) {
|
||||
if (!contentRootElement || !contentRootElement.hasAttribute('reftest-zoom'))
|
||||
return;
|
||||
gBrowser.markupDocumentViewer.fullZoom =
|
||||
contentRootElement.getAttribute('reftest-zoom');
|
||||
}
|
||||
|
||||
function resetZoom() {
|
||||
gBrowser.markupDocumentViewer.fullZoom = 1.0;
|
||||
}
|
||||
|
||||
function doPrintMode(contentRootElement) {
|
||||
// use getAttribute because className works differently in HTML and SVG
|
||||
return contentRootElement &&
|
||||
contentRootElement.hasAttribute('class') &&
|
||||
contentRootElement.getAttribute('class').split(/\s+/)
|
||||
.indexOf("reftest-print") != -1;
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
function shouldWaitForExplicitPaintWaiters() {
|
||||
return gExplicitPendingPaintCount > 0;
|
||||
}
|
||||
|
||||
function shouldWaitForPendingPaints() {
|
||||
// if gCurrentCanvas is null, we're not taking snapshots so there is
|
||||
// no need to wait for pending paints to be flushed.
|
||||
return gCurrentCanvas && gWindowUtils.isMozAfterPaintPending;
|
||||
}
|
||||
|
||||
function shouldWaitForReftestWaitRemoval(contentRootElement) {
|
||||
// use getAttribute because className works differently in HTML and SVG
|
||||
return contentRootElement &&
|
||||
contentRootElement.hasAttribute('class') &&
|
||||
contentRootElement.getAttribute('class').split(/\s+/)
|
||||
.indexOf("reftest-wait") != -1;
|
||||
}
|
||||
|
||||
// Initial state. When the document has loaded and all MozAfterPaint events and
|
||||
// all explicit paint waits are flushed, we can fire the MozReftestInvalidate
|
||||
// event and move to the next state.
|
||||
const STATE_WAITING_TO_FIRE_INVALIDATE_EVENT = 0;
|
||||
// When reftest-wait has been removed from the root element, we can move to the
|
||||
// next state.
|
||||
const STATE_WAITING_FOR_REFTEST_WAIT_REMOVAL = 1;
|
||||
// When all MozAfterPaint events and all explicit paint waits are flushed, we're
|
||||
// done and can move to the COMPLETED state.
|
||||
const STATE_WAITING_TO_FINISH = 2;
|
||||
const STATE_COMPLETED = 3;
|
||||
|
||||
function WaitForTestEnd(contentRootElement, inPrintMode) {
|
||||
var stopAfterPaintReceived = false;
|
||||
var state = STATE_WAITING_TO_FIRE_INVALIDATE_EVENT;
|
||||
|
||||
function FlushRendering() {
|
||||
var anyPendingPaintsGeneratedInDescendants = false;
|
||||
|
||||
function flushWindow(win) {
|
||||
var utils = win.QueryInterface(CI.nsIInterfaceRequestor)
|
||||
.getInterface(CI.nsIDOMWindowUtils);
|
||||
var afterPaintWasPending = utils.isMozAfterPaintPending;
|
||||
|
||||
try {
|
||||
// Flush pending restyles and reflows for this window
|
||||
win.document.documentElement.getBoundingClientRect();
|
||||
} catch (e) {
|
||||
LogWarning("flushWindow failed: " + e + "\n");
|
||||
}
|
||||
|
||||
if (!afterPaintWasPending && utils.isMozAfterPaintPending) {
|
||||
LogInfo("FlushRendering generated paint for window " + win.location.href);
|
||||
anyPendingPaintsGeneratedInDescendants = true;
|
||||
}
|
||||
|
||||
for (var i = 0; i < win.frames.length; ++i) {
|
||||
flushWindow(win.frames[i]);
|
||||
}
|
||||
}
|
||||
|
||||
flushWindow(gBrowser.contentWindow);
|
||||
|
||||
if (anyPendingPaintsGeneratedInDescendants &&
|
||||
!gWindowUtils.isMozAfterPaintPending) {
|
||||
LogWarning("Internal error: descendant frame generated a MozAfterPaint event, but the root document doesn't have one!");
|
||||
}
|
||||
}
|
||||
|
||||
function AfterPaintListener(event) {
|
||||
LogInfo("AfterPaintListener in " + event.target.document.location.href);
|
||||
if (event.target.document != document) {
|
||||
// ignore paint events for subframes or old documents in the window.
|
||||
// Invalidation in subframes will cause invalidation in the toplevel document anyway.
|
||||
return;
|
||||
}
|
||||
UpdateCurrentCanvasForEvent(event);
|
||||
// These events are fired immediately after a paint. Don't
|
||||
// confuse ourselves by firing synchronously if we triggered the
|
||||
// paint ourselves.
|
||||
setTimeout(MakeProgress, 0);
|
||||
}
|
||||
|
||||
function AttrModifiedListener() {
|
||||
LogInfo("AttrModifiedListener fired");
|
||||
// Wait for the next return-to-event-loop before continuing --- for
|
||||
// example, the attribute may have been modified in an subdocument's
|
||||
// load event handler, in which case we need load event processing
|
||||
// to complete and unsuppress painting before we check isMozAfterPaintPending.
|
||||
setTimeout(MakeProgress, 0);
|
||||
}
|
||||
|
||||
function ExplicitPaintsCompleteListener() {
|
||||
LogInfo("ExplicitPaintsCompleteListener fired");
|
||||
// Since this can fire while painting, don't confuse ourselves by
|
||||
// firing synchronously. It's fine to do this asynchronously.
|
||||
setTimeout(MakeProgress, 0);
|
||||
}
|
||||
|
||||
function RemoveListeners() {
|
||||
// OK, we can end the test now.
|
||||
window.removeEventListener("MozAfterPaint", AfterPaintListener, false);
|
||||
if (contentRootElement) {
|
||||
contentRootElement.removeEventListener("DOMAttrModified", AttrModifiedListener, false);
|
||||
}
|
||||
gExplicitPendingPaintsCompleteHook = null;
|
||||
gTimeoutHook = null;
|
||||
// Make sure we're in the COMPLETED state just in case
|
||||
// (this may be called via the test-timeout hook)
|
||||
state = STATE_COMPLETED;
|
||||
}
|
||||
|
||||
// Everything that could cause shouldWaitForXXX() to
|
||||
// change from returning true to returning false is monitored via some kind
|
||||
// of event listener which eventually calls this function.
|
||||
function MakeProgress() {
|
||||
if (state >= STATE_COMPLETED) {
|
||||
LogInfo("MakeProgress: STATE_COMPLETED");
|
||||
return;
|
||||
}
|
||||
|
||||
FlushRendering();
|
||||
|
||||
switch (state) {
|
||||
case STATE_WAITING_TO_FIRE_INVALIDATE_EVENT: {
|
||||
LogInfo("MakeProgress: STATE_WAITING_TO_FIRE_INVALIDATE_EVENT");
|
||||
if (shouldWaitForExplicitPaintWaiters() || shouldWaitForPendingPaints()) {
|
||||
gFailureReason = "timed out waiting for pending paint count to reach zero";
|
||||
if (shouldWaitForExplicitPaintWaiters()) {
|
||||
gFailureReason += " (waiting for MozPaintWaitFinished)";
|
||||
LogInfo("MakeProgress: waiting for MozPaintWaitFinished");
|
||||
}
|
||||
if (shouldWaitForPendingPaints()) {
|
||||
gFailureReason += " (waiting for MozAfterPaint)";
|
||||
LogInfo("MakeProgress: waiting for MozAfterPaint");
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
state = STATE_WAITING_FOR_REFTEST_WAIT_REMOVAL;
|
||||
var hasReftestWait = shouldWaitForReftestWaitRemoval(contentRootElement);
|
||||
// Notify the test document that now is a good time to test some invalidation
|
||||
if (contentRootElement) {
|
||||
var notification = document.createEvent("Events");
|
||||
notification.initEvent("MozReftestInvalidate", true, false);
|
||||
contentRootElement.dispatchEvent(notification);
|
||||
}
|
||||
if (hasReftestWait && !shouldWaitForReftestWaitRemoval(contentRootElement)) {
|
||||
// MozReftestInvalidate handler removed reftest-wait.
|
||||
// We expect something to have been invalidated...
|
||||
FlushRendering();
|
||||
if (!shouldWaitForPendingPaints() && !shouldWaitForExplicitPaintWaiters()) {
|
||||
LogWarning("MozInvalidateEvent didn't invalidate");
|
||||
}
|
||||
}
|
||||
// Try next state
|
||||
MakeProgress();
|
||||
return;
|
||||
}
|
||||
|
||||
case STATE_WAITING_FOR_REFTEST_WAIT_REMOVAL:
|
||||
LogInfo("MakeProgress: STATE_WAITING_FOR_REFTEST_WAIT_REMOVAL");
|
||||
if (shouldWaitForReftestWaitRemoval(contentRootElement)) {
|
||||
gFailureReason = "timed out waiting for reftest-wait to be removed";
|
||||
LogInfo("MakeProgress: waiting for reftest-wait to be removed");
|
||||
return;
|
||||
}
|
||||
state = STATE_WAITING_TO_FINISH;
|
||||
if (!inPrintMode && doPrintMode(contentRootElement)) {
|
||||
LogInfo("MakeProgress: setting up print mode");
|
||||
setupPrintMode();
|
||||
}
|
||||
// Try next state
|
||||
MakeProgress();
|
||||
return;
|
||||
|
||||
case STATE_WAITING_TO_FINISH:
|
||||
LogInfo("MakeProgress: STATE_WAITING_TO_FINISH");
|
||||
if (shouldWaitForExplicitPaintWaiters() || shouldWaitForPendingPaints()) {
|
||||
gFailureReason = "timed out waiting for pending paint count to " +
|
||||
"reach zero (after reftest-wait removed and switch to print mode)";
|
||||
if (shouldWaitForExplicitPaintWaiters()) {
|
||||
gFailureReason += " (waiting for MozPaintWaitFinished)";
|
||||
LogInfo("MakeProgress: waiting for MozPaintWaitFinished");
|
||||
}
|
||||
if (shouldWaitForPendingPaints()) {
|
||||
gFailureReason += " (waiting for MozAfterPaint)";
|
||||
LogInfo("MakeProgress: waiting for MozAfterPaint");
|
||||
}
|
||||
return;
|
||||
}
|
||||
LogInfo("MakeProgress: Completed");
|
||||
state = STATE_COMPLETED;
|
||||
gFailureReason = "timed out while taking snapshot (bug in harness?)";
|
||||
RemoveListeners();
|
||||
setTimeout(RecordResult, 0);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
LogInfo("WaitForTestEnd: Adding listeners");
|
||||
window.addEventListener("MozAfterPaint", AfterPaintListener, false);
|
||||
// If contentRootElement is null then shouldWaitForReftestWaitRemoval will
|
||||
// always return false so we don't need a listener anyway
|
||||
if (contentRootElement) {
|
||||
contentRootElement.addEventListener("DOMAttrModified", AttrModifiedListener, false);
|
||||
}
|
||||
gExplicitPendingPaintsCompleteHook = ExplicitPaintsCompleteListener;
|
||||
gTimeoutHook = RemoveListeners;
|
||||
|
||||
// Take a full snapshot now that all our listeners are set up. This
|
||||
// ensures it's impossible for us to miss updates between taking the snapshot
|
||||
// and adding our listeners.
|
||||
InitCurrentCanvasWithSnapshot();
|
||||
MakeProgress();
|
||||
}
|
||||
|
||||
function OnDocumentLoad(event)
|
||||
{
|
||||
var currentDoc = gBrowser.contentDocument;
|
||||
if (event.target != currentDoc)
|
||||
// Ignore load events for subframes.
|
||||
return;
|
||||
|
||||
if (gClearingForAssertionCheck &&
|
||||
currentDoc.location.href == BLANK_URL_FOR_CLEARING) {
|
||||
DoAssertionCheck();
|
||||
return;
|
||||
}
|
||||
|
||||
if (currentDoc.location.href != gCurrentURL) {
|
||||
LogInfo("OnDocumentLoad fired for previous document");
|
||||
// Ignore load events for previous documents.
|
||||
return;
|
||||
}
|
||||
|
||||
var contentRootElement = currentDoc ? currentDoc.documentElement : null;
|
||||
setupZoom(contentRootElement);
|
||||
var inPrintMode = false;
|
||||
|
||||
function AfterOnLoadScripts() {
|
||||
// Take a snapshot now. We need to do this before we check whether
|
||||
// we should wait, since this might trigger dispatching of
|
||||
// MozPaintWait events and make shouldWaitForExplicitPaintWaiters() true
|
||||
// below.
|
||||
var painted = InitCurrentCanvasWithSnapshot();
|
||||
|
||||
if (shouldWaitForExplicitPaintWaiters() ||
|
||||
(!inPrintMode && doPrintMode(contentRootElement)) ||
|
||||
// If we didn't force a paint above, in
|
||||
// InitCurrentCanvasWithSnapshot, so we should wait for a
|
||||
// paint before we consider them done.
|
||||
!painted) {
|
||||
LogInfo("AfterOnLoadScripts belatedly entering WaitForTestEnd");
|
||||
// Go into reftest-wait mode belatedly.
|
||||
WaitForTestEnd(contentRootElement, inPrintMode);
|
||||
} else {
|
||||
RecordResult();
|
||||
}
|
||||
}
|
||||
|
||||
if (shouldWaitForReftestWaitRemoval(contentRootElement) ||
|
||||
shouldWaitForExplicitPaintWaiters()) {
|
||||
// Go into reftest-wait mode immediately after painting has been
|
||||
// unsuppressed, after the onload event has finished dispatching.
|
||||
gFailureReason = "timed out waiting for test to complete (trying to get into WaitForTestEnd)";
|
||||
LogInfo("OnDocumentLoad triggering WaitForTestEnd");
|
||||
setTimeout(WaitForTestEnd, 0, contentRootElement, inPrintMode);
|
||||
} else {
|
||||
if (doPrintMode(contentRootElement)) {
|
||||
LogInfo("OnDocumentLoad setting up print mode");
|
||||
setupPrintMode();
|
||||
inPrintMode = true;
|
||||
}
|
||||
|
||||
// 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.
|
||||
gFailureReason = "timed out waiting for test to complete (waiting for onload scripts to complete)";
|
||||
LogInfo("OnDocumentLoad triggering AfterOnLoadScripts");
|
||||
setTimeout(setTimeout, 0, AfterOnLoadScripts, 0);
|
||||
}
|
||||
}
|
||||
|
||||
function UpdateCanvasCache(url, canvas)
|
||||
{
|
||||
var spec = url.spec;
|
||||
@ -1252,6 +947,9 @@ function DoDrawWindow(ctx, x, y, w, h)
|
||||
// because the window is big enough to display the entire
|
||||
// browser element
|
||||
flags |= ctx.DRAWWINDOW_USE_WIDGET_LAYERS;
|
||||
} else if (gBrowserIsRemote) {
|
||||
gDumpLog("REFTEST TEST-UNEXPECTED-FAIL | | can't drawWindow remote content\n");
|
||||
++gTestResults.Exception;
|
||||
}
|
||||
|
||||
if (gDrawWindowFlags != flags) {
|
||||
@ -1278,6 +976,8 @@ function DoDrawWindow(ctx, x, y, w, h)
|
||||
|
||||
function InitCurrentCanvasWithSnapshot()
|
||||
{
|
||||
LogInfo("Initializing canvas snapshot");
|
||||
|
||||
if (gURLs[0].type == TYPE_LOAD || gURLs[0].type == TYPE_SCRIPT) {
|
||||
// We don't want to snapshot this kind of test
|
||||
return false;
|
||||
@ -1292,20 +992,17 @@ function InitCurrentCanvasWithSnapshot()
|
||||
return true;
|
||||
}
|
||||
|
||||
function roundTo(x, fraction)
|
||||
function UpdateCurrentCanvasForInvalidation(rects)
|
||||
{
|
||||
return Math.round(x/fraction)*fraction;
|
||||
}
|
||||
LogInfo("Updating canvas for invalidation");
|
||||
|
||||
function UpdateCurrentCanvasForEvent(event)
|
||||
{
|
||||
if (!gCurrentCanvas)
|
||||
if (!gCurrentCanvas) {
|
||||
return;
|
||||
}
|
||||
|
||||
var ctx = gCurrentCanvas.getContext("2d");
|
||||
var rectList = event.clientRects;
|
||||
for (var i = 0; i < rectList.length; ++i) {
|
||||
var r = rectList[i];
|
||||
for (var i = 0; i < rects.length; ++i) {
|
||||
var r = rects[i];
|
||||
// Set left/top/right/bottom to pixel boundaries
|
||||
var left = Math.floor(r.left);
|
||||
var top = Math.floor(r.top);
|
||||
@ -1319,21 +1016,16 @@ function UpdateCurrentCanvasForEvent(event)
|
||||
}
|
||||
}
|
||||
|
||||
function RecordResult()
|
||||
function RecordResult(testRunTime, errorMsg, scriptResults)
|
||||
{
|
||||
LogInfo("RecordResult fired");
|
||||
|
||||
// Keep track of which test was slowest, and how long it took.
|
||||
var currentTestRunTime = Date.now() - gCurrentTestStartTime;
|
||||
if (currentTestRunTime > gSlowestTestTime) {
|
||||
gSlowestTestTime = currentTestRunTime;
|
||||
if (testRunTime > gSlowestTestTime) {
|
||||
gSlowestTestTime = testRunTime;
|
||||
gSlowestTestURL = gCurrentURL;
|
||||
}
|
||||
|
||||
clearTimeout(gFailureTimeout);
|
||||
gFailureReason = null;
|
||||
gFailureTimeout = null;
|
||||
|
||||
// Not 'const ...' because of 'EXPECTED_*' value dependency.
|
||||
var outputs = {};
|
||||
const randomMsg = "(EXPECTED RANDOM)";
|
||||
@ -1359,51 +1051,34 @@ function RecordResult()
|
||||
return;
|
||||
}
|
||||
if (gURLs[0].type == TYPE_SCRIPT) {
|
||||
var missing_msg = false;
|
||||
var testwindow = gBrowser.contentWindow;
|
||||
expected = gURLs[0].expected;
|
||||
var expected = gURLs[0].expected;
|
||||
|
||||
if (testwindow.wrappedJSObject)
|
||||
testwindow = testwindow.wrappedJSObject;
|
||||
|
||||
var testcases;
|
||||
|
||||
if (!testwindow.getTestCases || typeof testwindow.getTestCases != "function") {
|
||||
if (errorMsg) {
|
||||
// Force an unexpected failure to alert the test author to fix the test.
|
||||
expected = EXPECTED_PASS;
|
||||
missing_msg = "test must provide a function getTestCases(). (SCRIPT)\n";
|
||||
}
|
||||
else if (!(testcases = testwindow.getTestCases())) {
|
||||
// Force an unexpected failure to alert the test author to fix the test.
|
||||
expected = EXPECTED_PASS;
|
||||
missing_msg = "test's getTestCases() must return an Array-like Object. (SCRIPT)\n";
|
||||
}
|
||||
else if (testcases.length == 0) {
|
||||
// This failure may be due to a JavaScript Engine bug causing
|
||||
// early termination of the test. If we do not allow silent
|
||||
// failure, report an error.
|
||||
if (!gURLs[0].allowSilentFail)
|
||||
missing_msg = "No test results reported. (SCRIPT)\n";
|
||||
else
|
||||
gDumpLog("REFTEST INFO | An expected silent failure occurred \n");
|
||||
} else if (scriptResults.length == 0) {
|
||||
// This failure may be due to a JavaScript Engine bug causing
|
||||
// early termination of the test. If we do not allow silent
|
||||
// failure, report an error.
|
||||
if (!gURLs[0].allowSilentFail)
|
||||
errorMsg = "No test results reported. (SCRIPT)\n";
|
||||
else
|
||||
gDumpLog("REFTEST INFO | An expected silent failure occurred \n");
|
||||
}
|
||||
|
||||
if (missing_msg) {
|
||||
if (errorMsg) {
|
||||
output = outputs[expected][false];
|
||||
++gTestResults[output.n];
|
||||
var result = "REFTEST " + output.s + " | " +
|
||||
gURLs[0].prettyPath + " | " + // the URL being tested
|
||||
missing_msg;
|
||||
errorMsg;
|
||||
|
||||
gDumpLog(result);
|
||||
FinishTestItem();
|
||||
return;
|
||||
}
|
||||
|
||||
var results = testcases.map(function(test) {
|
||||
return { passed: test.testPassed(), description: test.testDescription()};
|
||||
});
|
||||
var anyFailed = results.some(function(result) { return !result.passed; });
|
||||
var anyFailed = scriptResults.some(function(result) { return !result.passed; });
|
||||
var outputPair;
|
||||
if (anyFailed && expected == EXPECTED_FAIL) {
|
||||
// If we're marked as expected to fail, and some (but not all) tests
|
||||
@ -1416,7 +1091,7 @@ function RecordResult()
|
||||
outputPair = outputs[expected];
|
||||
}
|
||||
var index = 0;
|
||||
results.forEach(function(result) {
|
||||
scriptResults.forEach(function(result) {
|
||||
var output = outputPair[result.passed];
|
||||
|
||||
++gTestResults[output.n];
|
||||
@ -1437,6 +1112,10 @@ function RecordResult()
|
||||
if (gURICanvases[gCurrentURL]) {
|
||||
gCurrentCanvas = gURICanvases[gCurrentURL];
|
||||
}
|
||||
if (gCurrentCanvas == null) {
|
||||
gDumpLog("REFTEST TEST-UNEXPECTED-FAIL | | program error managing snapshots\n");
|
||||
++gTestResults.Exception;
|
||||
}
|
||||
if (gState == 1) {
|
||||
gCanvas1 = gCurrentCanvas;
|
||||
} else {
|
||||
@ -1444,7 +1123,7 @@ function RecordResult()
|
||||
}
|
||||
gCurrentCanvas = null;
|
||||
|
||||
resetZoom();
|
||||
SendResetZoom();
|
||||
|
||||
switch (gState) {
|
||||
case 1:
|
||||
@ -1518,15 +1197,11 @@ function RecordResult()
|
||||
}
|
||||
}
|
||||
|
||||
function LoadFailed()
|
||||
function LoadFailed(why)
|
||||
{
|
||||
if (gTimeoutHook) {
|
||||
gTimeoutHook();
|
||||
}
|
||||
gFailureTimeout = null;
|
||||
++gTestResults.FailedLoad;
|
||||
gDumpLog("REFTEST TEST-UNEXPECTED-FAIL | " +
|
||||
gURLs[0]["url" + gState].spec + " | " + gFailureReason + "\n");
|
||||
gURLs[0]["url" + gState].spec + " | " + why + "\n");
|
||||
FlushTestLog();
|
||||
FinishTestItem();
|
||||
}
|
||||
@ -1536,18 +1211,23 @@ function FinishTestItem()
|
||||
// Replace document with BLANK_URL_FOR_CLEARING in case there are
|
||||
// assertions when unloading.
|
||||
gDumpLog("REFTEST INFO | Loading a blank page\n");
|
||||
gClearingForAssertionCheck = true;
|
||||
gBrowser.loadURI(BLANK_URL_FOR_CLEARING);
|
||||
// After clearing, content will notify us of the assertion count
|
||||
// and tests will continue.
|
||||
SendClear();
|
||||
}
|
||||
|
||||
function DoAssertionCheck()
|
||||
function DoAssertionCheck(numAsserts)
|
||||
{
|
||||
gClearingForAssertionCheck = false;
|
||||
|
||||
if (gDebug.isDebugBuild) {
|
||||
var newAssertionCount = gDebug.assertionCount;
|
||||
var numAsserts = newAssertionCount - gAssertionCount;
|
||||
gAssertionCount = newAssertionCount;
|
||||
if (gBrowserIsRemote) {
|
||||
// Count chrome-process asserts too when content is out of
|
||||
// process.
|
||||
var newAssertionCount = gDebug.assertionCount;
|
||||
var numLocalAsserts = newAssertionCount - gAssertionCount;
|
||||
gAssertionCount = newAssertionCount;
|
||||
|
||||
numAsserts += numLocalAsserts;
|
||||
}
|
||||
|
||||
var minAsserts = gURLs[0].minAsserts;
|
||||
var maxAsserts = gURLs[0].maxAsserts;
|
||||
@ -1580,3 +1260,125 @@ function DoAssertionCheck()
|
||||
gURLs.shift();
|
||||
StartCurrentTest();
|
||||
}
|
||||
|
||||
|
||||
function RegisterMessageListenersAndLoadContentScript()
|
||||
{
|
||||
gBrowserMessageManager.addMessageListener(
|
||||
"reftest:AssertionCount",
|
||||
function (m) { RecvAssertionCount(m.json.count); }
|
||||
);
|
||||
gBrowserMessageManager.addMessageListener(
|
||||
"reftest:ContentReady",
|
||||
function (m) { return RecvContentReady() }
|
||||
);
|
||||
gBrowserMessageManager.addMessageListener(
|
||||
"reftest:Exception",
|
||||
function (m) { RecvException(m.json.what) }
|
||||
);
|
||||
gBrowserMessageManager.addMessageListener(
|
||||
"reftest:FailedLoad",
|
||||
function (m) { RecvFailedLoad(m.json.why); }
|
||||
);
|
||||
gBrowserMessageManager.addMessageListener(
|
||||
"reftest:InitCanvasWithSnapshot",
|
||||
function (m) { return RecvInitCanvasWithSnapshot(); }
|
||||
);
|
||||
gBrowserMessageManager.addMessageListener(
|
||||
"reftest:Log",
|
||||
function (m) { RecvLog(m.json.type, m.json.msg); }
|
||||
);
|
||||
gBrowserMessageManager.addMessageListener(
|
||||
"reftest:ScriptResults",
|
||||
function (m) { RecvScriptResults(m.json.runtimeMs, m.json.error, m.json.results); }
|
||||
);
|
||||
gBrowserMessageManager.addMessageListener(
|
||||
"reftest:TestDone",
|
||||
function (m) { RecvTestDone(m.json.runtimeMs); }
|
||||
);
|
||||
gBrowserMessageManager.addMessageListener(
|
||||
"reftest:UpdateCanvasForInvalidation",
|
||||
function (m) { RecvUpdateCanvasForInvalidation(m.json.rects); }
|
||||
);
|
||||
|
||||
gBrowserMessageManager.loadFrameScript("chrome://reftest/content/reftest-content.js", true);
|
||||
}
|
||||
|
||||
function RecvAssertionCount(count)
|
||||
{
|
||||
DoAssertionCheck(count);
|
||||
}
|
||||
|
||||
function RecvContentReady()
|
||||
{
|
||||
InitAndStartRefTests();
|
||||
return { remote: gBrowserIsRemote };
|
||||
}
|
||||
|
||||
function RecvException(what)
|
||||
{
|
||||
gDumpLog("REFTEST TEST-UNEXPECTED-FAIL | | "+ what +"\n");
|
||||
++gTestResults.Exception;
|
||||
}
|
||||
|
||||
function RecvFailedLoad(why)
|
||||
{
|
||||
LoadFailed(why);
|
||||
}
|
||||
|
||||
function RecvInitCanvasWithSnapshot()
|
||||
{
|
||||
var painted = InitCurrentCanvasWithSnapshot();
|
||||
return { painted: painted };
|
||||
}
|
||||
|
||||
function RecvLog(type, msg)
|
||||
{
|
||||
msg = "[CONTENT] "+ msg;
|
||||
if (type == "info") {
|
||||
LogInfo(msg);
|
||||
} else if (type == "warning") {
|
||||
LogWarning(msg);
|
||||
} else {
|
||||
gDumpLog("REFTEST TEST-UNEXPECTED-FAIL | | unknown log type "+ type +"\n");
|
||||
++gTestResults.Exception;
|
||||
}
|
||||
}
|
||||
|
||||
function RecvScriptResults(runtimeMs, error, results)
|
||||
{
|
||||
RecordResult(runtimeMs, error, results);
|
||||
}
|
||||
|
||||
function RecvTestDone(runtimeMs)
|
||||
{
|
||||
RecordResult(runtimeMs, '', [ ]);
|
||||
}
|
||||
|
||||
function RecvUpdateCanvasForInvalidation(rects)
|
||||
{
|
||||
UpdateCurrentCanvasForInvalidation(rects);
|
||||
}
|
||||
|
||||
function SendClear()
|
||||
{
|
||||
gBrowserMessageManager.sendAsyncMessage("reftest:Clear");
|
||||
}
|
||||
|
||||
function SendLoadScriptTest(uri, timeout)
|
||||
{
|
||||
gBrowserMessageManager.sendAsyncMessage("reftest:LoadScriptTest",
|
||||
{ uri: uri, timeout: timeout });
|
||||
}
|
||||
|
||||
function SendLoadTest(type, uri, timeout)
|
||||
{
|
||||
gBrowserMessageManager.sendAsyncMessage("reftest:LoadTest",
|
||||
{ type: type, uri: uri, timeout: timeout }
|
||||
);
|
||||
}
|
||||
|
||||
function SendResetZoom()
|
||||
{
|
||||
gBrowserMessageManager.sendAsyncMessage("reftest:ResetZoom");
|
||||
}
|
||||
|
@ -52,7 +52,5 @@
|
||||
<script type="application/ecmascript" src="quit.js" />
|
||||
<script type="application/ecmascript" src="reftest.js" />
|
||||
<script type="application/ecmascript" src="MozillaFileLogger.js" />
|
||||
<!-- Make sure the browser element is exactly 800x1000, no matter what size our window is -->
|
||||
<browser id="browser" type="content-primary"
|
||||
style="min-width: 800px; min-height: 1000px; max-width: 800px; max-height: 1000px" />
|
||||
<!-- The reftest browser element is dynamically created, here -->
|
||||
</window>
|
||||
|
@ -1,7 +1,11 @@
|
||||
load 41276-1.html
|
||||
load 48856-1.html
|
||||
load 110650-1.html
|
||||
skip-if(!haveTestPlugin) skip-if(cocoaWidget) script 539897-1.html
|
||||
skip-if(!haveTestPlugin) script 540114-1.html
|
||||
skip-if(browserIsRemote||!haveTestPlugin||cocoaWidget) script 539897-1.html # browserIsRemote is bug XXXXXX
|
||||
skip-if(browserIsRemote||!haveTestPlugin) script 540114-1.html # browserIsRemote is bug XXXXXX
|
||||
load 570884.html
|
||||
skip-if(!haveTestPlugin||http.platform!="X11"||!testPluginIsOOP()) load 598862.html
|
||||
# This test relies on the reading of screenX/Y forcing a round trip to
|
||||
# the X server, which is a bad assumption for <browser remote>.
|
||||
# Plugin arch is going to change anyway with OOP content so skipping
|
||||
# this test for now is OK.
|
||||
skip-if(browserIsRemote||!haveTestPlugin||http.platform!="X11"||!testPluginIsOOP()) load 598862.html
|
||||
|
@ -1,2 +1,2 @@
|
||||
load 327524-1.html
|
||||
load 398665-1.html
|
||||
asserts-if(browserIsRemote,1) load 327524-1.html # bug 582297
|
||||
asserts-if(browserIsRemote,1) load 398665-1.html # bug 582297
|
||||
|
@ -112,16 +112,45 @@ endif
|
||||
RUN_REFTEST = rm -f ./$@.log && $(PYTHON) _tests/reftest/runreftest.py \
|
||||
$(SYMBOLS_PATH) $(EXTRA_TEST_ARGS) $(1) | tee ./$@.log
|
||||
|
||||
ifeq ($(OS_ARCH),WINNT) #{
|
||||
# GPU-rendered shadow layers are unsupported here
|
||||
OOP_CONTENT = --setpref=browser.tabs.remote=true --setpref=layers.acceleration.disabled=true
|
||||
GPU_RENDERING =
|
||||
else
|
||||
OOP_CONTENT = --setpref=browser.tabs.remote=true
|
||||
GPU_RENDERING = --setpref=layers.acceleration.force-enabled=true
|
||||
endif #}
|
||||
|
||||
reftest: TEST_PATH?=layout/reftests/reftest.list
|
||||
reftest:
|
||||
$(call RUN_REFTEST,$(topsrcdir)/$(TEST_PATH))
|
||||
$(CHECK_TEST_ERROR)
|
||||
|
||||
reftest-ipc: TEST_PATH?=layout/reftests/reftest.list
|
||||
reftest-ipc:
|
||||
$(call RUN_REFTEST,$(topsrcdir)/$(TEST_PATH) $(OOP_CONTENT))
|
||||
$(CHECK_TEST_ERROR)
|
||||
|
||||
reftest-ipc-gpu: TEST_PATH?=layout/reftests/reftest.list
|
||||
reftest-ipc-gpu:
|
||||
$(call RUN_REFTEST,$(topsrcdir)/$(TEST_PATH) $(OOP_CONTENT) $(GPU_RENDERING))
|
||||
$(CHECK_TEST_ERROR)
|
||||
|
||||
crashtest: TEST_PATH?=testing/crashtest/crashtests.list
|
||||
crashtest:
|
||||
$(call RUN_REFTEST,$(topsrcdir)/$(TEST_PATH))
|
||||
$(CHECK_TEST_ERROR)
|
||||
|
||||
crashtest-ipc: TEST_PATH?=testing/crashtest/crashtests.list
|
||||
crashtest-ipc:
|
||||
$(call RUN_REFTEST,$(topsrcdir)/$(TEST_PATH) $(OOP_CONTENT))
|
||||
$(CHECK_TEST_ERROR)
|
||||
|
||||
crashtest-ipc-gpu: TEST_PATH?=testing/crashtest/crashtests.list
|
||||
crashtest-ipc-gpu:
|
||||
$(call RUN_REFTEST,$(topsrcdir)/$(TEST_PATH) $(OOP_CONTENT) $(GPU_RENDERING))
|
||||
$(CHECK_TEST_ERROR)
|
||||
|
||||
jstestbrowser: TEST_PATH?=js/src/tests/jstests.list
|
||||
jstestbrowser:
|
||||
$(call RUN_REFTEST,$(topsrcdir)/$(TEST_PATH) --extra-profile-file=$(topsrcdir)/js/src/tests/user.js)
|
||||
|
Loading…
x
Reference in New Issue
Block a user