WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Proposed Fix
bug-147954-20150812144106.patch (text/plain), 48.53 KB, created by
Blaze Burg
on 2015-08-12 14:41:23 PDT
(
hide
)
Description:
Proposed Fix
Filename:
MIME Type:
Creator:
Blaze Burg
Created:
2015-08-12 14:41:23 PDT
Size:
48.53 KB
patch
obsolete
>Subversion Revision: 188283 >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index 6649118e80329b958feacb8eeec1d04db09a7af5..b04ca45c8c35ed5f767e5983eae7ae2809945516 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,88 @@ >+2015-08-12 Brian Burg <bburg@apple.com> >+ >+ Web Inspector: refactor ProtocolTest to be an InjectedTestHarness subclass >+ https://bugs.webkit.org/show_bug.cgi?id=147954 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ In preparation for sharing the same test harness API between protocol tests >+ and frontend tests, this patch refactors ProtocolTest into the desired >+ class structure. Each type of test (currently: protocol, frontend) extends >+ InjectedTestHarness and fills in a few key methods for communicating with >+ the test page-side code. >+ >+ This patch standardizes on assert() only logging when the condition is false. >+ Update protocol tests to use ProtocolTestHarness.expectThat, rather than assert. >+ >+ * http/tests/inspector/resources/ProtocolTestStub.js: >+ (window.InjectedTestHarness): >+ (window.InjectedTestHarness.prototype.createAsyncSuite): >+ (window.InjectedTestHarness.prototype.createSyncSuite): >+ (window.InjectedTestHarness.prototype.completeTest): >+ (window.InjectedTestHarness.prototype.addResult): >+ (window.InjectedTestHarness.prototype.debugLog): >+ (window.InjectedTestHarness.prototype.evaluateInPage): >+ (window.InjectedTestHarness.prototype.importScript): >+ (window.InjectedTestHarness.prototype.get logCount): >+ (window.InjectedTestHarness.prototype.log): >+ (window.InjectedTestHarness.prototype.assert): >+ (window.InjectedTestHarness.prototype.expectThat): >+ >+ (InjectedTestHarness.AsyncTestSuite): Use a stored reference to the harness >+ rather than hardcoding a specific InjectedTestHarness instance. >+ >+ (InjectedTestHarness.AsyncTestSuite.prototype.runTestCasesAndFinish.finish): >+ (InjectedTestHarness.AsyncTestSuite.prototype.runTestCasesAndFinish): >+ (InjectedTestHarness.AsyncTestSuite.prototype.runTestCases): >+ >+ (InjectedTestHarness.SyncTestSuite): Use a stored reference to the harness >+ rather than hardcoding a specific InjectedTestHarness instance. >+ >+ (InjectedTestHarness.SyncTestSuite.prototype.runTestCasesAndFinish): >+ (InjectedTestHarness.SyncTestSuite.prototype.runTestCases): >+ >+ (ProtocolTestHarness.prototype.completeTest): >+ (ProtocolTestHarness.prototype.addResult): >+ (ProtocolTestHarness.prototype.debugLog): >+ (ProtocolTestHarness.prototype.evaluateInPage): >+ (ProtocolTestHarness): >+ (InspectorProtocol.sendCommand): >+ (InspectorProtocol.awaitCommand): >+ (InspectorProtocol.awaitEvent.): >+ (InspectorProtocol.awaitEvent): >+ (InspectorProtocol.addEventListener): >+ (InspectorProtocol.sendMessage): >+ (InspectorProtocol.checkForError): >+ (InspectorFrontendAPI.dispatchMessageAsync): >+ (ProtocolTest.AsyncTestSuite): Moved. >+ (ProtocolTest.AsyncTestSuite.prototype.runTestCasesAndFinish.finish): Moved. >+ (ProtocolTest.AsyncTestSuite.prototype.runTestCasesAndFinish): Moved. >+ (ProtocolTest.AsyncTestSuite.prototype.runTestCases): Moved. >+ (ProtocolTest.SyncTestSuite): Moved. >+ (ProtocolTest.SyncTestSuite.prototype.runTestCasesAndFinish): Moved. >+ (ProtocolTest.SyncTestSuite.prototype.runTestCases): Moved. >+ (ProtocolTest.log): Moved. >+ (ProtocolTest.assert): Moved. >+ (ProtocolTest.debugLog): Moved. >+ (ProtocolTest.completeTest): Moved. >+ (ProtocolTest.importScript): Moved. >+ * http/tests/inspector/resources/console-test.js: >+ (.suite.addTestCase.): >+ (.suite.addTestCase): >+ (ProtocolTest.Console.addTestCase): >+ * http/tests/inspector/resources/protocol-test.js: >+ (closeTest): >+ * inspector/console/console-message.html: >+ * inspector/console/x-frame-options-message.html: >+ * inspector/debugger/didSampleProbe-multiple-probes.html: >+ * inspector/dom-debugger/node-removed.html: >+ * inspector/dom/dom-remove-events.html: >+ * inspector/runtime/getProperties.html: >+ * inspector/unit-tests/async-test-suite-expected.txt: >+ * inspector/unit-tests/async-test-suite.html: >+ * inspector/unit-tests/sync-test-suite-expected.txt: >+ * inspector/unit-tests/sync-test-suite.html: >+ > 2015-08-11 Brian Burg <bburg@apple.com> > > Web Inspector: Agent commands do not actually return a promise when expected >diff --git a/LayoutTests/http/tests/inspector/resources/ProtocolTestStub.js b/LayoutTests/http/tests/inspector/resources/ProtocolTestStub.js >index 4c199cb0092f98d53995e8d5ac6096031deb3490..6f888caa1075491bb8b2d43892b7e3e1fe45e116 100644 >--- a/LayoutTests/http/tests/inspector/resources/ProtocolTestStub.js >+++ b/LayoutTests/http/tests/inspector/resources/ProtocolTestStub.js >@@ -25,160 +25,98 @@ > */ > InspectorFrontendAPI = {}; > >-InspectorProtocol = {}; >-InspectorProtocol._dispatchTable = []; >-InspectorProtocol._requestId = -1; >-InspectorProtocol.eventHandler = {}; >- >-ProtocolTest = {}; >-ProtocolTest.logCount = 0; >- >-ProtocolTest.forceSyncDebugLogging = false; >-InspectorProtocol.dumpInspectorProtocolMessages = false; >- >-InspectorProtocol.sendCommand = function(methodOrObject, params, handler) >+window.InjectedTestHarness = class InjectedTestHarness > { >- // Allow new-style arguments object, as in awaitCommand. >- var method = methodOrObject; >- if (typeof methodOrObject === "object") >- var {method, params, handler} = methodOrObject; >- >- this._dispatchTable[++this._requestId] = handler; >- var messageObject = {method, params, "id": this._requestId}; >- this.sendMessage(messageObject); >- >- return this._requestId; >-} >- >-InspectorProtocol.awaitCommand = function(args) >-{ >- var {method, params} = args; >- return new Promise(function(resolve, reject) { >- this._dispatchTable[++this._requestId] = {resolve, reject}; >- var messageObject = {method, params, "id": this._requestId}; >- this.sendMessage(messageObject); >- }.bind(this)); >-} >- >-InspectorProtocol.awaitEvent = function(args) >-{ >- var {event} = args; >- if (typeof event !== "string") >- throw new Error("Event must be a string."); >+ constructor() >+ { >+ this._logCount = 0; >+ this.forceSyncDebugLogging = false; >+ } > >- return new Promise(function(resolve, reject) { >- InspectorProtocol.eventHandler[event] = function(message) { >- InspectorProtocol.eventHandler[event] = undefined; >- resolve(message); >- } >- }); >-} >+ completeTest() >+ { >+ throw new Error("Must be implemented by subclasses."); >+ } > >-InspectorProtocol.addEventListener = function(eventTypeOrObject, listener) >-{ >- var event = eventTypeOrObject; >- if (typeof eventTypeOrObject === "object") >- var {event, listener} = eventTypeOrObject; >+ addResult() >+ { >+ throw new Error("Must be implemented by subclasses."); >+ } > >- if (typeof event !== "string") >- throw new Error("Event name must be a string."); >+ debugLog() >+ { >+ throw new Error("Must be implemented by subclasses."); >+ } > >- if (typeof listener !== "function") >- throw new Error("Event listener must be callable."); >+ evaluateInPage(string, callback) >+ { >+ throw new Error("Must be implemented by subclasses."); >+ } > >- // Convert to an array of listeners. >- var listeners = InspectorProtocol.eventHandler[event]; >- if (!listeners) >- listeners = InspectorProtocol.eventHandler[event] = []; >- else if (typeof listeners === "function") >- listeners = InspectorProtocol.eventHandler[event] = [listeners]; >+ createAsyncSuite(name) >+ { >+ return new InjectedTestHarness.AsyncTestSuite(this, name); >+ } > >- // Prevent registering multiple times. >- if (listeners.includes(listener)) >- throw new Error("Cannot register the same listener more than once."); >+ createSyncSuite(name) >+ { >+ return new InjectedTestHarness.SyncTestSuite(this, name); >+ } > >- listeners.push(listener); >-} >+ importScript(scriptName) >+ { >+ var xhr = new XMLHttpRequest(); >+ var isAsyncRequest = false; >+ xhr.open("GET", scriptName, isAsyncRequest); >+ xhr.send(null); >+ if (xhr.status !== 0 && xhr.status !== 200) >+ throw new Error("Invalid script URL: " + scriptName); >+ var script = "try { " + xhr.responseText + "} catch (e) { alert(" + JSON.stringify("Error in: " + scriptName) + "); throw e; }"; >+ window.eval(script); >+ } > >-InspectorProtocol.sendMessage = function(messageObject) >-{ >- // This matches the debug dumping in InspectorBackend, which is bypassed >- // by InspectorProtocol. Return messages should be dumped by InspectorBackend. >- if (this.dumpInspectorProtocolMessages) >- console.log("frontend: " + JSON.stringify(messageObject)); >+ get logCount() >+ { >+ return this._logCount; >+ } > >- InspectorFrontendHost.sendMessageToBackend(JSON.stringify(messageObject)); >-} >+ log(message) >+ { >+ ++this._logCount; > >-InspectorProtocol.checkForError = function(responseObject) >-{ >- if (responseObject.error) { >- ProtocolTest.log("PROTOCOL ERROR: " + JSON.stringify(responseObject.error)); >- ProtocolTest.completeTest(); >- throw "PROTOCOL ERROR"; >+ if (this.forceSyncDebugLogging) >+ this.debugLog(message); >+ else >+ this.addResult(message); > } >-} >- >-InspectorFrontendAPI.dispatchMessageAsync = function(messageObject) >-{ >- // If the message has an id, then it is a reply to a command. >- var messageId = messageObject["id"]; >- if (typeof messageId === "number") { >- var handler = InspectorProtocol._dispatchTable[messageId]; >- if (!handler) >- return; > >- if (typeof handler === "function") >- handler(messageObject); >- else if (typeof handler === "object") { >- var {resolve, reject} = handler; >- if ("error" in messageObject) >- reject(messageObject.error.message); >- else >- resolve(messageObject.result); >- } >- // Otherwise, it is an event. >- } else { >- var eventName = messageObject["method"]; >- var handler = InspectorProtocol.eventHandler[eventName]; >- if (!handler) >+ assert(condition, message) >+ { >+ if (condition) > return; > >- if (typeof handler === "function") >- handler(messageObject); >- else if (handler instanceof Array) { >- handler.map(function(listener) { >- listener.call(null, messageObject); >- }); >- } else if (typeof handler === "object") { >- var {resolve, reject} = handler; >- if ("error" in messageObject) >- reject(messageObject.error.message); >- else >- resolve(messageObject.result); >- } >+ let stringifiedMessage = typeof message !== "object" ? message : JSON.stringify(message); >+ this.addResult("ASSERT: " + stringifiedMessage); > } >-} > >-window.addEventListener("message", function(event) { >- try { >- eval(event.data); >- } catch (e) { >- alert(e.stack); >- ProtocolTest.completeTest(); >- throw e; >+ expectThat(condition, message) >+ { >+ let prefix = condition ? "PASS" : "FAIL"; >+ let stringifiedMessage = typeof message !== "object" ? message : JSON.stringify(message); >+ this.addResult(prefix + ": " + stringifiedMessage); > } >-}); >+} > >-// FIXME: Everything below here should be extracted to a file containing shared test utilities >-// between the two harnesses. >+InjectedTestHarness.AsyncTestSuite = class AsyncTestSuite { >+ constructor(harness, name) { >+ if (!(harness instanceof InjectedTestHarness)) >+ throw new Error("Must pass the test's harness as the first argument."); > >-ProtocolTest.AsyncTestSuite = class AsyncTestSuite { >- constructor(name) { > if (!name || typeof name !== "string") > throw new Error("Tried to create AsyncTestSuite without string suite name."); > > this.name = name; >+ this._harness = harness; > > this.testcases = []; > this.runCount = 0; >@@ -217,12 +155,12 @@ ProtocolTest.AsyncTestSuite = class AsyncTestSuite { > runTestCasesAndFinish() > { > function finish() { >- ProtocolTest.completeTest(); >+ this._harness.completeTest(); > } > > this.runTestCases() >- .then(finish) >- .catch(finish); >+ .then(finish.bind(this)) >+ .catch(finish.bind(this)); > } > > runTestCases() >@@ -234,19 +172,19 @@ ProtocolTest.AsyncTestSuite = class AsyncTestSuite { > > this._startedRunning = true; > >- ProtocolTest.log(""); >- ProtocolTest.log("== Running test suite: " + this.name); >+ this._harness.log(""); >+ this._harness.log("== Running test suite: " + this.name); > > // Avoid adding newlines if nothing was logged. >- var priorLogCount = ProtocolTest.logCount; >+ var priorLogCount = this._harness.logCount; > var suite = this; > var result = this.testcases.reduce(function(chain, testcase, i) { > return chain.then(function() { >- if (i > 0 && priorLogCount + 1 < ProtocolTest.logCount) >- ProtocolTest.log(""); >+ if (i > 0 && priorLogCount + 1 < suite._harness.logCount) >+ suite._harness.log(""); > >- priorLogCount = ProtocolTest.logCount; >- ProtocolTest.log("-- Running test case: " + testcase.name); >+ priorLogCount = suite._harness.logCount; >+ suite._harness.log("-- Running test case: " + testcase.name); > suite.runCount++; > return new Promise(testcase.test); > }); >@@ -261,18 +199,22 @@ ProtocolTest.AsyncTestSuite = class AsyncTestSuite { > if (typeof message !== "string") > message = JSON.stringify(message); > >- ProtocolTest.log("!! EXCEPTION: " + message); >+ suite._harness.log("!! EXCEPTION: " + message); > throw e; // Reject this promise by re-throwing the error. > }); > } > } > >-ProtocolTest.SyncTestSuite = class SyncTestSuite { >- constructor(name) { >+InjectedTestHarness.SyncTestSuite = class SyncTestSuite { >+ constructor(harness, name) { >+ if (!(harness instanceof InjectedTestHarness)) >+ throw new Error("Must pass the test's harness as the first argument."); >+ > if (!name || typeof name !== "string") > throw new Error("Tried to create SyncTestSuite without string suite name."); > > this.name = name; >+ this._harness = harness; > > this.testcases = []; > this.runCount = 0; >@@ -310,7 +252,7 @@ ProtocolTest.SyncTestSuite = class SyncTestSuite { > runTestCasesAndFinish() > { > this.runTestCases(); >- ProtocolTest.completeTest(); >+ this._harness.completeTest(); > } > > runTestCases() >@@ -322,19 +264,19 @@ ProtocolTest.SyncTestSuite = class SyncTestSuite { > > this._startedRunning = true; > >- ProtocolTest.log(""); >- ProtocolTest.log("== Running test suite: " + this.name); >+ this._harness.log(""); >+ this._harness.log("== Running test suite: " + this.name); > >- var priorLogCount = ProtocolTest.logCount; >+ var priorLogCount = this._harness.logCount; > var suite = this; > for (var i = 0; i < this.testcases.length; i++) { > var testcase = this.testcases[i]; >- if (i > 0 && priorLogCount + 1 < ProtocolTest.logCount) >- ProtocolTest.log(""); >+ if (i > 0 && priorLogCount + 1 < this._harness.logCount) >+ this._harness.log(""); > >- priorLogCount = ProtocolTest.logCount; >+ priorLogCount = this._harness.logCount; > >- ProtocolTest.log("-- Running test case: " + testcase.name); >+ this._harness.log("-- Running test case: " + testcase.name); > suite.runCount++; > try { > var result = testcase.test.call(null); >@@ -353,7 +295,7 @@ ProtocolTest.SyncTestSuite = class SyncTestSuite { > if (typeof message !== "string") > message = JSON.stringify(message); > >- ProtocolTest.log("!! EXCEPTION: " + message); >+ this._harness.log("!! EXCEPTION: " + message); > return false; > } > } >@@ -362,46 +304,187 @@ ProtocolTest.SyncTestSuite = class SyncTestSuite { > } > } > >-// Logs a message to test document. >-ProtocolTest.log = function(message) >+class ProtocolTestHarness extends InjectedTestHarness > { >- ++ProtocolTest.logCount; >+ // InjectedTestHarness Overrides > >- if (this.forceSyncDebugLogging) >- this.debugLog(message); >- else >- InspectorProtocol.sendCommand("Runtime.evaluate", { "expression": "log(" + JSON.stringify(message) + ")" } ); >+ completeTest() >+ { >+ this.evaluateInPage("closeTest();"); >+ } >+ >+ addResult(message) >+ { >+ // Unfortunately, every string argument must be escaped because tests are not consistent >+ // with respect to escaping with single or double quotes. Some exceptions use single quotes. >+ var stringifiedMessage = typeof message !== "string" ? JSON.stringify(message) : message; >+ this.evaluateInPage("log(unescape('" + escape(stringifiedMessage) + "'));"); >+ } >+ >+ debugLog(message) >+ { >+ var stringifiedMessage = typeof message !== "string" ? JSON.stringify(message) : message; >+ this.evaluateInPage("debugLog(unescape('" + escape(stringifiedMessage) + "'));") >+ } >+ >+ evaluateInPage(expression, callback) >+ { >+ let args = { >+ method: "Runtime.evaluate", >+ params: {expression} >+ } >+ >+ if (typeof callback === "function") >+ InspectorProtocol.sendCommand(args, callback); >+ else >+ return InspectorProtocol.awaitCommand(args); >+ } > } > >-// Logs an assertion result to the test document. >-ProtocolTest.assert = function(condition, message) >+window.ProtocolTest = new ProtocolTestHarness(); >+ >+InspectorProtocol = {}; >+InspectorProtocol._dispatchTable = []; >+InspectorProtocol._requestId = -1; >+InspectorProtocol.eventHandler = {}; >+ >+InspectorProtocol.dumpInspectorProtocolMessages = false; >+ >+InspectorProtocol.sendCommand = function(methodOrObject, params, handler) > { >- var status = condition ? "PASS" : "FAIL"; >- var message = typeof message !== "string" ? JSON.stringify(message) : message; >- var formattedMessage = status + ": " + message; >- this.log(formattedMessage); >+ // Allow new-style arguments object, as in awaitCommand. >+ var method = methodOrObject; >+ if (typeof methodOrObject === "object") >+ var {method, params, handler} = methodOrObject; >+ >+ this._dispatchTable[++this._requestId] = handler; >+ var messageObject = {method, params, "id": this._requestId}; >+ this.sendMessage(messageObject); >+ >+ return this._requestId; > } > >-// Logs message a directly to stdout of the test process via alert function. >-// This message should survive process crash or kill by timeout. >-ProtocolTest.debugLog = function(message) >+InspectorProtocol.awaitCommand = function(args) > { >- InspectorProtocol.sendCommand("Runtime.evaluate", { "expression": "debugLog(" + JSON.stringify(message) + ")" } ); >+ var {method, params} = args; >+ return new Promise(function(resolve, reject) { >+ this._dispatchTable[++this._requestId] = {resolve, reject}; >+ var messageObject = {method, params, "id": this._requestId}; >+ this.sendMessage(messageObject); >+ }.bind(this)); > } > >-ProtocolTest.completeTest = function() >+InspectorProtocol.awaitEvent = function(args) > { >- InspectorProtocol.sendCommand("Runtime.evaluate", { "expression": "closeTest();"} ); >+ var {event} = args; >+ if (typeof event !== "string") >+ throw new Error("Event must be a string."); >+ >+ return new Promise(function(resolve, reject) { >+ InspectorProtocol.eventHandler[event] = function(message) { >+ InspectorProtocol.eventHandler[event] = undefined; >+ resolve(message); >+ } >+ }); > } > >-ProtocolTest.importScript = function(scriptName) >+InspectorProtocol.addEventListener = function(eventTypeOrObject, listener) > { >- var xhr = new XMLHttpRequest(); >- var isAsyncRequest = false; >- xhr.open("GET", scriptName, isAsyncRequest); >- xhr.send(null); >- if (xhr.status !== 0 && xhr.status !== 200) >- throw new Error("Invalid script URL: " + scriptName); >- var script = "try { " + xhr.responseText + "} catch (e) { alert(" + JSON.stringify("Error in: " + scriptName) + "); throw e; }"; >- window.eval(script); >+ var event = eventTypeOrObject; >+ if (typeof eventTypeOrObject === "object") >+ var {event, listener} = eventTypeOrObject; >+ >+ if (typeof event !== "string") >+ throw new Error("Event name must be a string."); >+ >+ if (typeof listener !== "function") >+ throw new Error("Event listener must be callable."); >+ >+ // Convert to an array of listeners. >+ var listeners = InspectorProtocol.eventHandler[event]; >+ if (!listeners) >+ listeners = InspectorProtocol.eventHandler[event] = []; >+ else if (typeof listeners === "function") >+ listeners = InspectorProtocol.eventHandler[event] = [listeners]; >+ >+ // Prevent registering multiple times. >+ if (listeners.includes(listener)) >+ throw new Error("Cannot register the same listener more than once."); >+ >+ listeners.push(listener); >+} >+ >+InspectorProtocol.sendMessage = function(messageObject) >+{ >+ // This matches the debug dumping in InspectorBackend, which is bypassed >+ // by InspectorProtocol. Return messages should be dumped by InspectorBackend. >+ if (InspectorProtocol.dumpInspectorProtocolMessages) >+ console.log("frontend: " + JSON.stringify(messageObject)); >+ >+ InspectorFrontendHost.sendMessageToBackend(JSON.stringify(messageObject)); >+} >+ >+InspectorProtocol.checkForError = function(responseObject) >+{ >+ if (responseObject.error) { >+ ProtocolTest.log("PROTOCOL ERROR: " + JSON.stringify(responseObject.error)); >+ ProtocolTest.completeTest(); >+ throw "PROTOCOL ERROR"; >+ } >+} >+ >+InspectorFrontendAPI.dispatchMessageAsync = function(messageObject) >+{ >+ // This matches the debug dumping in InspectorBackend, which is bypassed >+ // by InspectorProtocol. Return messages should be dumped by InspectorBackend. >+ if (InspectorProtocol.dumpInspectorProtocolMessages) >+ console.log("backend: " + JSON.stringify(messageObject)); >+ >+ // If the message has an id, then it is a reply to a command. >+ var messageId = messageObject["id"]; >+ if (typeof messageId === "number") { >+ var handler = InspectorProtocol._dispatchTable[messageId]; >+ if (!handler) >+ return; >+ >+ if (typeof handler === "function") >+ handler(messageObject); >+ else if (typeof handler === "object") { >+ var {resolve, reject} = handler; >+ if ("error" in messageObject) >+ reject(messageObject.error.message); >+ else >+ resolve(messageObject.result); >+ } >+ // Otherwise, it is an event. >+ } else { >+ var eventName = messageObject["method"]; >+ var handler = InspectorProtocol.eventHandler[eventName]; >+ if (!handler) >+ return; >+ >+ if (typeof handler === "function") >+ handler(messageObject); >+ else if (handler instanceof Array) { >+ handler.map(function(listener) { >+ listener.call(null, messageObject); >+ }); >+ } else if (typeof handler === "object") { >+ var {resolve, reject} = handler; >+ if ("error" in messageObject) >+ reject(messageObject.error.message); >+ else >+ resolve(messageObject.result); >+ } >+ } > } >+ >+window.addEventListener("message", function(event) { >+ try { >+ eval(event.data); >+ } catch (e) { >+ alert(e.stack); >+ ProtocolTest.completeTest(); >+ throw e; >+ } >+}); >\ No newline at end of file >diff --git a/LayoutTests/http/tests/inspector/resources/console-test.js b/LayoutTests/http/tests/inspector/resources/console-test.js >index ab5906b8db75804a249fa4d632a5f4f7c3bebd1f..2d4e37fe0a4fbf0ff6747839ba5bba74252fa58c 100644 >--- a/LayoutTests/http/tests/inspector/resources/console-test.js >+++ b/LayoutTests/http/tests/inspector/resources/console-test.js >@@ -32,7 +32,7 @@ ProtocolTest.Console.sanitizeConsoleMessage = function(messageObject) > > ProtocolTest.Console.addTestCase = function(suite, args) > { >- if (!(suite instanceof ProtocolTest.AsyncTestSuite)) >+ if (!(suite instanceof InjectedTestHarness.AsyncTestSuite)) > throw new Error("Console test cases must be added to an async test suite."); > > var {name, description, expression, expected} = args; >@@ -46,17 +46,17 @@ ProtocolTest.Console.addTestCase = function(suite, args) > .then(function(messageObject) { > var consoleMessage = messageObject.params.message; > var {source, level, text, parameters} = consoleMessage; >- ProtocolTest.assert(source === expected.source, "ConsoleMessage type should be '" + expected.source + "'."); >- ProtocolTest.assert(level === expected.level, "ConsoleMessage level should be '" + expected.level + "'."); >+ ProtocolTest.expectThat(source === expected.source, "ConsoleMessage type should be '" + expected.source + "'."); >+ ProtocolTest.expectThat(level === expected.level, "ConsoleMessage level should be '" + expected.level + "'."); > > if (expected.text) >- ProtocolTest.assert(text === expected.text, "ConsoleMessage text should be '" + expected.text + "'."); >+ ProtocolTest.expectThat(text === expected.text, "ConsoleMessage text should be '" + expected.text + "'."); > > if (expected.parameters) { >- ProtocolTest.assert(parameters.length === expected.parameters.length, "ConsoleMessage parameters.length === " + expected.parameters.length); >+ ProtocolTest.expectThat(parameters.length === expected.parameters.length, "ConsoleMessage parameters.length === " + expected.parameters.length); > for (var i = 0; i < parameters.length; ++i) { > var expectedType = expected.parameters[i]; >- ProtocolTest.assert(parameters[i].type === expectedType, "ConsoleMessage parameter " + i + " should have type '" + expectedType + "'."); >+ ProtocolTest.expectThat(parameters[i].type === expectedType, "ConsoleMessage parameter " + i + " should have type '" + expectedType + "'."); > } > } > >diff --git a/LayoutTests/http/tests/inspector/resources/protocol-test.js b/LayoutTests/http/tests/inspector/resources/protocol-test.js >index a4a9c571e69aa4597662a15f9e1f750b69a97ce3..f881d474ed6e50f4ab0c2192f7e10a91d8b4e8f6 100644 >--- a/LayoutTests/http/tests/inspector/resources/protocol-test.js >+++ b/LayoutTests/http/tests/inspector/resources/protocol-test.js >@@ -59,6 +59,7 @@ function log(text) > function closeTest() > { > window.internals.closeDummyInspectorFrontend(); >+ > // This code might be executed while the debugger is still running through a stack based EventLoop. > // Use a setTimeout to defer to a clean stack before letting the testRunner load the next test. > setTimeout(function() { >diff --git a/LayoutTests/inspector/console/console-message.html b/LayoutTests/inspector/console/console-message.html >index d9b2fe626cd48e4978ccad3ec29e92c4c0548e94..8fb3f96e6909d3d71731662932518921bfd80d71 100644 >--- a/LayoutTests/inspector/console/console-message.html >+++ b/LayoutTests/inspector/console/console-message.html >@@ -16,7 +16,7 @@ function test() > { > ProtocolTest.importScript("console-test.js"); > >- var suite = new ProtocolTest.AsyncTestSuite("Console.MessagesFromCommandLineAPI"); >+ var suite = ProtocolTest.createAsyncSuite("Console.MessagesFromCommandLineAPI"); > > ProtocolTest.Console.addTestCase(suite, { > name: "ConsoleLogString", >diff --git a/LayoutTests/inspector/console/x-frame-options-message.html b/LayoutTests/inspector/console/x-frame-options-message.html >index f8be31ad8bc9e859c5e2c493e47a651a7b9e5cab..9670df1a7c7e13d1bd48cc8c083cf716085b0c05 100644 >--- a/LayoutTests/inspector/console/x-frame-options-message.html >+++ b/LayoutTests/inspector/console/x-frame-options-message.html >@@ -7,7 +7,7 @@ function test() > { > ProtocolTest.importScript("console-test.js"); > >- let suite = new ProtocolTest.AsyncTestSuite("Console.XFrameOptionsMessages"); >+ let suite = ProtocolTest.createAsyncSuite("Console.XFrameOptionsMessages"); > > ProtocolTest.Console.addTestCase(suite, { > name: "XFrameOptionsDeny", >diff --git a/LayoutTests/inspector/debugger/didSampleProbe-multiple-probes.html b/LayoutTests/inspector/debugger/didSampleProbe-multiple-probes.html >index b3bf1d17e709636083c100c43320e4b7adf0eddc..35d0799f28e2d8db2e9cbd57d2eff847901efc90 100644 >--- a/LayoutTests/inspector/debugger/didSampleProbe-multiple-probes.html >+++ b/LayoutTests/inspector/debugger/didSampleProbe-multiple-probes.html >@@ -78,7 +78,7 @@ function test() > if (receivedAllExpectedSamples()) { > tests.forEach(function(test) { > var result = test.predicate(); >- ProtocolTest.assert(result, test.message); >+ ProtocolTest.expectThat(result, test.message); > if (!result) > test.error(); > }); >diff --git a/LayoutTests/inspector/dom-debugger/node-removed.html b/LayoutTests/inspector/dom-debugger/node-removed.html >index ac78beb88d033e52c5b59e7809506d9a47abe45d..2a2b86ed2184c8445cb0c55caf264818a6726dc5 100644 >--- a/LayoutTests/inspector/dom-debugger/node-removed.html >+++ b/LayoutTests/inspector/dom-debugger/node-removed.html >@@ -70,15 +70,15 @@ function test() > function onChildNodeRemoved(response) > { > var nodeId = response.params.nodeId; >- ProtocolTest.assert(getNodeIdentifier(nodeId) === "div#target_element", "onChildNodeRemoved called for #target_element"); >+ ProtocolTest.expectThat(getNodeIdentifier(nodeId) === "div#target_element", "onChildNodeRemoved called for #target_element"); > delete nodesById[nodeId]; > } > > function onChildNodeInserted(response) > { > collectNode(response.params.node); >- ProtocolTest.assert(getNodeIdentifier(response.params.parentNodeId) === "div#final_container", "onChildNodeInserted called for parent node #final_container"); >- ProtocolTest.assert(getNodeIdentifier(response.params.node.nodeId) === "div#target_element", "onChildNodeInserted called for child node #target_element"); >+ ProtocolTest.expectThat(getNodeIdentifier(response.params.parentNodeId) === "div#final_container", "onChildNodeInserted called for parent node #final_container"); >+ ProtocolTest.expectThat(getNodeIdentifier(response.params.node.nodeId) === "div#target_element", "onChildNodeInserted called for child node #target_element"); > } > > function onDebuggerPaused(response) >diff --git a/LayoutTests/inspector/dom/dom-remove-events.html b/LayoutTests/inspector/dom/dom-remove-events.html >index 08c9b08ecac4aab5fc3e60843ec0b4e6dcfeddd5..e01df0474967928d1aff1d22bf354e5a4b159082 100644 >--- a/LayoutTests/inspector/dom/dom-remove-events.html >+++ b/LayoutTests/inspector/dom/dom-remove-events.html >@@ -47,15 +47,15 @@ function test() > function onChildNodeRemoved(response) > { > var nodeId = response.params.nodeId; >- ProtocolTest.assert(getNodeIdentifier(nodeId) === "target_element", "onChildNodeRemoved called for #target_element"); >+ ProtocolTest.expectThat(getNodeIdentifier(nodeId) === "target_element", "onChildNodeRemoved called for #target_element"); > delete nodesById[nodeId]; > } > > function onChildNodeInserted(response) > { > collectNode(response.params.node); >- ProtocolTest.assert(getNodeIdentifier(response.params.parentNodeId) === "final_container", "onChildNodeInserted called for parent node #final_container"); >- ProtocolTest.assert(getNodeIdentifier(response.params.node.nodeId) === "target_element", "onChildNodeInserted called for child node #target_element"); >+ ProtocolTest.expectThat(getNodeIdentifier(response.params.parentNodeId) === "final_container", "onChildNodeInserted called for parent node #final_container"); >+ ProtocolTest.expectThat(getNodeIdentifier(response.params.node.nodeId) === "target_element", "onChildNodeInserted called for child node #target_element"); > } > > InspectorProtocol.sendCommand("DOM.getDocument", {}, onGotDocument); >diff --git a/LayoutTests/inspector/runtime/getProperties.html b/LayoutTests/inspector/runtime/getProperties.html >index b11b64d612bfde678f14b0d34b7557464605ce16..66e2324f9fb58d85aa3c57335d6a9185db98abaa 100644 >--- a/LayoutTests/inspector/runtime/getProperties.html >+++ b/LayoutTests/inspector/runtime/getProperties.html >@@ -4,7 +4,7 @@ > <script> > function test() > { >- var suite = new ProtocolTest.AsyncTestSuite("Runtime.getProperties"); >+ var suite = ProtocolTest.createAsyncSuite("Runtime.getProperties"); > > addGetPropertiesTestCase({ > name: "CheckPropertiesOfWrapperObject", >diff --git a/LayoutTests/inspector/unit-tests/async-test-suite-expected.txt b/LayoutTests/inspector/unit-tests/async-test-suite-expected.txt >index ea33a77856f485226d0df9960cdb946954178bd0..0e84a778f266f98f0447e9ac2c63c3054d51eeb0 100644 >--- a/LayoutTests/inspector/unit-tests/async-test-suite-expected.txt >+++ b/LayoutTests/inspector/unit-tests/async-test-suite-expected.txt >@@ -1,5 +1,6 @@ >-PASS: instantiating AsyncTestSuite requires name argument. >-PASS: instantiating AsyncTestSuite requires string name argument. >+PASS: instantiating SyncTestSuite requires name argument. >+PASS: instantiating SyncTestSuite requires string name argument. >+PASS: instantiating SyncTestSuite requires test harness argument. > PASS: should not be able to add empty test case. > PASS: should not be able to add non-object test case. > PASS: test case should require string name. >diff --git a/LayoutTests/inspector/unit-tests/async-test-suite.html b/LayoutTests/inspector/unit-tests/async-test-suite.html >index 863148afd8154bcc5dcb1b54b17fa126d50e9079..bdfbacc1fb634568a07978318afc5c1d9a80a9ec 100644 >--- a/LayoutTests/inspector/unit-tests/async-test-suite.html >+++ b/LayoutTests/inspector/unit-tests/async-test-suite.html >@@ -6,20 +6,27 @@ > function test() > { > try { >- new ProtocolTest.AsyncTestSuite(); >- ProtocolTest.log("FAIL: instantiating AsyncTestSuite requires name argument."); >+ let result = new InjectedTestHarness.AsyncTestSuite(this); >+ ProtocolTest.log("FAIL: instantiating SyncTestSuite requires name argument."); > } catch (e) { >- ProtocolTest.log("PASS: instantiating AsyncTestSuite requires name argument."); >+ ProtocolTest.log("PASS: instantiating SyncTestSuite requires name argument."); > } > > try { >- new ProtocolTest.AsyncTestSuite({}); >- ProtocolTest.log("FAIL: instantiating AsyncTestSuite requires string name argument."); >+ let result = new InjectedTestHarness.AsyncTestSuite(this, {}); >+ ProtocolTest.log("FAIL: instantiating SyncTestSuite requires string name argument."); > } catch (e) { >- ProtocolTest.log("PASS: instantiating AsyncTestSuite requires string name argument."); >+ ProtocolTest.log("PASS: instantiating SyncTestSuite requires string name argument."); > } > >- var badArgsSuite = new ProtocolTest.AsyncTestSuite("dummy"); >+ try { >+ let result = new InjectedTestHarness.AsyncTestSuite("something", {}); >+ ProtocolTest.log("FAIL: instantiating SyncTestSuite requires test harness argument."); >+ } catch (e) { >+ ProtocolTest.log("PASS: instantiating SyncTestSuite requires test harness argument."); >+ } >+ >+ var badArgsSuite = ProtocolTest.createAsyncSuite("dummy"); > try { > badArgsSuite.addTestCase(); > ProtocolTest.log("FAIL: should not be able to add empty test case."); >@@ -51,7 +58,7 @@ function test() > ProtocolTest.log("PASS: test case should require test function."); > } > >- var runEmptySuite = new ProtocolTest.AsyncTestSuite("AsyncTestSuite.RunEmptySuite"); >+ var runEmptySuite = ProtocolTest.createAsyncSuite("AsyncTestSuite.RunEmptySuite"); > try { > runEmptySuite.runTestCases(); > ProtocolTest.log("FAIL: should not be able to run empty test suite."); >@@ -59,7 +66,7 @@ function test() > ProtocolTest.log("PASS: should not be able to run empty test suite."); > } > >- var runTwiceSuite = new ProtocolTest.AsyncTestSuite("AsyncTestSuite.RunTwiceSuite"); >+ var runTwiceSuite = ProtocolTest.createAsyncSuite("AsyncTestSuite.RunTwiceSuite"); > runTwiceSuite.addTestCase({ > name: "DummyTest0", > description: "Check that a suite can't run more than once.", >@@ -81,7 +88,7 @@ function test() > var rejectToken = {"token": 666}; > var thrownError = new Error(rejectToken); > >- var sequentialExecutionSuite = new ProtocolTest.AsyncTestSuite("AsyncTestSuite.SequentialExecution"); >+ var sequentialExecutionSuite = ProtocolTest.createAsyncSuite("AsyncTestSuite.SequentialExecution"); > sequentialExecutionSuite.addTestCase({ > name: "DummyTest1", > description: "Check test case execution order.", >@@ -111,7 +118,7 @@ function test() > } > }); > >- var abortOnFailureSuite = new ProtocolTest.AsyncTestSuite("AsyncTestSuite.AbortOnFailure"); >+ var abortOnFailureSuite = ProtocolTest.createAsyncSuite("AsyncTestSuite.AbortOnFailure"); > abortOnFailureSuite.addTestCase({ > name: "PassingTest5", > description: "This test is a dummy.", >@@ -136,7 +143,7 @@ function test() > > result = result.then(function() { > var promise = sequentialExecutionSuite.runTestCases(); >- ProtocolTest.assert(result instanceof Promise, "AsyncTestSuite.RunTestCases() should return a Promise."); >+ ProtocolTest.expectThat(result instanceof Promise, "AsyncTestSuite.RunTestCases() should return a Promise."); > return promise; > }); > result = result.then(function resolved() { >@@ -144,12 +151,12 @@ function test() > return Promise.resolve(); // Continue this test. > }, function rejected(e) { > ProtocolTest.log("PASS: Promise from sequentialExecutionSuite.runTestCases() should reject when a test case fails."); >- ProtocolTest.assert(e === thrownError, "Promise from sequentialExecutionSuite.runTestCases() should reject without altering its result value."); >+ ProtocolTest.expectThat(e === thrownError, "Promise from sequentialExecutionSuite.runTestCases() should reject without altering its result value."); > >- ProtocolTest.assert(sequentialExecutionSuite.runCount === 4, "sequentialExecutionSuite should have executed four tests."); >- ProtocolTest.assert(sequentialExecutionSuite.passCount === 3, "sequentialExecutionSuite should have passed three tests."); >- ProtocolTest.assert(sequentialExecutionSuite.failCount === 1, "sequentialExecutionSuite should have failed 1 test."); >- ProtocolTest.assert(sequentialExecutionSuite.skipCount === 0, "sequentialExecutionSuite should have skipped zero tests."); >+ ProtocolTest.expectThat(sequentialExecutionSuite.runCount === 4, "sequentialExecutionSuite should have executed four tests."); >+ ProtocolTest.expectThat(sequentialExecutionSuite.passCount === 3, "sequentialExecutionSuite should have passed three tests."); >+ ProtocolTest.expectThat(sequentialExecutionSuite.failCount === 1, "sequentialExecutionSuite should have failed 1 test."); >+ ProtocolTest.expectThat(sequentialExecutionSuite.skipCount === 0, "sequentialExecutionSuite should have skipped zero tests."); > return Promise.resolve(); // Continue this test. > }); > >@@ -160,11 +167,11 @@ function test() > return Promise.resolve(); // Continue this test. > }, function rejected(e) { > ProtocolTest.log("PASS: Promise from abortOnFailureSuite.runTestCases() should reject when a test case fails."); >- ProtocolTest.assert(e === rejectToken, "Promise from abortOnFailureSuite.runTestCases() should reject without altering its result value."); >- ProtocolTest.assert(abortOnFailureSuite.runCount === 2, "abortOnFailureSuite should have executed two tests."); >- ProtocolTest.assert(abortOnFailureSuite.passCount === 1, "abortOnFailureSuite should have passed one test."); >- ProtocolTest.assert(abortOnFailureSuite.failCount === 1, "abortOnFailureSuite should have failed one test."); >- ProtocolTest.assert(abortOnFailureSuite.skipCount === 1, "abortOnFailureSuite should have skipped one test."); >+ ProtocolTest.expectThat(e === rejectToken, "Promise from abortOnFailureSuite.runTestCases() should reject without altering its result value."); >+ ProtocolTest.expectThat(abortOnFailureSuite.runCount === 2, "abortOnFailureSuite should have executed two tests."); >+ ProtocolTest.expectThat(abortOnFailureSuite.passCount === 1, "abortOnFailureSuite should have passed one test."); >+ ProtocolTest.expectThat(abortOnFailureSuite.failCount === 1, "abortOnFailureSuite should have failed one test."); >+ ProtocolTest.expectThat(abortOnFailureSuite.skipCount === 1, "abortOnFailureSuite should have skipped one test."); > > return Promise.resolve(); // Continue this test. > }); >diff --git a/LayoutTests/inspector/unit-tests/sync-test-suite-expected.txt b/LayoutTests/inspector/unit-tests/sync-test-suite-expected.txt >index 92de62c45b2b8c65d9c1e74cbd856b0db38e32c2..256bb1955f66327a7d243191225e9d135575eeb0 100644 >--- a/LayoutTests/inspector/unit-tests/sync-test-suite-expected.txt >+++ b/LayoutTests/inspector/unit-tests/sync-test-suite-expected.txt >@@ -1,5 +1,6 @@ > PASS: instantiating SyncTestSuite requires name argument. > PASS: instantiating SyncTestSuite requires string name argument. >+PASS: instantiating SyncTestSuite requires test harness argument. > PASS: should not be able to add empty test case. > PASS: should not be able to add non-object test case. > PASS: test case should require string name. >diff --git a/LayoutTests/inspector/unit-tests/sync-test-suite.html b/LayoutTests/inspector/unit-tests/sync-test-suite.html >index 984350819b16f70742bd055c41ed3a2f2e392bd2..ec486ac5bf5c18ad994e0702492d5432c95d21a8 100644 >--- a/LayoutTests/inspector/unit-tests/sync-test-suite.html >+++ b/LayoutTests/inspector/unit-tests/sync-test-suite.html >@@ -6,20 +6,27 @@ > function test() > { > try { >- new ProtocolTest.SyncTestSuite(); >+ let result = new ProtocolTest.SyncTestSuite(this); > ProtocolTest.log("FAIL: instantiating SyncTestSuite requires name argument."); > } catch (e) { > ProtocolTest.log("PASS: instantiating SyncTestSuite requires name argument."); > } > > try { >- new ProtocolTest.SyncTestSuite({}); >+ let result = new ProtocolTest.SyncTestSuite(this, {}); > ProtocolTest.log("FAIL: instantiating SyncTestSuite requires string name argument."); > } catch (e) { > ProtocolTest.log("PASS: instantiating SyncTestSuite requires string name argument."); > } > >- var badArgsSuite = new ProtocolTest.SyncTestSuite("dummy"); >+ try { >+ let result = new ProtocolTest.SyncTestSuite("something", {}); >+ ProtocolTest.log("FAIL: instantiating SyncTestSuite requires test harness argument."); >+ } catch (e) { >+ ProtocolTest.log("PASS: instantiating SyncTestSuite requires test harness argument."); >+ } >+ >+ var badArgsSuite = ProtocolTest.createSyncSuite("dummy"); > try { > badArgsSuite.addTestCase(); > ProtocolTest.log("FAIL: should not be able to add empty test case."); >@@ -51,7 +58,7 @@ function test() > ProtocolTest.log("PASS: test case should require test function."); > } > >- var runEmptySuite = new ProtocolTest.SyncTestSuite("SyncTestSuite.RunEmptySuite"); >+ var runEmptySuite = ProtocolTest.createSyncSuite("SyncTestSuite.RunEmptySuite"); > try { > runEmptySuite.runTestCases(); > ProtocolTest.log("FAIL: should not be able to run empty test suite."); >@@ -59,7 +66,7 @@ function test() > ProtocolTest.log("PASS: should not be able to run empty test suite."); > } > >- var runTwiceSuite = new ProtocolTest.SyncTestSuite("SyncTestSuite.RunTwiceSuite"); >+ var runTwiceSuite = ProtocolTest.createSyncSuite("SyncTestSuite.RunTwiceSuite"); > runTwiceSuite.addTestCase({ > name: "DummyTest0", > description: "Check that a suite can't run more than once.", >@@ -68,7 +75,7 @@ function test() > > try { > var result = runTwiceSuite.runTestCases(); >- ProtocolTest.assert(result === true, "Return value of runTwiceSuite.runTestCases() should be true when all tests pass."); >+ ProtocolTest.expectThat(result === true, "Return value of runTwiceSuite.runTestCases() should be true when all tests pass."); > > runTwiceSuite.runTestCases(); // Try to trigger an error. > ProtocolTest.log("FAIL: should not be able to run a test suite twice."); >@@ -78,7 +85,7 @@ function test() > > var thrownError = new Error({"token": 666}); > >- var sequentialExecutionSuite = new ProtocolTest.SyncTestSuite("SyncTestSuite.SequentialExecution"); >+ var sequentialExecutionSuite = ProtocolTest.createSyncSuite("SyncTestSuite.SequentialExecution"); > sequentialExecutionSuite.addTestCase({ > name: "DummyTest1", > description: "Check test case execution order.", >@@ -101,13 +108,13 @@ function test() > }); > > var result = sequentialExecutionSuite.runTestCases(); >- ProtocolTest.assert(result === false, "Return value of sequentialExecutionSuite.runTestCases() should be false when a test case fails."); >- ProtocolTest.assert(sequentialExecutionSuite.runCount === 4, "sequentialExecutionSuite should have executed four tests."); >- ProtocolTest.assert(sequentialExecutionSuite.passCount === 3, "sequentialExecutionSuite should have passed three tests."); >- ProtocolTest.assert(sequentialExecutionSuite.failCount === 1, "sequentialExecutionSuite should have failed 1 test."); >- ProtocolTest.assert(sequentialExecutionSuite.skipCount === 0, "sequentialExecutionSuite should have skipped zero tests."); >+ ProtocolTest.expectThat(result === false, "Return value of sequentialExecutionSuite.runTestCases() should be false when a test case fails."); >+ ProtocolTest.expectThat(sequentialExecutionSuite.runCount === 4, "sequentialExecutionSuite should have executed four tests."); >+ ProtocolTest.expectThat(sequentialExecutionSuite.passCount === 3, "sequentialExecutionSuite should have passed three tests."); >+ ProtocolTest.expectThat(sequentialExecutionSuite.failCount === 1, "sequentialExecutionSuite should have failed 1 test."); >+ ProtocolTest.expectThat(sequentialExecutionSuite.skipCount === 0, "sequentialExecutionSuite should have skipped zero tests."); > >- var abortOnFailureSuite = new ProtocolTest.SyncTestSuite("SyncTestSuite.AbortOnFailure"); >+ var abortOnFailureSuite = ProtocolTest.createSyncSuite("SyncTestSuite.AbortOnFailure"); > abortOnFailureSuite.addTestCase({ > name: "PassingTest5", > description: "This test is a dummy.", >@@ -125,11 +132,11 @@ function test() > }); > > abortOnFailureSuite.runTestCases(); >- ProtocolTest.assert(result === false, "Return value of abortOnFailureSuite.runTestCases() should be false when a test case fails."); >- ProtocolTest.assert(abortOnFailureSuite.runCount === 2, "abortOnFailureSuite should have executed two tests."); >- ProtocolTest.assert(abortOnFailureSuite.passCount === 1, "abortOnFailureSuite should have passed one test."); >- ProtocolTest.assert(abortOnFailureSuite.failCount === 1, "abortOnFailureSuite should have failed one test."); >- ProtocolTest.assert(abortOnFailureSuite.skipCount === 1, "abortOnFailureSuite should have skipped one test."); >+ ProtocolTest.expectThat(result === false, "Return value of abortOnFailureSuite.runTestCases() should be false when a test case fails."); >+ ProtocolTest.expectThat(abortOnFailureSuite.runCount === 2, "abortOnFailureSuite should have executed two tests."); >+ ProtocolTest.expectThat(abortOnFailureSuite.passCount === 1, "abortOnFailureSuite should have passed one test."); >+ ProtocolTest.expectThat(abortOnFailureSuite.failCount === 1, "abortOnFailureSuite should have failed one test."); >+ ProtocolTest.expectThat(abortOnFailureSuite.skipCount === 1, "abortOnFailureSuite should have skipped one test."); > > ProtocolTest.completeTest(); > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
joepeck
:
review+
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 147954
: 258847