зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1467712 - Simplify calls to ok to use only 2 arguments;r=Standard8
Differential Revision: https://phabricator.services.mozilla.com/D10416 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
636020d26c
Коммит
b50a5ba4dc
|
@ -105,9 +105,9 @@ function VCChangedChecker(aDocAcc, aIdOrNameOrAcc, aTextOffsets, aPivotMoveMetho
|
|||
var nameMatches = position && position.name == aIdOrNameOrAcc;
|
||||
var accMatches = position == aIdOrNameOrAcc;
|
||||
|
||||
SimpleTest.ok(idMatches || nameMatches || accMatches, "id or name matches",
|
||||
"expecting " + prettyName(aIdOrNameOrAcc) + ", got '" +
|
||||
prettyName(position));
|
||||
SimpleTest.ok(idMatches || nameMatches || accMatches,
|
||||
"id or name matches - expecting " +
|
||||
prettyName(aIdOrNameOrAcc) + ", got '" + prettyName(position));
|
||||
|
||||
SimpleTest.is(aEvent.isFromUserInput, aIsFromUserInput,
|
||||
"Expected user input is " + aIsFromUserInput + "\n");
|
||||
|
|
|
@ -20,13 +20,13 @@ html5 sandboxed iframe should not be able to perform top navigation with scripts
|
|||
if (event.data != 'childIframe') {
|
||||
ok(false, "event.data: got '" + event.data + "', expected 'childIframe'");
|
||||
}
|
||||
ok(!testCase.shouldBeBlocked, testCase.desc, "child navigation was NOT blocked");
|
||||
ok(!testCase.shouldBeBlocked, testCase.desc + " - child navigation was NOT blocked");
|
||||
runNextTest();
|
||||
};
|
||||
try {
|
||||
window["parentIframe"].eval(testCase.script);
|
||||
} catch(e) {
|
||||
ok(testCase.shouldBeBlocked, testCase.desc, e.message);
|
||||
ok(testCase.shouldBeBlocked, testCase.desc + " - " + e.message);
|
||||
runNextTest();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -18,13 +18,13 @@ html5 sandboxed iframe should not be able to perform top navigation with scripts
|
|||
if (event.data != "otherWindow") {
|
||||
ok(false, "event.data: got '" + event.data + "', expected 'otherWindow'");
|
||||
}
|
||||
ok(false, testCase.desc, "auxiliary navigation was NOT blocked");
|
||||
ok(false, testCase.desc + " - auxiliary navigation was NOT blocked");
|
||||
runNextTest();
|
||||
};
|
||||
try {
|
||||
window["testIframe"].eval(testCase.script);
|
||||
} catch(e) {
|
||||
ok(true, testCase.desc, e.message);
|
||||
ok(true, testCase.desc + " - " + e.message);
|
||||
runNextTest();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -18,13 +18,13 @@ html5 sandboxed iframe should not be able to perform top navigation with scripts
|
|||
if (event.data != "ourWindow") {
|
||||
ok(false, "event.data: got '" + event.data + "', expected 'ourWindow'");
|
||||
}
|
||||
ok(!testCase.shouldBeBlocked, testCase.desc, "auxiliary navigation was NOT blocked");
|
||||
ok(!testCase.shouldBeBlocked, testCase.desc + " - auxiliary navigation was NOT blocked");
|
||||
runNextTest();
|
||||
};
|
||||
try {
|
||||
SpecialPowers.wrap(window["testIframe"]).eval(testCase.script);
|
||||
} catch(e) {
|
||||
ok(testCase.shouldBeBlocked, testCase.desc, SpecialPowers.wrap(e).message);
|
||||
ok(testCase.shouldBeBlocked, testCase.desc + " - " + SpecialPowers.wrap(e).message);
|
||||
runNextTest();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -18,13 +18,13 @@ html5 sandboxed iframe should not be able to perform top navigation with scripts
|
|||
if (event.data != "parentIframe") {
|
||||
ok(false, "event.data: got '" + event.data + "', expected 'parentIframe'");
|
||||
}
|
||||
ok(false, testCase.desc, "parent navigation was NOT blocked");
|
||||
ok(false, testCase.desc + " - parent navigation was NOT blocked");
|
||||
runNextTest();
|
||||
};
|
||||
try {
|
||||
window["parentIframe"]["childIframe"].eval(testCase.script);
|
||||
} catch(e) {
|
||||
ok(true, testCase.desc, e.message);
|
||||
ok(true, testCase.desc + " - " + e.message);
|
||||
runNextTest();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,14 +19,14 @@ html5 sandboxed iframe should not be able to perform top navigation with scripts
|
|||
ok(false, "event.data: got '" + event.data + "', expected 'siblingIframe'");
|
||||
}
|
||||
|
||||
ok(false, testCase.desc, "sibling navigation was NOT blocked");
|
||||
ok(false, testCase.desc + " - sibling navigation was NOT blocked");
|
||||
runNextTest();
|
||||
};
|
||||
|
||||
try {
|
||||
window["testIframe"].eval(testCase.script);
|
||||
} catch(e) {
|
||||
ok(true, testCase.desc, e.message);
|
||||
ok(true, testCase.desc + " - " + e.message);
|
||||
runNextTest();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,13 +19,13 @@ html5 sandboxed iframe should not be able to perform top navigation with scripts
|
|||
if (event.data != "newTop") {
|
||||
ok(false, "event.data: got '" + event.data + "', expected 'newTop'");
|
||||
}
|
||||
ok(!testCase.shouldBeBlocked, testCase.desc, "top navigation was NOT blocked");
|
||||
ok(!testCase.shouldBeBlocked, testCase.desc + " - top navigation was NOT blocked");
|
||||
runNextTest();
|
||||
};
|
||||
try {
|
||||
SpecialPowers.wrap(testWin[testCase.iframeName]).eval(testCase.script);
|
||||
} catch(e) {
|
||||
ok(testCase.shouldBeBlocked, testCase.desc, SpecialPowers.wrap(e).message);
|
||||
ok(testCase.shouldBeBlocked, testCase.desc + " - " + SpecialPowers.wrap(e).message);
|
||||
runNextTest();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -20,13 +20,13 @@ html5 sandboxed iframe should not be able to perform top navigation with scripts
|
|||
ok(false, "event.data.name: got '" + event.data.name + "', expected 'newWindow'");
|
||||
}
|
||||
var diag = "top navigation was " + (event.data.blocked ? "" : "NOT ") + "blocked";
|
||||
ok((testCase.shouldBeBlocked == event.data.blocked), testCase.desc, diag);
|
||||
ok((testCase.shouldBeBlocked == event.data.blocked), testCase.desc + " - " + diag);
|
||||
runNextTest();
|
||||
};
|
||||
try {
|
||||
testWin[testCase.iframeName].eval(testCase.script);
|
||||
} catch(e) {
|
||||
ok(testCase.shouldBeBlocked, testCase.desc, e.message);
|
||||
ok(testCase.shouldBeBlocked, testCase.desc + " - " + e.message);
|
||||
runNextTest();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,14 +4,14 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=352728
|
|||
-->
|
||||
<head>
|
||||
<title>Test for Bug 352728</title>
|
||||
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
|
||||
</head>
|
||||
<body>
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=352728">Mozilla Bug 352728</a>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none">
|
||||
|
||||
|
||||
</div>
|
||||
<pre id="test">
|
||||
<!-- First make sure that a script consisting of multiple CDATA sections is
|
||||
|
@ -45,8 +45,11 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=352728
|
|||
function checkTypes(aNode, aNodeType, aTypeArray)
|
||||
{
|
||||
for (var i = 0; i < aTypeArray.length; ++i) {
|
||||
ok(aNode instanceof aTypeArray[i], aNodeType + " type test " + i,
|
||||
aNodeType + " should be a " + aTypeArray[i]);
|
||||
ok(
|
||||
aNode instanceof aTypeArray[i],
|
||||
aNodeType + " type test " + i + " - " +
|
||||
aNodeType + " should be a " + aTypeArray[i]
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -54,7 +57,7 @@ function checkInterfaces(aNode, aNodeType, aInterfaceArray)
|
|||
{
|
||||
for (var i = 0; i < aInterfaceArray.length; ++i) {
|
||||
ok(aNode instanceof SpecialPowers.Ci[aInterfaceArray[i]],
|
||||
aNodeType + " interface test " + i,
|
||||
aNodeType + " interface test " + i + " - " +
|
||||
aNodeType + " should be a " + aInterfaceArray[i]);
|
||||
}
|
||||
}
|
||||
|
@ -82,7 +85,7 @@ function testComment(aText)
|
|||
is(comment.nodeName, "#comment", "Check nodeName");
|
||||
is(comment.nodeType, Node.COMMENT_NODE, "Check nodeType");
|
||||
} catch (e) {
|
||||
ok(0, "Correct functioning of comment stuff", "something broke: " + e);
|
||||
ok(false, "Correct functioning of comment stuff - something broke: " + e);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -101,15 +104,15 @@ function testCDATASection(aText, aShouldSucceed)
|
|||
is(cdataSection.nodeType, Node.CDATA_SECTION_NODE, "Check nodeType");
|
||||
|
||||
if (!aShouldSucceed) {
|
||||
ok(0, "Invalid CDATA section creation",
|
||||
ok(0, "Invalid CDATA section creation - " +
|
||||
]]>
|
||||
"Shouldn't create CDATA section with embedded \"]]>\"");
|
||||
<![CDATA[
|
||||
}
|
||||
} catch (e) {
|
||||
if (aShouldSucceed) {
|
||||
ok(0, "Correct functioning of CDATA section stuff",
|
||||
"something broke: " + e);
|
||||
ok(false,
|
||||
"Correct functioning of CDATA section stuff - something broke: " + e);
|
||||
} else {
|
||||
is(e.name, "InvalidCharacterError", "Check exception");
|
||||
is(e.code, DOMException.INVALID_CHARACTER_ERR, "Check exception code");
|
||||
|
@ -133,15 +136,16 @@ function testPI(aTarget, aData, aShouldSucceed, aReason)
|
|||
is(pi.nodeValue, aData, "Check nodeValue");
|
||||
is(pi.localName, undefined, "Check localName")
|
||||
is(pi.namespaceURI, undefined, "Check namespaceURI");
|
||||
|
||||
|
||||
is(pi.nodeType, Node.PROCESSING_INSTRUCTION_NODE, "Check nodeType");
|
||||
|
||||
if (!aShouldSucceed) {
|
||||
ok(0, "Invalid processing instruction creation", aReason);
|
||||
ok(false, "Invalid processing instruction creation - " + aReason);
|
||||
}
|
||||
} catch (e) {
|
||||
if (aShouldSucceed) {
|
||||
ok(0, "Correct functioning of processing instruction stuff",
|
||||
ok(false,
|
||||
"Correct functioning of processing instruction stuff - " +
|
||||
"something broke: " + e);
|
||||
} else {
|
||||
is(e.name, "InvalidCharacterError", "Check exception");
|
||||
|
|
|
@ -5,14 +5,14 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=379120
|
|||
-->
|
||||
<head>
|
||||
<title>Test for Bug 379120</title>
|
||||
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
|
||||
</head>
|
||||
<body>
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=379120">Mozilla Bug 379120</a>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none">
|
||||
|
||||
|
||||
</div>
|
||||
<pre id="test">
|
||||
<script class="testbody" type="text/javascript">
|
||||
|
@ -25,7 +25,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=379120
|
|||
var parser = new DOMParser();
|
||||
var originalDoc = parser.parseFromString(originalString, "text/xml");
|
||||
|
||||
var stylesheetText =
|
||||
var stylesheetText =
|
||||
"<xsl:stylesheet xmlns:xsl='http://www.w3.org/1999/XSL/Transform' " +
|
||||
"version='1.0' xmlns='http://www.w3.org/1999/xhtml'> " +
|
||||
|
||||
|
@ -34,7 +34,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=379120
|
|||
"doctype-public='-//W3C//DTD XHTML 1.0 Transitional//EN' /> " +
|
||||
|
||||
"<xsl:template match='/'>" +
|
||||
"<div onload='var i = 1'/>" +
|
||||
"<div onload='var i = 1'/>" +
|
||||
"<xsl:apply-templates />" +
|
||||
"</xsl:template>" +
|
||||
"</xsl:stylesheet>";
|
||||
|
@ -47,10 +47,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=379120
|
|||
var transformedDocument = processor.transformToDocument (originalDoc);
|
||||
is(transformedDocument.documentElement.getAttribute("onload"),
|
||||
"var i = 1");
|
||||
ok(transformedDocument.documentElement.onload === null,
|
||||
"Shouldn't have onload handler",
|
||||
"got " + repr(transformedDocument.documentElement.onload) +
|
||||
", expected null");;
|
||||
is(transformedDocument.documentElement.onload, null, "Shouldn't have onload handler");
|
||||
</script>
|
||||
</pre>
|
||||
</body>
|
||||
|
|
|
@ -41,7 +41,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=388794
|
|||
<iframe name="test6" id="test6"></iframe>
|
||||
</p>
|
||||
<div id="content" style="display: none">
|
||||
|
||||
|
||||
</div>
|
||||
<pre id="test">
|
||||
<script type="application/javascript">
|
||||
|
@ -91,8 +91,11 @@ addLoadEvent(function() {
|
|||
});
|
||||
|
||||
function frameLoaded(frame) {
|
||||
ok(hrefs[frame.name].test(frame.contentWindow.location.href),
|
||||
"Unexpected href for frame " + frame.name, "expected to match: " + hrefs[frame.name].toString() + " got: " + frame.contentWindow.location.href);
|
||||
ok(
|
||||
hrefs[frame.name].test(frame.contentWindow.location.href),
|
||||
"Unexpected href for frame " + frame.name + " - " +
|
||||
"expected to match: " + hrefs[frame.name].toString() + " got: " + frame.contentWindow.location.href
|
||||
);
|
||||
if (--pendingLoads == 0) {
|
||||
SimpleTest.finish();
|
||||
}
|
||||
|
|
|
@ -125,7 +125,7 @@ function* testHarnessSteps() {
|
|||
let message = event.data;
|
||||
switch (message.op) {
|
||||
case "ok":
|
||||
ok(message.condition, message.name, message.diag);
|
||||
SimpleTest.ok(message.condition, `${message.name}: ${message.diag}`);
|
||||
break;
|
||||
|
||||
case "todo":
|
||||
|
|
|
@ -265,7 +265,11 @@ function checkResampledBuffer(buffer, test, callback) {
|
|||
}
|
||||
// Take into account the resampling when checking the size
|
||||
var expectedLength = test.frames * buffer.sampleRate / test.sampleRate;
|
||||
ok(Math.abs(buffer.length - expectedLength) < 1.0, "Correct length", "got " + buffer.length + ", expected about " + expectedLength);
|
||||
SimpleTest.ok(
|
||||
Math.abs(buffer.length - expectedLength) < 1.0,
|
||||
"Correct length - got " + buffer.length +
|
||||
", expected about " + expectedLength
|
||||
);
|
||||
|
||||
// Playback the buffer in the original context, to resample back to the
|
||||
// original rate and compare with the decoded buffer without resampling.
|
||||
|
|
|
@ -11,8 +11,16 @@
|
|||
setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
|
||||
|
||||
function runTests() {
|
||||
ok(document.getElementById('plugin1').pluginFoundElement, "plugin1.pluginFoundElement (NPNVPluginElementNPObject)", document.getElementById('plugin1').pluginFoundElement);
|
||||
ok(window.pluginFoundWindow, "window.pluginFoundWindow (NPNVWindowNPObject)", window.pluginFoundWindow);
|
||||
ok(
|
||||
document.getElementById('plugin1').pluginFoundElement,
|
||||
"plugin1.pluginFoundElement (NPNVPluginElementNPObject) - " +
|
||||
document.getElementById('plugin1').pluginFoundElement
|
||||
);
|
||||
ok(
|
||||
window.pluginFoundWindow,
|
||||
"window.pluginFoundWindow (NPNVWindowNPObject) - " +
|
||||
window.pluginFoundWindow
|
||||
);
|
||||
|
||||
SimpleTest.finish();
|
||||
}
|
||||
|
|
|
@ -96,7 +96,7 @@ function* testHarnessSteps()
|
|||
let message = event.data;
|
||||
switch (message.op) {
|
||||
case "ok":
|
||||
ok(message.condition, message.name, message.diag);
|
||||
ok(message.condition, message.name + " - " + message.diag);
|
||||
break;
|
||||
|
||||
case "todo":
|
||||
|
|
|
@ -89,9 +89,10 @@ Bug 671389 - Implement CSP sandbox directive
|
|||
try {
|
||||
var actual = getSandboxFlags(SpecialPowers.wrap(iframe).contentDocument);
|
||||
ok(eqFlags(actual, this_.expected),
|
||||
this_.desc, 'expected: "' + this_.expected + '", got: "' + actual + '"');
|
||||
this_.desc + ' - expected: "' + this_.expected + '", got: "' + actual + '"');
|
||||
} catch (e) {
|
||||
ok(false, this_.desc, 'expected: "' + this_.expected + '", failed with: "' + e + '"');
|
||||
ok(false,
|
||||
this_.desc + ' - expected: "' + this_.expected + '", failed with: "' + e + '"');
|
||||
}
|
||||
runNextTest();
|
||||
};
|
||||
|
|
|
@ -26,7 +26,8 @@ function run()
|
|||
|
||||
function isFuzzy(a, b, error, name)
|
||||
{
|
||||
ok(!(Math.abs(a - b) > error), name, "got " + a + ", expected " + b + " (within " + error + ")");
|
||||
ok(!(Math.abs(a - b) > error),
|
||||
name + " - got " + a + ", expected " + b + " (within " + error + ")");
|
||||
}
|
||||
|
||||
function getBBox(id) {
|
||||
|
|
|
@ -145,7 +145,7 @@ function test(name, callback, nowait) {
|
|||
} else good++;
|
||||
|
||||
if ( parent.SimpleTest ){
|
||||
parent.SimpleTest.ok( _config.Test[i][0], name, _config.Test[i][1] );}
|
||||
parent.SimpleTest.ok( _config.Test[i][0], `${name}: ${_config.Test[i][1]}` );}
|
||||
}
|
||||
|
||||
var li = document.createElement("li");
|
||||
|
|
|
@ -591,7 +591,7 @@ Test.Unit.Testcase = Class.create(Test.Unit.Assertions, {
|
|||
if ( parent.SimpleTest && parent.runAJAXTest ) (function(){
|
||||
var finish = Test.Unit.Logger.prototype.finish;
|
||||
Test.Unit.Logger.prototype.finish = function(status,summary){
|
||||
parent.SimpleTest.ok( status == "passed", this.testName, summary );
|
||||
parent.SimpleTest.ok( status == "passed", `${this.testName}: ${summary}` );
|
||||
return finish.apply( this, arguments );
|
||||
};
|
||||
|
||||
|
|
|
@ -571,10 +571,10 @@ if ( parent.SimpleTest && parent.runAJAXTest ) (function(){
|
|||
var pass = match[1] - fail;
|
||||
|
||||
for ( var i = 0; i < pass; i++ )
|
||||
parent.SimpleTest.ok( true, this.testName, summary );
|
||||
parent.SimpleTest.ok( true, `${this.testName}: ${summary}` );
|
||||
|
||||
for ( var i = 0; i < fail; i++ )
|
||||
parent.SimpleTest.ok( false, this.testName, summary );
|
||||
parent.SimpleTest.ok( false, `${this.testName}: ${summary}` );
|
||||
|
||||
return finish.apply( this, arguments );
|
||||
};
|
||||
|
|
|
@ -5,14 +5,14 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=159849
|
|||
-->
|
||||
<head>
|
||||
<title>Test for Bug 159849</title>
|
||||
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
|
||||
</head>
|
||||
<body>
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=159849">Mozilla Bug 159849</a>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none">
|
||||
|
||||
|
||||
</div>
|
||||
<pre id="test">
|
||||
<script class="testbody" type="text/javascript">
|
||||
|
@ -28,10 +28,11 @@ with (c) {
|
|||
}
|
||||
|
||||
is(c.onmouseover, testFunc, "Event handler should have been set on node");
|
||||
ok(c.fooExpando === undefined, "Expando should not have been set on node",
|
||||
ok(c.fooExpando === undefined,
|
||||
"Expando should not have been set on node - " +
|
||||
"got " + repr(c.fooExpando) + ", expected undefined");
|
||||
ok(window.onmouseover === null,
|
||||
"Event handler should not have been set on window",
|
||||
"Event handler should not have been set on window - " +
|
||||
"got " + repr(window.onmouseover) + ", expected undefined");
|
||||
is(window.fooExpando, testFunc, "Expando should have been set on window");
|
||||
</script>
|
||||
|
|
|
@ -15,7 +15,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=390488
|
|||
</div>
|
||||
</p>
|
||||
<div id="content" style="display: none">
|
||||
|
||||
|
||||
</div>
|
||||
<pre id="test">
|
||||
<script class="testbody" type="text/javascript">
|
||||
|
@ -30,13 +30,13 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=390488
|
|||
}
|
||||
return stack;
|
||||
}
|
||||
|
||||
|
||||
function getStack2() {
|
||||
var stack = new Error().stack;
|
||||
// Remove the two lines due to calling this
|
||||
return stack.substring(stack.indexOf("\n", stack.indexOf("\n")+1)+1);
|
||||
}
|
||||
|
||||
|
||||
function simulateClick() {
|
||||
var evt = document.createEvent("MouseEvents");
|
||||
evt.initMouseEvent("click", true, true, window,
|
||||
|
@ -45,8 +45,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=390488
|
|||
}
|
||||
|
||||
function matches(s, p, name) {
|
||||
ok(s.match(p) != null, name,
|
||||
"got " + uneval(s) + ", expected a string matching " + uneval(p));
|
||||
ok(s.match(p) != null,
|
||||
name + " - got " + uneval(s) + ", expected a string matching " + uneval(p));
|
||||
}
|
||||
|
||||
function checkForStacks() {
|
||||
|
|
|
@ -33,17 +33,17 @@ addLoadEvent(function() {
|
|||
|
||||
var equal, str1, str2;
|
||||
[equal, str1, str2] = compareSnapshots(s1, s2, true);
|
||||
ok(equal, "Show/hide should have no effect",
|
||||
ok(equal, "Show/hide should have no effect - " +
|
||||
"got " + str1 + " but expected " + str2);
|
||||
|
||||
var viewer =
|
||||
SpecialPowers.wrap($("ourFrame")).contentWindow.docShell.contentViewer;
|
||||
viewer.fullZoom = 2;
|
||||
|
||||
|
||||
s3 = snapshotWindow(window);
|
||||
|
||||
[equal, str1, str2] = compareSnapshots(s1, s3, true);
|
||||
ok(equal, "Zoom should have no effect",
|
||||
ok(equal, "Zoom should have no effect - " +
|
||||
"got " + str1 + " but expected " + str2);
|
||||
|
||||
$("display").style.display = "none";
|
||||
|
|
|
@ -312,11 +312,13 @@ function runTest() {
|
|||
sheet.deleteRule(0);
|
||||
sheet.insertRule(testset[curTest].rule, 0);
|
||||
} catch (e) {
|
||||
ok(e.name == "SyntaxError"
|
||||
&& e instanceof DOMException
|
||||
&& e.code == DOMException.SYNTAX_ERR
|
||||
&& !('d' in testset[curTest]),
|
||||
testset[curTest].rule + " syntax error thrown", e);
|
||||
ok(
|
||||
e.name == "SyntaxError"
|
||||
&& e instanceof DOMException
|
||||
&& e.code == DOMException.SYNTAX_ERR
|
||||
&& !('d' in testset[curTest]),
|
||||
testset[curTest].rule + " syntax error thrown - " + e
|
||||
);
|
||||
}
|
||||
|
||||
try {
|
||||
|
@ -339,8 +341,11 @@ function runTest() {
|
|||
// nothing else is set
|
||||
is(s.length, n, testset[curTest].rule + "prop count");
|
||||
for (var i = 0; i < s.length; i++) {
|
||||
ok(s[i] in d, testset[curTest].rule,
|
||||
"Unexpected item #" + i + ": " + s[i]);
|
||||
ok(
|
||||
s[i] in d,
|
||||
testset[curTest].rule +
|
||||
" - Unexpected item #" + i + ": " + s[i]
|
||||
);
|
||||
}
|
||||
|
||||
// round-tripping of cssText
|
||||
|
@ -363,7 +368,7 @@ function runTest() {
|
|||
}
|
||||
}
|
||||
} catch (e) {
|
||||
ok(false, testset[curTest].rule, "During test: " + e);
|
||||
ok(false, testset[curTest].rule + " - During test: " + e);
|
||||
}
|
||||
}
|
||||
SimpleTest.finish();
|
||||
|
|
|
@ -77,15 +77,15 @@
|
|||
// nothing else is set
|
||||
is(s.length, n, testset[curTest].rule + " prop count");
|
||||
for (var i = 0; i < s.length; i++) {
|
||||
ok(s[i] in expected, testset[curTest].rule,
|
||||
"Unexpected item #" + i + ": " + s[i]);
|
||||
ok(s[i] in expected, testset[curTest].rule +
|
||||
" - Unexpected item #" + i + ": " + s[i]);
|
||||
}
|
||||
} else {
|
||||
is(Object.keys(sheet.cssRules[0].style).length, 0,
|
||||
testset[curTest].rule + " rule has no properties");
|
||||
}
|
||||
} catch (e) {
|
||||
ok(false, testset[curTest].rule, "During test: " + e);
|
||||
ok(false, testset[curTest].rule + " - During test: " + e);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
|
@ -11,9 +11,9 @@
|
|||
|
||||
var captureFailure = false;
|
||||
var capturedFailures = [];
|
||||
window.ok = function (cond, name, diag) {
|
||||
window.ok = function (cond, name) {
|
||||
if (!captureFailure) {
|
||||
SimpleTest.ok(cond, name, diag);
|
||||
SimpleTest.ok(cond, name);
|
||||
} else {
|
||||
if (cond) {
|
||||
SimpleTest.ok(false, `Expect a failure with "${name}"`);
|
||||
|
|
|
@ -55,19 +55,19 @@ ExtensionTestUtils.loadExtension = function(ext)
|
|||
|
||||
function testHandler(kind, pass, msg, ...args) {
|
||||
if (kind == "test-eq") {
|
||||
let [expected, actual, stack] = args;
|
||||
SimpleTest.ok(pass, `${msg} - Expected: ${expected}, Actual: ${actual}`, undefined, stack);
|
||||
let [expected, actual] = args;
|
||||
SimpleTest.ok(pass, `${msg} - Expected: ${expected}, Actual: ${actual}`);
|
||||
} else if (kind == "test-log") {
|
||||
SimpleTest.info(msg);
|
||||
} else if (kind == "test-result") {
|
||||
SimpleTest.ok(pass, msg, undefined, args[0]);
|
||||
SimpleTest.ok(pass, msg);
|
||||
}
|
||||
}
|
||||
|
||||
var handler = {
|
||||
testResult(kind, pass, msg, ...args) {
|
||||
if (kind == "test-done") {
|
||||
SimpleTest.ok(pass, msg, undefined, args[0]);
|
||||
SimpleTest.ok(pass, msg);
|
||||
return testResolve(msg);
|
||||
}
|
||||
testHandler(kind, pass, msg, ...args);
|
||||
|
|
Загрузка…
Ссылка в новой задаче