Web Inspector: use different namespaces in test fixtures for protocol tests and frontend tests
https://bugs.webkit.org/show_bug.cgi?id=147787
Patch by Brian Burg <bburg@apple.com> on 2015-08-11
Reviewed by Timothy Hatcher.
Refactor test methods to use three distinct namespaces to reflect their implementation:
- InspectorProtocol contains commands that are only used from within protocol tests.
This includes sending and receiving protocol messages and checking message errors.
- InspectorTest contains test methods for full inspector frontend tests.
- ProtocolTest contains test methods for protocol tests.
In a subsequent patch, most methods in InspectorTest and ProtocolTest namespaces
will be unified so that implementations of log, assert, etc. are no longer duplicated.
For now, at least make it obvious at each callsite what code is being invoked.
* http/tests/inspector/console/access-inspected-object.html:
* http/tests/inspector/dom/resources/InspectorDOMListener.js:
* http/tests/inspector/page/loading-iframe-document-node.html:
* http/tests/inspector/resources/ProtocolTestStub.js:
* http/tests/inspector/resources/console-test.js:
* http/tests/inspector/resources/probe-test.js:
* inspector/console/console-message.html:
* inspector/console/css-source-locations.html:
* inspector/console/js-source-locations.html:
* inspector/console/x-frame-options-message.html:
* inspector/css/getSupportedCSSProperties.html:
* inspector/debugger/breakpoint-action-detach.html:
* inspector/debugger/breakpoint-action-with-exception.html:
* inspector/debugger/breakpoint-condition-detach.html:
* inspector/debugger/breakpoint-condition-with-bad-script.html:
* inspector/debugger/breakpoint-condition-with-exception.html:
* inspector/debugger/breakpoint-eval-with-exception.html:
* inspector/debugger/breakpoint-inside-conditons-and-actions.html:
* inspector/debugger/call-frame-function-name.html:
* inspector/debugger/call-frame-this-host.html:
* inspector/debugger/call-frame-this-nonstrict.html:
* inspector/debugger/call-frame-this-strict.html:
* inspector/debugger/debugger-statement.html:
* inspector/debugger/didSampleProbe-multiple-probes.html:
* inspector/debugger/hit-breakpoint-from-console.html:
* inspector/debugger/nested-inspectors.html:
* inspector/debugger/pause-dedicated-worker.html:
* inspector/debugger/pause-on-assert.html:
* inspector/debugger/regress-133182.html:
* inspector/debugger/removeBreakpoint.html:
* inspector/debugger/searchInContent-linebreaks.html:
* inspector/debugger/setBreakpoint-actions.html:
* inspector/debugger/setBreakpoint-autoContinue.html:
* inspector/debugger/setBreakpoint-column.html:
* inspector/debugger/setBreakpoint-condition.html:
* inspector/debugger/setBreakpoint-dfg-and-modify-local.html:
* inspector/debugger/setBreakpoint-dfg-callee-and-examine-dfg-local.html:
* inspector/debugger/setBreakpoint-dfg.html:
* inspector/debugger/setBreakpoint-options-exception.html:
* inspector/debugger/setBreakpoint.html:
* inspector/debugger/setBreakpointByUrl-sourceURL.html:
* inspector/debugger/setPauseOnExceptions-all.html:
* inspector/debugger/setPauseOnExceptions-none.html:
* inspector/debugger/setPauseOnExceptions-uncaught.html:
* inspector/debugger/setVariableValue.html:
* inspector/debugger/terminate-dedicated-worker-while-paused.html:
* inspector/dom-debugger/node-removed.html:
* inspector/dom/dom-remove-events.html:
* inspector/dom/dom-search-crash.html:
* inspector/dom/dom-search-with-context.html:
* inspector/dom/dom-search.html:
* inspector/dom/focus.html:
* inspector/dom/getAccessibilityPropertiesForNode.html:
* inspector/dom/getAccessibilityPropertiesForNode_liveRegion.html:
* inspector/dom/getAccessibilityPropertiesForNode_mouseEventNodeId.html:
* inspector/dom/highlight-flow-with-no-region.html:
* inspector/dom/remove-multiple-nodes.html:
* inspector/dom/request-child-nodes-depth.html:
* inspector/layers/layers-anonymous.html:
* inspector/layers/layers-blending-compositing-reasons.html:
* inspector/layers/layers-compositing-reasons.html:
* inspector/layers/layers-for-node.html:
* inspector/layers/layers-generated-content.html:
* inspector/layers/layers-reflected-content.html:
* inspector/page/archive.html:
* inspector/page/frameScheduledNavigation.html:
* inspector/page/frameStartedLoading.html:
* inspector/page/javascriptDialogEvents.html:
* inspector/page/setEmulatedMedia.html:
* inspector/runtime/getProperties.html:
* inspector/unit-tests/async-test-suite.html:
* inspector/unit-tests/sync-test-suite.html:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@188267 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index d120916..6fc1169 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,96 @@
+2015-08-11 Brian Burg <bburg@apple.com>
+
+ Web Inspector: use different namespaces in test fixtures for protocol tests and frontend tests
+ https://bugs.webkit.org/show_bug.cgi?id=147787
+
+ Reviewed by Timothy Hatcher.
+
+ Refactor test methods to use three distinct namespaces to reflect their implementation:
+
+ - InspectorProtocol contains commands that are only used from within protocol tests.
+ This includes sending and receiving protocol messages and checking message errors.
+
+ - InspectorTest contains test methods for full inspector frontend tests.
+
+ - ProtocolTest contains test methods for protocol tests.
+
+ In a subsequent patch, most methods in InspectorTest and ProtocolTest namespaces
+ will be unified so that implementations of log, assert, etc. are no longer duplicated.
+ For now, at least make it obvious at each callsite what code is being invoked.
+
+ * http/tests/inspector/console/access-inspected-object.html:
+ * http/tests/inspector/dom/resources/InspectorDOMListener.js:
+ * http/tests/inspector/page/loading-iframe-document-node.html:
+ * http/tests/inspector/resources/ProtocolTestStub.js:
+ * http/tests/inspector/resources/console-test.js:
+ * http/tests/inspector/resources/probe-test.js:
+ * inspector/console/console-message.html:
+ * inspector/console/css-source-locations.html:
+ * inspector/console/js-source-locations.html:
+ * inspector/console/x-frame-options-message.html:
+ * inspector/css/getSupportedCSSProperties.html:
+ * inspector/debugger/breakpoint-action-detach.html:
+ * inspector/debugger/breakpoint-action-with-exception.html:
+ * inspector/debugger/breakpoint-condition-detach.html:
+ * inspector/debugger/breakpoint-condition-with-bad-script.html:
+ * inspector/debugger/breakpoint-condition-with-exception.html:
+ * inspector/debugger/breakpoint-eval-with-exception.html:
+ * inspector/debugger/breakpoint-inside-conditons-and-actions.html:
+ * inspector/debugger/call-frame-function-name.html:
+ * inspector/debugger/call-frame-this-host.html:
+ * inspector/debugger/call-frame-this-nonstrict.html:
+ * inspector/debugger/call-frame-this-strict.html:
+ * inspector/debugger/debugger-statement.html:
+ * inspector/debugger/didSampleProbe-multiple-probes.html:
+ * inspector/debugger/hit-breakpoint-from-console.html:
+ * inspector/debugger/nested-inspectors.html:
+ * inspector/debugger/pause-dedicated-worker.html:
+ * inspector/debugger/pause-on-assert.html:
+ * inspector/debugger/regress-133182.html:
+ * inspector/debugger/removeBreakpoint.html:
+ * inspector/debugger/searchInContent-linebreaks.html:
+ * inspector/debugger/setBreakpoint-actions.html:
+ * inspector/debugger/setBreakpoint-autoContinue.html:
+ * inspector/debugger/setBreakpoint-column.html:
+ * inspector/debugger/setBreakpoint-condition.html:
+ * inspector/debugger/setBreakpoint-dfg-and-modify-local.html:
+ * inspector/debugger/setBreakpoint-dfg-callee-and-examine-dfg-local.html:
+ * inspector/debugger/setBreakpoint-dfg.html:
+ * inspector/debugger/setBreakpoint-options-exception.html:
+ * inspector/debugger/setBreakpoint.html:
+ * inspector/debugger/setBreakpointByUrl-sourceURL.html:
+ * inspector/debugger/setPauseOnExceptions-all.html:
+ * inspector/debugger/setPauseOnExceptions-none.html:
+ * inspector/debugger/setPauseOnExceptions-uncaught.html:
+ * inspector/debugger/setVariableValue.html:
+ * inspector/debugger/terminate-dedicated-worker-while-paused.html:
+ * inspector/dom-debugger/node-removed.html:
+ * inspector/dom/dom-remove-events.html:
+ * inspector/dom/dom-search-crash.html:
+ * inspector/dom/dom-search-with-context.html:
+ * inspector/dom/dom-search.html:
+ * inspector/dom/focus.html:
+ * inspector/dom/getAccessibilityPropertiesForNode.html:
+ * inspector/dom/getAccessibilityPropertiesForNode_liveRegion.html:
+ * inspector/dom/getAccessibilityPropertiesForNode_mouseEventNodeId.html:
+ * inspector/dom/highlight-flow-with-no-region.html:
+ * inspector/dom/remove-multiple-nodes.html:
+ * inspector/dom/request-child-nodes-depth.html:
+ * inspector/layers/layers-anonymous.html:
+ * inspector/layers/layers-blending-compositing-reasons.html:
+ * inspector/layers/layers-compositing-reasons.html:
+ * inspector/layers/layers-for-node.html:
+ * inspector/layers/layers-generated-content.html:
+ * inspector/layers/layers-reflected-content.html:
+ * inspector/page/archive.html:
+ * inspector/page/frameScheduledNavigation.html:
+ * inspector/page/frameStartedLoading.html:
+ * inspector/page/javascriptDialogEvents.html:
+ * inspector/page/setEmulatedMedia.html:
+ * inspector/runtime/getProperties.html:
+ * inspector/unit-tests/async-test-suite.html:
+ * inspector/unit-tests/sync-test-suite.html:
+
2015-08-11 Myles C. Maxfield <mmaxfield@apple.com>
[iOS] Arabic letter Yeh is drawn in LastResort
diff --git a/LayoutTests/http/tests/inspector/console/access-inspected-object.html b/LayoutTests/http/tests/inspector/console/access-inspected-object.html
index ceebd9a..e537ddd 100644
--- a/LayoutTests/http/tests/inspector/console/access-inspected-object.html
+++ b/LayoutTests/http/tests/inspector/console/access-inspected-object.html
@@ -9,22 +9,22 @@
function test()
{
- InspectorTest.sendCommand("DOM.getDocument", {}, didGetDocument);
+ InspectorProtocol.sendCommand("DOM.getDocument", {}, didGetDocument);
function didGetDocument(messageObject)
{
- InspectorTest.sendCommand("DOM.querySelector", {
+ InspectorProtocol.sendCommand("DOM.querySelector", {
"nodeId": messageObject.result.root.nodeId,
"selector": "iframe#myframe"
}, didFindIframe);
- InspectorTest.eventHandler["DOM.setChildNodes"] = iframeRequestHandler;
+ InspectorProtocol.eventHandler["DOM.setChildNodes"] = iframeRequestHandler;
}
function didFindIframe(messageObject)
{
if (messageObject.error) {
- InspectorTest.log("FAIL: " + messageObject.error);
- InspectorTest.completeTest();
+ ProtocolTest.log("FAIL: " + messageObject.error);
+ ProtocolTest.completeTest();
}
}
@@ -33,8 +33,8 @@
var node = messageObject.params.nodes[0];
if (!node || node.nodeName !== "IFRAME")
return;
- InspectorTest.eventHandler["DOM.setChildNodes"] = null;
- InspectorTest.sendCommand("DOM.querySelector", {
+ InspectorProtocol.eventHandler["DOM.setChildNodes"] = null;
+ InspectorProtocol.sendCommand("DOM.querySelector", {
"nodeId": node.contentDocument.nodeId,
"selector": "div#rootDiv"
}, didFindDiv);
@@ -42,15 +42,15 @@
function didFindDiv(messageObject)
{
- InspectorTest.sendCommand("Console.enable", {});
- InspectorTest.sendCommand("Console.addInspectedNode", {
+ InspectorProtocol.sendCommand("Console.enable", {});
+ InspectorProtocol.sendCommand("Console.addInspectedNode", {
"nodeId": messageObject.result.nodeId
}, didAddInspectedNode);
}
function didAddInspectedNode(messageObject)
{
- InspectorTest.sendCommand("Runtime.evaluate", {
+ InspectorProtocol.sendCommand("Runtime.evaluate", {
"expression": "$0",
"includeCommandLineAPI": true
}, didEvaluate);
@@ -59,10 +59,10 @@
function didEvaluate(messageObject)
{
if (messageObject.result.wasThrown)
- InspectorTest.log("FAIL: unexpected exception: " + JSON.stringify(messageObject, null, 2));
+ ProtocolTest.log("FAIL: unexpected exception: " + JSON.stringify(messageObject, null, 2));
if (messageObject.result.result.value !== null)
- InspectorTest.log("FAIL: unexpected value: " + JSON.stringify(messageObject, null, 2));
- InspectorTest.completeTest();
+ ProtocolTest.log("FAIL: unexpected value: " + JSON.stringify(messageObject, null, 2));
+ ProtocolTest.completeTest();
}
}
diff --git a/LayoutTests/http/tests/inspector/dom/resources/InspectorDOMListener.js b/LayoutTests/http/tests/inspector/dom/resources/InspectorDOMListener.js
index 44eb219..5d19fa1 100644
--- a/LayoutTests/http/tests/inspector/dom/resources/InspectorDOMListener.js
+++ b/LayoutTests/http/tests/inspector/dom/resources/InspectorDOMListener.js
@@ -31,9 +31,9 @@
{
var nodesById = {};
- InspectorTest.addEventListener("DOM.setChildNodes", onSetChildNodes);
- InspectorTest.addEventListener("DOM.childNodeRemoved", onChildNodeRemoved);
- InspectorTest.addEventListener("DOM.childNodeInserted", onChildNodeInserted);
+ InspectorProtocol.addEventListener("DOM.setChildNodes", onSetChildNodes);
+ InspectorProtocol.addEventListener("DOM.childNodeRemoved", onChildNodeRemoved);
+ InspectorProtocol.addEventListener("DOM.childNodeInserted", onChildNodeInserted);
function createNodeAttributesMap(attributes)
{
diff --git a/LayoutTests/http/tests/inspector/page/loading-iframe-document-node.html b/LayoutTests/http/tests/inspector/page/loading-iframe-document-node.html
index 94a3ee2..9598519 100644
--- a/LayoutTests/http/tests/inspector/page/loading-iframe-document-node.html
+++ b/LayoutTests/http/tests/inspector/page/loading-iframe-document-node.html
@@ -27,24 +27,24 @@
4. Use the JS object to retrieve the DOM agent nodeid for the document node.
*/
- InspectorTest.eventHandler["Page.frameStartedLoading"] = step2_onFrameStartedLoading;
- InspectorTest.eventHandler["Runtime.executionContextCreated"] = step3_onExecutionContextCreated;
- InspectorTest.eventHandler["Page.loadEventFired"] = onLoadEventFired;
+ InspectorProtocol.eventHandler["Page.frameStartedLoading"] = step2_onFrameStartedLoading;
+ InspectorProtocol.eventHandler["Runtime.executionContextCreated"] = step3_onExecutionContextCreated;
+ InspectorProtocol.eventHandler["Page.loadEventFired"] = onLoadEventFired;
var targetFrameId = null;
function step1_bootstrap() {
- InspectorTest.log("step1_bootstrap");
+ ProtocolTest.log("step1_bootstrap");
// Enable the frame events.
- InspectorTest.sendCommand("Page.enable", {}, function() {
+ InspectorProtocol.sendCommand("Page.enable", {}, function() {
// Enable the Runtime.executionContextCreated event.
- InspectorTest.sendCommand("Runtime.enable", {}, function() {
+ InspectorProtocol.sendCommand("Runtime.enable", {}, function() {
// Initialize the DOM agent.
- InspectorTest.sendCommand("DOM.getDocument", {}, function() {
- InspectorTest.log("Main document loaded");
+ InspectorProtocol.sendCommand("DOM.getDocument", {}, function() {
+ ProtocolTest.log("Main document loaded");
// Add the iframe to the DOM.
- InspectorTest.sendCommand("Runtime.evaluate", { "expression": "appendIframe()" });
+ InspectorProtocol.sendCommand("Runtime.evaluate", { "expression": "appendIframe()" });
});
});
});
@@ -52,7 +52,7 @@
function step2_onFrameStartedLoading(response)
{
- InspectorTest.log("step2_onFrameStartedLoading");
+ ProtocolTest.log("step2_onFrameStartedLoading");
targetFrameId = response.params.frameId;
}
@@ -62,9 +62,9 @@
if (frameId !== targetFrameId)
return;
- InspectorTest.log("step3_onExecutionContextCreated: Requesting document from iframe's context.");
+ ProtocolTest.log("step3_onExecutionContextCreated: Requesting document from iframe's context.");
- InspectorTest.sendCommand("Runtime.evaluate", {
+ InspectorProtocol.sendCommand("Runtime.evaluate", {
"expression": "document",
"objectGroup": "console",
"includeCommandLineAPI": false,
@@ -77,7 +77,7 @@
function callback(response)
{
var objectId = response.result.result.objectId;
- InspectorTest.log("Received script object for iframe's document node");
+ ProtocolTest.log("Received script object for iframe's document node");
step4_requestNode(frameId, objectId);
}
}
@@ -86,27 +86,27 @@
{
function callback(response)
{
- InspectorTest.log(response.result.nodeId ? "PASS: Received node for iframe's document node" : "FAIL: Iframe's document node is not available");
+ ProtocolTest.log(response.result.nodeId ? "PASS: Received node for iframe's document node" : "FAIL: Iframe's document node is not available");
completeTest();
}
- InspectorTest.log("step4_requestNode: Requesting DOM node for iframe's document node");
- InspectorTest.sendCommand("DOM.requestNode", { objectId: objectId }, callback);
+ ProtocolTest.log("step4_requestNode: Requesting DOM node for iframe's document node");
+ InspectorProtocol.sendCommand("DOM.requestNode", { objectId: objectId }, callback);
}
function completeTest()
{
- InspectorTest.log("Test finished");
+ ProtocolTest.log("Test finished");
// Stop loading the iframe to avoid timing out the test.
- InspectorTest.sendCommand("Runtime.evaluate", { "expression": "removeIframe()" });
- InspectorTest.completeTest();
+ InspectorProtocol.sendCommand("Runtime.evaluate", { "expression": "removeIframe()" });
+ ProtocolTest.completeTest();
}
function onLoadEventFired()
{
// We should finish the test before this event is triggered.
// If you see this in the output, then the slow-image is not loaded correctly in the iframe.
- InspectorTest.log("FAIL: Iframe load event fired before the test finished.");
+ ProtocolTest.log("FAIL: Iframe load event fired before the test finished.");
}
step1_bootstrap()
diff --git a/LayoutTests/http/tests/inspector/resources/ProtocolTestStub.js b/LayoutTests/http/tests/inspector/resources/ProtocolTestStub.js
index 7653da3..4c199cb 100644
--- a/LayoutTests/http/tests/inspector/resources/ProtocolTestStub.js
+++ b/LayoutTests/http/tests/inspector/resources/ProtocolTestStub.js
@@ -25,16 +25,18 @@
*/
InspectorFrontendAPI = {};
-InspectorTest = {};
-InspectorTest._dispatchTable = [];
-InspectorTest._requestId = -1;
-InspectorTest.eventHandler = {};
-InspectorTest.logCount = 0;
+InspectorProtocol = {};
+InspectorProtocol._dispatchTable = [];
+InspectorProtocol._requestId = -1;
+InspectorProtocol.eventHandler = {};
-InspectorTest.dumpInspectorProtocolMessages = false;
-InspectorTest.forceSyncDebugLogging = false;
+ProtocolTest = {};
+ProtocolTest.logCount = 0;
-InspectorTest.sendCommand = function(methodOrObject, params, handler)
+ProtocolTest.forceSyncDebugLogging = false;
+InspectorProtocol.dumpInspectorProtocolMessages = false;
+
+InspectorProtocol.sendCommand = function(methodOrObject, params, handler)
{
// Allow new-style arguments object, as in awaitCommand.
var method = methodOrObject;
@@ -48,7 +50,7 @@
return this._requestId;
}
-InspectorTest.awaitCommand = function(args)
+InspectorProtocol.awaitCommand = function(args)
{
var {method, params} = args;
return new Promise(function(resolve, reject) {
@@ -58,21 +60,21 @@
}.bind(this));
}
-InspectorTest.awaitEvent = function(args)
+InspectorProtocol.awaitEvent = function(args)
{
var {event} = args;
if (typeof event !== "string")
throw new Error("Event must be a string.");
return new Promise(function(resolve, reject) {
- InspectorTest.eventHandler[event] = function(message) {
- InspectorTest.eventHandler[event] = undefined;
+ InspectorProtocol.eventHandler[event] = function(message) {
+ InspectorProtocol.eventHandler[event] = undefined;
resolve(message);
}
});
}
-InspectorTest.addEventListener = function(eventTypeOrObject, listener)
+InspectorProtocol.addEventListener = function(eventTypeOrObject, listener)
{
var event = eventTypeOrObject;
if (typeof eventTypeOrObject === "object")
@@ -85,11 +87,11 @@
throw new Error("Event listener must be callable.");
// Convert to an array of listeners.
- var listeners = InspectorTest.eventHandler[event];
+ var listeners = InspectorProtocol.eventHandler[event];
if (!listeners)
- listeners = InspectorTest.eventHandler[event] = [];
+ listeners = InspectorProtocol.eventHandler[event] = [];
else if (typeof listeners === "function")
- listeners = InspectorTest.eventHandler[event] = [listeners];
+ listeners = InspectorProtocol.eventHandler[event] = [listeners];
// Prevent registering multiple times.
if (listeners.includes(listener))
@@ -98,22 +100,31 @@
listeners.push(listener);
}
-InspectorTest.sendMessage = function(messageObject)
+InspectorProtocol.sendMessage = function(messageObject)
{
// This matches the debug dumping in InspectorBackend, which is bypassed
- // by InspectorTest. Return messages should be dumped by InspectorBackend.
+ // by InspectorProtocol. Return messages should be dumped by InspectorBackend.
if (this.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)
{
// If the message has an id, then it is a reply to a command.
var messageId = messageObject["id"];
if (typeof messageId === "number") {
- var handler = InspectorTest._dispatchTable[messageId];
+ var handler = InspectorProtocol._dispatchTable[messageId];
if (!handler)
return;
@@ -129,7 +140,7 @@
// Otherwise, it is an event.
} else {
var eventName = messageObject["method"];
- var handler = InspectorTest.eventHandler[eventName];
+ var handler = InspectorProtocol.eventHandler[eventName];
if (!handler)
return;
@@ -149,7 +160,20 @@
}
}
-InspectorTest.AsyncTestSuite = class AsyncTestSuite {
+window.addEventListener("message", function(event) {
+ try {
+ eval(event.data);
+ } catch (e) {
+ alert(e.stack);
+ ProtocolTest.completeTest();
+ throw e;
+ }
+});
+
+// FIXME: Everything below here should be extracted to a file containing shared test utilities
+// between the two harnesses.
+
+ProtocolTest.AsyncTestSuite = class AsyncTestSuite {
constructor(name) {
if (!name || typeof name !== "string")
throw new Error("Tried to create AsyncTestSuite without string suite name.");
@@ -193,7 +217,7 @@
runTestCasesAndFinish()
{
function finish() {
- InspectorTest.completeTest();
+ ProtocolTest.completeTest();
}
this.runTestCases()
@@ -210,19 +234,19 @@
this._startedRunning = true;
- InspectorTest.log("");
- InspectorTest.log("== Running test suite: " + this.name);
+ ProtocolTest.log("");
+ ProtocolTest.log("== Running test suite: " + this.name);
// Avoid adding newlines if nothing was logged.
- var priorLogCount = InspectorTest.logCount;
+ var priorLogCount = ProtocolTest.logCount;
var suite = this;
var result = this.testcases.reduce(function(chain, testcase, i) {
return chain.then(function() {
- if (i > 0 && priorLogCount + 1 < InspectorTest.logCount)
- InspectorTest.log("");
+ if (i > 0 && priorLogCount + 1 < ProtocolTest.logCount)
+ ProtocolTest.log("");
- priorLogCount = InspectorTest.logCount;
- InspectorTest.log("-- Running test case: " + testcase.name);
+ priorLogCount = ProtocolTest.logCount;
+ ProtocolTest.log("-- Running test case: " + testcase.name);
suite.runCount++;
return new Promise(testcase.test);
});
@@ -237,13 +261,13 @@
if (typeof message !== "string")
message = JSON.stringify(message);
- InspectorTest.log("!! EXCEPTION: " + message);
+ ProtocolTest.log("!! EXCEPTION: " + message);
throw e; // Reject this promise by re-throwing the error.
});
}
}
-InspectorTest.SyncTestSuite = class SyncTestSuite {
+ProtocolTest.SyncTestSuite = class SyncTestSuite {
constructor(name) {
if (!name || typeof name !== "string")
throw new Error("Tried to create SyncTestSuite without string suite name.");
@@ -286,7 +310,7 @@
runTestCasesAndFinish()
{
this.runTestCases();
- InspectorTest.completeTest();
+ ProtocolTest.completeTest();
}
runTestCases()
@@ -298,19 +322,19 @@
this._startedRunning = true;
- InspectorTest.log("");
- InspectorTest.log("== Running test suite: " + this.name);
+ ProtocolTest.log("");
+ ProtocolTest.log("== Running test suite: " + this.name);
- var priorLogCount = InspectorTest.logCount;
+ var priorLogCount = ProtocolTest.logCount;
var suite = this;
for (var i = 0; i < this.testcases.length; i++) {
var testcase = this.testcases[i];
- if (i > 0 && priorLogCount + 1 < InspectorTest.logCount)
- InspectorTest.log("");
+ if (i > 0 && priorLogCount + 1 < ProtocolTest.logCount)
+ ProtocolTest.log("");
- priorLogCount = InspectorTest.logCount;
+ priorLogCount = ProtocolTest.logCount;
- InspectorTest.log("-- Running test case: " + testcase.name);
+ ProtocolTest.log("-- Running test case: " + testcase.name);
suite.runCount++;
try {
var result = testcase.test.call(null);
@@ -329,7 +353,7 @@
if (typeof message !== "string")
message = JSON.stringify(message);
- InspectorTest.log("!! EXCEPTION: " + message);
+ ProtocolTest.log("!! EXCEPTION: " + message);
return false;
}
}
@@ -339,18 +363,18 @@
}
// Logs a message to test document.
-InspectorTest.log = function(message)
+ProtocolTest.log = function(message)
{
- ++InspectorTest.logCount;
+ ++ProtocolTest.logCount;
if (this.forceSyncDebugLogging)
this.debugLog(message);
else
- this.sendCommand("Runtime.evaluate", { "expression": "log(" + JSON.stringify(message) + ")" } );
+ InspectorProtocol.sendCommand("Runtime.evaluate", { "expression": "log(" + JSON.stringify(message) + ")" } );
}
// Logs an assertion result to the test document.
-InspectorTest.assert = function(condition, message)
+ProtocolTest.assert = function(condition, message)
{
var status = condition ? "PASS" : "FAIL";
var message = typeof message !== "string" ? JSON.stringify(message) : message;
@@ -360,26 +384,17 @@
// Logs message a directly to stdout of the test process via alert function.
// This message should survive process crash or kill by timeout.
-InspectorTest.debugLog = function(message)
+ProtocolTest.debugLog = function(message)
{
- this.sendCommand("Runtime.evaluate", { "expression": "debugLog(" + JSON.stringify(message) + ")" } );
+ InspectorProtocol.sendCommand("Runtime.evaluate", { "expression": "debugLog(" + JSON.stringify(message) + ")" } );
}
-InspectorTest.completeTest = function()
+ProtocolTest.completeTest = function()
{
- this.sendCommand("Runtime.evaluate", { "expression": "closeTest();"} );
+ InspectorProtocol.sendCommand("Runtime.evaluate", { "expression": "closeTest();"} );
}
-InspectorTest.checkForError = function(responseObject)
-{
- if (responseObject.error) {
- InspectorTest.log("PROTOCOL ERROR: " + JSON.stringify(responseObject.error));
- InspectorTest.completeTest();
- throw "PROTOCOL ERROR";
- }
-}
-
-InspectorTest.importScript = function(scriptName)
+ProtocolTest.importScript = function(scriptName)
{
var xhr = new XMLHttpRequest();
var isAsyncRequest = false;
@@ -390,13 +405,3 @@
var script = "try { " + xhr.responseText + "} catch (e) { alert(" + JSON.stringify("Error in: " + scriptName) + "); throw e; }";
window.eval(script);
}
-
-window.addEventListener("message", function(event) {
- try {
- eval(event.data);
- } catch (e) {
- alert(e.stack);
- InspectorTest.completeTest();
- throw e;
- }
-});
diff --git a/LayoutTests/http/tests/inspector/resources/console-test.js b/LayoutTests/http/tests/inspector/resources/console-test.js
index 1464e01..ab5906b 100644
--- a/LayoutTests/http/tests/inspector/resources/console-test.js
+++ b/LayoutTests/http/tests/inspector/resources/console-test.js
@@ -1,6 +1,6 @@
-InspectorTest.Console = {};
+ProtocolTest.Console = {};
-InspectorTest.Console.sanitizeConsoleMessage = function(messageObject)
+ProtocolTest.Console.sanitizeConsoleMessage = function(messageObject)
{
function basename(url)
{
@@ -30,9 +30,9 @@
return obj;
}
-InspectorTest.Console.addTestCase = function(suite, args)
+ProtocolTest.Console.addTestCase = function(suite, args)
{
- if (!(suite instanceof InspectorTest.AsyncTestSuite))
+ if (!(suite instanceof ProtocolTest.AsyncTestSuite))
throw new Error("Console test cases must be added to an async test suite.");
var {name, description, expression, expected} = args;
@@ -40,23 +40,23 @@
name,
description,
test: function(resolve, reject) {
- InspectorTest.awaitEvent({
+ InspectorProtocol.awaitEvent({
event: "Console.messageAdded",
})
.then(function(messageObject) {
var consoleMessage = messageObject.params.message;
var {source, level, text, parameters} = consoleMessage;
- InspectorTest.assert(source === expected.source, "ConsoleMessage type should be '" + expected.source + "'.");
- InspectorTest.assert(level === expected.level, "ConsoleMessage level should be '" + expected.level + "'.");
+ ProtocolTest.assert(source === expected.source, "ConsoleMessage type should be '" + expected.source + "'.");
+ ProtocolTest.assert(level === expected.level, "ConsoleMessage level should be '" + expected.level + "'.");
if (expected.text)
- InspectorTest.assert(text === expected.text, "ConsoleMessage text should be '" + expected.text + "'.");
+ ProtocolTest.assert(text === expected.text, "ConsoleMessage text should be '" + expected.text + "'.");
if (expected.parameters) {
- InspectorTest.assert(parameters.length === expected.parameters.length, "ConsoleMessage parameters.length === " + expected.parameters.length);
+ ProtocolTest.assert(parameters.length === expected.parameters.length, "ConsoleMessage parameters.length === " + expected.parameters.length);
for (var i = 0; i < parameters.length; ++i) {
var expectedType = expected.parameters[i];
- InspectorTest.assert(parameters[i].type === expectedType, "ConsoleMessage parameter " + i + " should have type '" + expectedType + "'.");
+ ProtocolTest.assert(parameters[i].type === expectedType, "ConsoleMessage parameter " + i + " should have type '" + expectedType + "'.");
}
}
@@ -65,8 +65,8 @@
.catch(reject);
// Cause a messageAdded event to be generated.
- InspectorTest.log("Evaluating expression: " + expression);
- InspectorTest.sendCommand({
+ ProtocolTest.log("Evaluating expression: " + expression);
+ InspectorProtocol.sendCommand({
method: "Runtime.evaluate",
params: {expression}
});
diff --git a/LayoutTests/http/tests/inspector/resources/probe-test.js b/LayoutTests/http/tests/inspector/resources/probe-test.js
index 0e6d1c8..053f9f9 100644
--- a/LayoutTests/http/tests/inspector/resources/probe-test.js
+++ b/LayoutTests/http/tests/inspector/resources/probe-test.js
@@ -1,6 +1,6 @@
-window.ProbeHelper = {};
+ProtocolTest.Probe = {};
-ProbeHelper.simplifiedProbeSample = function(messageObject)
+ProtocolTest.Probe.sanitizeProbeSample = function(messageObject)
{
var data = messageObject.params.sample;
return {
@@ -11,7 +11,7 @@
};
}
-ProbeHelper.stringifyProbeSample = function(ProbeSample)
+ProtocolTest.Probe.stringifyProbeSample = function(ProbeSample)
{
console.assert(ProbeSample instanceof WebInspector.ProbeSample, "Unexpected object type!");
return JSON.stringify({
@@ -20,7 +20,7 @@
});
}
-ProbeHelper.installTracingListeners = function()
+ProtocolTest.Probe.installTracingListeners = function()
{
if (!WebInspector.debuggerManager || !WebInspector.probeManager)
return;
diff --git a/LayoutTests/inspector/console/console-message.html b/LayoutTests/inspector/console/console-message.html
index 31ae524..d9b2fe6 100644
--- a/LayoutTests/inspector/console/console-message.html
+++ b/LayoutTests/inspector/console/console-message.html
@@ -14,11 +14,11 @@
function test()
{
- InspectorTest.importScript("console-test.js");
+ ProtocolTest.importScript("console-test.js");
- var suite = new InspectorTest.AsyncTestSuite("Console.MessagesFromCommandLineAPI");
+ var suite = new ProtocolTest.AsyncTestSuite("Console.MessagesFromCommandLineAPI");
- InspectorTest.Console.addTestCase(suite, {
+ ProtocolTest.Console.addTestCase(suite, {
name: "ConsoleLogString",
description: "Test `console.log(\"log\")`",
expression: 'console.log("log");',
@@ -30,7 +30,7 @@
}
});
- InspectorTest.Console.addTestCase(suite, {
+ ProtocolTest.Console.addTestCase(suite, {
name: "ConsoleInfoString",
description: "Test `console.info(\"info\")`",
expression: 'console.info("info");',
@@ -42,7 +42,7 @@
}
});
- InspectorTest.Console.addTestCase(suite, {
+ ProtocolTest.Console.addTestCase(suite, {
name: "ConsoleWarnString",
description: "Test `console.warn(\"warn\")`",
expression: 'console.warn("warn");',
@@ -54,7 +54,7 @@
}
});
- InspectorTest.Console.addTestCase(suite, {
+ ProtocolTest.Console.addTestCase(suite, {
name: "ConsoleErrorString",
description: "Test `console.error(\"error\")`",
expression: 'console.error("error");',
@@ -66,7 +66,7 @@
}
});
- InspectorTest.Console.addTestCase(suite, {
+ ProtocolTest.Console.addTestCase(suite, {
name: "ConsoleDebugString",
description: "Test `console.debug(\"debug\")`",
expression: 'console.debug("debug");',
@@ -78,7 +78,7 @@
}
});
- InspectorTest.awaitCommand({
+ InspectorProtocol.awaitCommand({
method: "Console.enable",
params: {}
})
@@ -88,8 +88,8 @@
.catch(fatalError);
function fatalError(e) {
- InspectorTest.log("Test failed with fatal error: " + JSON.stringify(e));
- InspectorTest.completeTest();
+ ProtocolTest.log("Test failed with fatal error: " + JSON.stringify(e));
+ ProtocolTest.completeTest();
}
}
</script>
diff --git a/LayoutTests/inspector/console/css-source-locations.html b/LayoutTests/inspector/console/css-source-locations.html
index 9163985..daaa0da 100644
--- a/LayoutTests/inspector/console/css-source-locations.html
+++ b/LayoutTests/inspector/console/css-source-locations.html
@@ -15,34 +15,34 @@
<script>
function test()
{
- InspectorTest.importScript("console-test.js");
+ ProtocolTest.importScript("console-test.js");
var consoleMessageCount = 0;
const expectedConsoleMessageCount = 7;
// Due to the difficulty of testing inline style tags in a test case, this test
// is a reference test that contains serialized Console.messageAdded event data.
- InspectorTest.addEventListener({
+ InspectorProtocol.addEventListener({
event: "Console.messageAdded",
listener: function(messageObject) {
- var message = InspectorTest.Console.sanitizeConsoleMessage(messageObject);
- InspectorTest.log(JSON.stringify(message));
+ var message = ProtocolTest.Console.sanitizeConsoleMessage(messageObject);
+ ProtocolTest.log(JSON.stringify(message));
if (++consoleMessageCount !== expectedConsoleMessageCount)
return;
- InspectorTest.awaitCommand({
+ InspectorProtocol.awaitCommand({
method: "Console.disable",
params: {}
})
.then(function() {
- InspectorTest.completeTest();
+ ProtocolTest.completeTest();
});
}
});
// Start the test.
- InspectorTest.sendCommand({
+ InspectorProtocol.sendCommand({
method: "Console.enable",
params: {}
});
diff --git a/LayoutTests/inspector/console/js-source-locations.html b/LayoutTests/inspector/console/js-source-locations.html
index 4f714ff..630fd8c 100644
--- a/LayoutTests/inspector/console/js-source-locations.html
+++ b/LayoutTests/inspector/console/js-source-locations.html
@@ -11,25 +11,25 @@
<script>
function test()
{
- InspectorTest.importScript("console-test.js");
+ ProtocolTest.importScript("console-test.js");
var consoleMessageCount = 0;
const expectedConsoleMessageCount = 8;
// Due to the difficulty of testing inline script tags in a test case, this test
// is a reference test that contains serialized Console.messageAdded event data.
- InspectorTest.addEventListener({
+ InspectorProtocol.addEventListener({
event: "Console.messageAdded",
listener: function(messageObject) {
- var message = InspectorTest.Console.sanitizeConsoleMessage(messageObject);
- InspectorTest.log(JSON.stringify(message));
+ var message = ProtocolTest.Console.sanitizeConsoleMessage(messageObject);
+ ProtocolTest.log(JSON.stringify(message));
if (++consoleMessageCount === expectedConsoleMessageCount)
- InspectorTest.completeTest();
+ ProtocolTest.completeTest();
}
});
- InspectorTest.sendCommand({
+ InspectorProtocol.sendCommand({
method: "Console.enable",
params: {}
});
diff --git a/LayoutTests/inspector/console/x-frame-options-message.html b/LayoutTests/inspector/console/x-frame-options-message.html
index 08845b6..f8be31a 100644
--- a/LayoutTests/inspector/console/x-frame-options-message.html
+++ b/LayoutTests/inspector/console/x-frame-options-message.html
@@ -5,18 +5,18 @@
<script>
function test()
{
- InspectorTest.importScript("console-test.js");
+ ProtocolTest.importScript("console-test.js");
- let suite = new InspectorTest.AsyncTestSuite("Console.XFrameOptionsMessages");
+ let suite = new ProtocolTest.AsyncTestSuite("Console.XFrameOptionsMessages");
- InspectorTest.Console.addTestCase(suite, {
+ ProtocolTest.Console.addTestCase(suite, {
name: "XFrameOptionsDeny",
description: "Ensure that a console message is logged when enforcing an X-Frame-Options policy. In this case, setting X-Frame-Options: 'deny' means the iframe does not want to be embedded in the test page.",
expression: "triggerXFrameOptionDeny();",
expected: {source: 'security', level: 'error'}
});
- InspectorTest.awaitCommand({
+ InspectorProtocol.awaitCommand({
method: "Console.enable",
params: {}
})
@@ -26,8 +26,8 @@
.catch(fatalError);
function fatalError(e) {
- InspectorTest.log("Test failed with fatal error: " + JSON.stringify(e));
- InspectorTest.completeTest();
+ ProtocolTest.log("Test failed with fatal error: " + JSON.stringify(e));
+ ProtocolTest.completeTest();
}
}
</script>
diff --git a/LayoutTests/inspector/css/getSupportedCSSProperties.html b/LayoutTests/inspector/css/getSupportedCSSProperties.html
index faaecf9..ae09c86 100644
--- a/LayoutTests/inspector/css/getSupportedCSSProperties.html
+++ b/LayoutTests/inspector/css/getSupportedCSSProperties.html
@@ -4,25 +4,25 @@
<script>
function test()
{
- InspectorTest.sendCommand("CSS.getSupportedCSSProperties", {}, function(messageObject) {
+ InspectorProtocol.sendCommand("CSS.getSupportedCSSProperties", {}, function(messageObject) {
if ("error" in messageObject)
- InspectorTest.log(messageObject.error.message);
+ ProtocolTest.log(messageObject.error.message);
else {
var cssProperty = "box-shadow";
var entries = messageObject["result"]["cssProperties"];
for (var i = 0; i < entries.length; ++i) {
if (entries[i].name === cssProperty) {
- InspectorTest.log(entries[i].name + " is supported");
+ ProtocolTest.log(entries[i].name + " is supported");
break;
}
}
if (i === entries.length)
- InspectorTest.log(cssProperty + " is NOT supported");
+ ProtocolTest.log(cssProperty + " is NOT supported");
}
- InspectorTest.completeTest();
+ ProtocolTest.completeTest();
});
}
</script>
diff --git a/LayoutTests/inspector/debugger/breakpoint-action-detach.html b/LayoutTests/inspector/debugger/breakpoint-action-detach.html
index 8f0f091..5cde3d9 100644
--- a/LayoutTests/inspector/debugger/breakpoint-action-detach.html
+++ b/LayoutTests/inspector/debugger/breakpoint-action-detach.html
@@ -21,10 +21,10 @@
function test()
{
- InspectorTest.eventHandler["Debugger.scriptParsed"] = function(messageObject)
+ InspectorProtocol.eventHandler["Debugger.scriptParsed"] = function(messageObject)
{
if (/resources\/breakpoint\.js$/.test(messageObject.params.url)) {
- InspectorTest.log("Found breakpoint.js");
+ ProtocolTest.log("Found breakpoint.js");
var breakpoint = {
location: {
scriptId: messageObject.params.scriptId,
@@ -38,18 +38,18 @@
]
}
};
- InspectorTest.sendCommand("Debugger.setBreakpoint", breakpoint, InspectorTest.checkForError);
- InspectorTest.sendCommand("Runtime.evaluate", {expression: "runBreakpointWithCondition()"});
+ InspectorProtocol.sendCommand("Debugger.setBreakpoint", breakpoint, InspectorProtocol.checkForError);
+ InspectorProtocol.sendCommand("Runtime.evaluate", {expression: "runBreakpointWithCondition()"});
}
}
- InspectorTest.eventHandler["Debugger.paused"] = function(messageObject)
+ InspectorProtocol.eventHandler["Debugger.paused"] = function(messageObject)
{
- InspectorTest.log("FAIL: Paused in debugger: reason = \"" + messageObject.params.reason + "\"");
- InspectorTest.completeTest();
+ ProtocolTest.log("FAIL: Paused in debugger: reason = \"" + messageObject.params.reason + "\"");
+ ProtocolTest.completeTest();
}
- InspectorTest.sendCommand("Debugger.enable", {});
+ InspectorProtocol.sendCommand("Debugger.enable", {});
}
</script>
</head>
diff --git a/LayoutTests/inspector/debugger/breakpoint-action-with-exception.html b/LayoutTests/inspector/debugger/breakpoint-action-with-exception.html
index 810b416..6832108 100644
--- a/LayoutTests/inspector/debugger/breakpoint-action-with-exception.html
+++ b/LayoutTests/inspector/debugger/breakpoint-action-with-exception.html
@@ -5,10 +5,10 @@
<script>
function test()
{
- InspectorTest.eventHandler["Debugger.scriptParsed"] = function(messageObject)
+ InspectorProtocol.eventHandler["Debugger.scriptParsed"] = function(messageObject)
{
if (/resources\/breakpoint\.js$/.test(messageObject.params.url)) {
- InspectorTest.log("Found breakpoint.js");
+ ProtocolTest.log("Found breakpoint.js");
var breakpoint = {
location: {
@@ -23,30 +23,30 @@
]
}
};
- InspectorTest.sendCommand("Debugger.setBreakpoint", breakpoint, InspectorTest.checkForError);
- InspectorTest.sendCommand("Debugger.setPauseOnExceptions", {state: "all"}, InspectorTest.checkForError);
- InspectorTest.sendCommand("Runtime.evaluate", {expression: "breakpointWithCondition(1,2)"}, function(messageObject) {
- InspectorTest.checkForError(messageObject);
- InspectorTest.log("PASS: Breakpoint action executed, but the exception did not cause the debugger to pause.")
+ InspectorProtocol.sendCommand("Debugger.setBreakpoint", breakpoint, InspectorProtocol.checkForError);
+ InspectorProtocol.sendCommand("Debugger.setPauseOnExceptions", {state: "all"}, InspectorProtocol.checkForError);
+ InspectorProtocol.sendCommand("Runtime.evaluate", {expression: "breakpointWithCondition(1,2)"}, function(messageObject) {
+ InspectorProtocol.checkForError(messageObject);
+ ProtocolTest.log("PASS: Breakpoint action executed, but the exception did not cause the debugger to pause.")
completeTest();
});
}
}
- InspectorTest.eventHandler["Debugger.paused"] = function(messageObject)
+ InspectorProtocol.eventHandler["Debugger.paused"] = function(messageObject)
{
- InspectorTest.log("FAIL: Paused in debugger: reason = \"" + messageObject.params.reason + "\"");
+ ProtocolTest.log("FAIL: Paused in debugger: reason = \"" + messageObject.params.reason + "\"");
completeTest();
}
function completeTest()
{
// Reset the pauseOnException state before ending the test.
- InspectorTest.sendCommand("Debugger.setPauseOnExceptions", {state: "none"});
- InspectorTest.completeTest();
+ InspectorProtocol.sendCommand("Debugger.setPauseOnExceptions", {state: "none"});
+ ProtocolTest.completeTest();
}
- InspectorTest.sendCommand("Debugger.enable", {});
+ InspectorProtocol.sendCommand("Debugger.enable", {});
}
</script>
</head>
diff --git a/LayoutTests/inspector/debugger/breakpoint-condition-detach.html b/LayoutTests/inspector/debugger/breakpoint-condition-detach.html
index 1a98403..8e395b5 100644
--- a/LayoutTests/inspector/debugger/breakpoint-condition-detach.html
+++ b/LayoutTests/inspector/debugger/breakpoint-condition-detach.html
@@ -24,10 +24,10 @@
function test()
{
- InspectorTest.eventHandler["Debugger.scriptParsed"] = function(messageObject)
+ InspectorProtocol.eventHandler["Debugger.scriptParsed"] = function(messageObject)
{
if (/resources\/breakpoint\.js$/.test(messageObject.params.url)) {
- InspectorTest.log("Found breakpoint.js");
+ ProtocolTest.log("Found breakpoint.js");
var breakpoint = {
location: {
scriptId: messageObject.params.scriptId,
@@ -38,18 +38,18 @@
condition: "disconnect()"
}
};
- InspectorTest.sendCommand("Debugger.setBreakpoint", breakpoint, InspectorTest.checkForError);
- InspectorTest.sendCommand("Runtime.evaluate", {expression: "runBreakpointWithCondition()"});
+ InspectorProtocol.sendCommand("Debugger.setBreakpoint", breakpoint, InspectorProtocol.checkForError);
+ InspectorProtocol.sendCommand("Runtime.evaluate", {expression: "runBreakpointWithCondition()"});
}
}
- InspectorTest.eventHandler["Debugger.paused"] = function(messageObject)
+ InspectorProtocol.eventHandler["Debugger.paused"] = function(messageObject)
{
- InspectorTest.log("FAIL: Paused in debugger: reason = \"" + messageObject.params.reason + "\"");
- InspectorTest.completeTest();
+ ProtocolTest.log("FAIL: Paused in debugger: reason = \"" + messageObject.params.reason + "\"");
+ ProtocolTest.completeTest();
}
- InspectorTest.sendCommand("Debugger.enable", {});
+ InspectorProtocol.sendCommand("Debugger.enable", {});
}
</script>
</head>
diff --git a/LayoutTests/inspector/debugger/breakpoint-condition-with-bad-script.html b/LayoutTests/inspector/debugger/breakpoint-condition-with-bad-script.html
index 760d5ae..60a4d17 100644
--- a/LayoutTests/inspector/debugger/breakpoint-condition-with-bad-script.html
+++ b/LayoutTests/inspector/debugger/breakpoint-condition-with-bad-script.html
@@ -5,10 +5,10 @@
<script>
function test()
{
- InspectorTest.eventHandler["Debugger.scriptParsed"] = function(messageObject)
+ InspectorProtocol.eventHandler["Debugger.scriptParsed"] = function(messageObject)
{
if (/resources\/breakpoint\.js$/.test(messageObject.params.url)) {
- InspectorTest.log("Found breakpoint.js");
+ ProtocolTest.log("Found breakpoint.js");
var breakpoint = {
location: {
scriptId: messageObject.params.scriptId,
@@ -23,27 +23,27 @@
]
}
};
- InspectorTest.sendCommand("Debugger.setBreakpoint", breakpoint, InspectorTest.checkForError);
- InspectorTest.sendCommand("Runtime.evaluate", {expression: "breakpointWithCondition(1,2)"}, function() {
- InspectorTest.log("PASS: The VM should not crash.");
+ InspectorProtocol.sendCommand("Debugger.setBreakpoint", breakpoint, InspectorProtocol.checkForError);
+ InspectorProtocol.sendCommand("Runtime.evaluate", {expression: "breakpointWithCondition(1,2)"}, function() {
+ ProtocolTest.log("PASS: The VM should not crash.");
completeTest();
});
}
}
- InspectorTest.eventHandler["Debugger.paused"] = function(messageObject)
+ InspectorProtocol.eventHandler["Debugger.paused"] = function(messageObject)
{
- InspectorTest.log("FAIL: Paused in debugger: reason = \"" + messageObject.params.reason + "\"");
+ ProtocolTest.log("FAIL: Paused in debugger: reason = \"" + messageObject.params.reason + "\"");
completeTest();
}
function completeTest()
{
// Reset the pauseOnException state before ending the test.
- InspectorTest.completeTest();
+ ProtocolTest.completeTest();
}
- InspectorTest.sendCommand("Debugger.enable", {});
+ InspectorProtocol.sendCommand("Debugger.enable", {});
}
</script>
</head>
diff --git a/LayoutTests/inspector/debugger/breakpoint-condition-with-exception.html b/LayoutTests/inspector/debugger/breakpoint-condition-with-exception.html
index cf98546..1d9dad0 100644
--- a/LayoutTests/inspector/debugger/breakpoint-condition-with-exception.html
+++ b/LayoutTests/inspector/debugger/breakpoint-condition-with-exception.html
@@ -5,10 +5,10 @@
<script>
function test()
{
- InspectorTest.eventHandler["Debugger.scriptParsed"] = function(messageObject)
+ InspectorProtocol.eventHandler["Debugger.scriptParsed"] = function(messageObject)
{
if (/resources\/breakpoint\.js$/.test(messageObject.params.url)) {
- InspectorTest.log("Found breakpoint.js");
+ ProtocolTest.log("Found breakpoint.js");
var breakpoint = {
location: {
scriptId: messageObject.params.scriptId,
@@ -23,29 +23,29 @@
]
}
};
- InspectorTest.sendCommand("Debugger.setBreakpoint", breakpoint, InspectorTest.checkForError);
- InspectorTest.sendCommand("Debugger.setPauseOnExceptions", {state: "all"}, InspectorTest.checkForError);
- InspectorTest.sendCommand("Runtime.evaluate", {expression: "breakpointWithCondition(1,2)"}, function() {
- InspectorTest.log("PASS: The debugger should not pause on the exception inside the condition.");
+ InspectorProtocol.sendCommand("Debugger.setBreakpoint", breakpoint, InspectorProtocol.checkForError);
+ InspectorProtocol.sendCommand("Debugger.setPauseOnExceptions", {state: "all"}, InspectorProtocol.checkForError);
+ InspectorProtocol.sendCommand("Runtime.evaluate", {expression: "breakpointWithCondition(1,2)"}, function() {
+ ProtocolTest.log("PASS: The debugger should not pause on the exception inside the condition.");
completeTest();
});
}
}
- InspectorTest.eventHandler["Debugger.paused"] = function(messageObject)
+ InspectorProtocol.eventHandler["Debugger.paused"] = function(messageObject)
{
- InspectorTest.log("FAIL: Paused in debugger: reason = \"" + messageObject.params.reason + "\"");
+ ProtocolTest.log("FAIL: Paused in debugger: reason = \"" + messageObject.params.reason + "\"");
completeTest();
}
function completeTest()
{
// Reset the pauseOnException state before ending the test.
- InspectorTest.sendCommand("Debugger.setPauseOnExceptions", {state: "none"});
- InspectorTest.completeTest();
+ InspectorProtocol.sendCommand("Debugger.setPauseOnExceptions", {state: "none"});
+ ProtocolTest.completeTest();
}
- InspectorTest.sendCommand("Debugger.enable", {});
+ InspectorProtocol.sendCommand("Debugger.enable", {});
}
</script>
</head>
diff --git a/LayoutTests/inspector/debugger/breakpoint-eval-with-exception.html b/LayoutTests/inspector/debugger/breakpoint-eval-with-exception.html
index 77ce380..401bd50 100644
--- a/LayoutTests/inspector/debugger/breakpoint-eval-with-exception.html
+++ b/LayoutTests/inspector/debugger/breakpoint-eval-with-exception.html
@@ -5,10 +5,10 @@
<script>
function test()
{
- InspectorTest.eventHandler["Debugger.scriptParsed"] = function(messageObject)
+ InspectorProtocol.eventHandler["Debugger.scriptParsed"] = function(messageObject)
{
if (/resources\/breakpoint\.js$/.test(messageObject.params.url)) {
- InspectorTest.log("Found breakpoint.js");
+ ProtocolTest.log("Found breakpoint.js");
var breakpoint = {
location: {
scriptId: messageObject.params.scriptId,
@@ -16,46 +16,46 @@
columnNumber: 0
}
};
- InspectorTest.sendCommand("Debugger.setBreakpoint", breakpoint, InspectorTest.checkForError);
- InspectorTest.sendCommand("Debugger.setPauseOnExceptions", {state: "all"}, InspectorTest.checkForError);
- InspectorTest.sendCommand("Runtime.evaluate", {expression: "breakpointBasic()"}, function() {
+ InspectorProtocol.sendCommand("Debugger.setBreakpoint", breakpoint, InspectorProtocol.checkForError);
+ InspectorProtocol.sendCommand("Debugger.setPauseOnExceptions", {state: "all"}, InspectorProtocol.checkForError);
+ InspectorProtocol.sendCommand("Runtime.evaluate", {expression: "breakpointBasic()"}, function() {
completeTest();
});
}
}
- InspectorTest.eventHandler["Debugger.paused"] = onBreakpointHit;
+ InspectorProtocol.eventHandler["Debugger.paused"] = onBreakpointHit;
function onBreakpointHit(messageObject)
{
- InspectorTest.log("PASS: Paused in debugger: reason = \"" + messageObject.params.reason + "\"");
+ ProtocolTest.log("PASS: Paused in debugger: reason = \"" + messageObject.params.reason + "\"");
// Make sure we do not pause again in the debugger.
- InspectorTest.eventHandler["Debugger.paused"] = onPausedOnException;
+ InspectorProtocol.eventHandler["Debugger.paused"] = onPausedOnException;
- InspectorTest.sendCommand("Runtime.evaluate", {expression: "this.should.trigger.an.exception"}, function(messageObject) {
- InspectorTest.checkForError(messageObject);
- InspectorTest.log("PASS: The debugger should not stop on the exception thrown by a console command while paused on a breakpoint.");
- InspectorTest.sendCommand("Debugger.resume");
+ InspectorProtocol.sendCommand("Runtime.evaluate", {expression: "this.should.trigger.an.exception"}, function(messageObject) {
+ InspectorProtocol.checkForError(messageObject);
+ ProtocolTest.log("PASS: The debugger should not stop on the exception thrown by a console command while paused on a breakpoint.");
+ InspectorProtocol.sendCommand("Debugger.resume");
});
}
function onPausedOnException(messageObject)
{
- InspectorTest.log("FAIL: Should not break on exceptions while paused on a breakpoint.");
+ ProtocolTest.log("FAIL: Should not break on exceptions while paused on a breakpoint.");
completeTest();
}
function completeTest()
{
- // InspectorTest.sendCommand("Debugger.resume", {});
+ // InspectorProtocol.sendCommand("Debugger.resume", {});
// Reset the pauseOnException state before ending the test.
- InspectorTest.sendCommand("Debugger.setPauseOnExceptions", {state: "none"});
- InspectorTest.sendCommand("Debugger.disable");
- InspectorTest.completeTest();
+ InspectorProtocol.sendCommand("Debugger.setPauseOnExceptions", {state: "none"});
+ InspectorProtocol.sendCommand("Debugger.disable");
+ ProtocolTest.completeTest();
}
- InspectorTest.sendCommand("Debugger.enable", {});
+ InspectorProtocol.sendCommand("Debugger.enable", {});
}
</script>
</head>
diff --git a/LayoutTests/inspector/debugger/breakpoint-inside-conditons-and-actions.html b/LayoutTests/inspector/debugger/breakpoint-inside-conditons-and-actions.html
index e844db2..c7d6262 100644
--- a/LayoutTests/inspector/debugger/breakpoint-inside-conditons-and-actions.html
+++ b/LayoutTests/inspector/debugger/breakpoint-inside-conditons-and-actions.html
@@ -5,10 +5,10 @@
<script>
function test()
{
- InspectorTest.eventHandler["Debugger.scriptParsed"] = function(messageObject)
+ InspectorProtocol.eventHandler["Debugger.scriptParsed"] = function(messageObject)
{
if (/resources\/breakpoint\.js$/.test(messageObject.params.url)) {
- InspectorTest.log("Found breakpoint.js");
+ ProtocolTest.log("Found breakpoint.js");
var breakpoint = {
location: {
@@ -35,31 +35,31 @@
}
};
- InspectorTest.sendCommand("Debugger.setBreakpoint", breakpoint, InspectorTest.checkForError);
- InspectorTest.sendCommand("Debugger.setBreakpoint", breakpointInsideConditonAndAction, InspectorTest.checkForError);
- InspectorTest.sendCommand("Debugger.setPauseOnExceptions", {state: "all"}, InspectorTest.checkForError);
- InspectorTest.sendCommand("Runtime.evaluate", {expression: "breakpointWithCondition(1,2)"}, function(messageObject) {
- InspectorTest.checkForError(messageObject);
- InspectorTest.log("PASS: Breakpoint condition and action executed, but the exception did not cause the debugger to pause.")
+ InspectorProtocol.sendCommand("Debugger.setBreakpoint", breakpoint, InspectorProtocol.checkForError);
+ InspectorProtocol.sendCommand("Debugger.setBreakpoint", breakpointInsideConditonAndAction, InspectorProtocol.checkForError);
+ InspectorProtocol.sendCommand("Debugger.setPauseOnExceptions", {state: "all"}, InspectorProtocol.checkForError);
+ InspectorProtocol.sendCommand("Runtime.evaluate", {expression: "breakpointWithCondition(1,2)"}, function(messageObject) {
+ InspectorProtocol.checkForError(messageObject);
+ ProtocolTest.log("PASS: Breakpoint condition and action executed, but the exception did not cause the debugger to pause.")
completeTest();
});
}
}
- InspectorTest.eventHandler["Debugger.paused"] = function(messageObject)
+ InspectorProtocol.eventHandler["Debugger.paused"] = function(messageObject)
{
- InspectorTest.log("FAIL: Paused in debugger: reason = \"" + messageObject.params.reason + "\"");
+ ProtocolTest.log("FAIL: Paused in debugger: reason = \"" + messageObject.params.reason + "\"");
completeTest();
}
function completeTest()
{
// Reset the pauseOnException state before ending the test.
- InspectorTest.sendCommand("Debugger.setPauseOnExceptions", {state: "none"});
- InspectorTest.completeTest();
+ InspectorProtocol.sendCommand("Debugger.setPauseOnExceptions", {state: "none"});
+ ProtocolTest.completeTest();
}
- InspectorTest.sendCommand("Debugger.enable", {});
+ InspectorProtocol.sendCommand("Debugger.enable", {});
}
</script>
</head>
diff --git a/LayoutTests/inspector/debugger/call-frame-function-name.html b/LayoutTests/inspector/debugger/call-frame-function-name.html
index 3dc4eab..dc96b5b 100644
--- a/LayoutTests/inspector/debugger/call-frame-function-name.html
+++ b/LayoutTests/inspector/debugger/call-frame-function-name.html
@@ -11,26 +11,26 @@
// We set a breakpoint before evaluating 'sum += ...', and verify that
// call frame functionNames are what we expect.
- InspectorTest.sendCommand("Debugger.enable", {});
+ InspectorProtocol.sendCommand("Debugger.enable", {});
- InspectorTest.eventHandler["Debugger.scriptParsed"] = function(messageObject)
+ InspectorProtocol.eventHandler["Debugger.scriptParsed"] = function(messageObject)
{
if (/call-frame-function-name\.html$/.test(messageObject.params.url) && messageObject.params.startLine > 10) {
- InspectorTest.log("Found <script>");
+ ProtocolTest.log("Found <script>");
var scriptIdentifier = messageObject.params.scriptId;
var lineNumber = messageObject.params.startLine + 6;
var columnNumber = 12;
var location = {scriptId: scriptIdentifier, lineNumber: lineNumber, columnNumber: columnNumber};
- InspectorTest.sendCommand("Debugger.setBreakpoint", {location: location}, function() {
- InspectorTest.log("Running testFunction");
- InspectorTest.sendCommand("Runtime.evaluate", {expression: "testFunction()"});
+ InspectorProtocol.sendCommand("Debugger.setBreakpoint", {location: location}, function() {
+ ProtocolTest.log("Running testFunction");
+ InspectorProtocol.sendCommand("Runtime.evaluate", {expression: "testFunction()"});
});
}
}
- InspectorTest.eventHandler["Debugger.paused"] = function(messageObject)
+ InspectorProtocol.eventHandler["Debugger.paused"] = function(messageObject)
{
- InspectorTest.log("Hit Breakpoint!");
+ ProtocolTest.log("Hit Breakpoint!");
var functionNames = [ ];
var i;
for (i = 0; i < 3; i++)
@@ -38,9 +38,9 @@
function assertFunctionName(index, actual, expected) {
if (actual == expected)
- InspectorTest.log('PASS: frame[' + index + '] "' + actual + '"');
+ ProtocolTest.log('PASS: frame[' + index + '] "' + actual + '"');
else
- InspectorTest.log('FAIL: frame[' + index + '] expect "' + expected + '", actual "' + actual + '"');
+ ProtocolTest.log('FAIL: frame[' + index + '] expect "' + expected + '", actual "' + actual + '"');
}
// frame 0 should be the anonymous inner function.
@@ -52,7 +52,7 @@
// frame 2 should be "testFunction".
assertFunctionName(2, functionNames[2], "testFunction");
- InspectorTest.completeTest();
+ ProtocolTest.completeTest();
}
}
</script>
diff --git a/LayoutTests/inspector/debugger/call-frame-this-host.html b/LayoutTests/inspector/debugger/call-frame-this-host.html
index 590854c..5aff054 100644
--- a/LayoutTests/inspector/debugger/call-frame-this-host.html
+++ b/LayoutTests/inspector/debugger/call-frame-this-host.html
@@ -11,26 +11,26 @@
// We set a breakpoint before evaluating 'sum += ...', and verify that
// call frame this values are what we expect.
- InspectorTest.sendCommand("Debugger.enable", {});
+ InspectorProtocol.sendCommand("Debugger.enable", {});
- InspectorTest.eventHandler["Debugger.scriptParsed"] = function(messageObject)
+ InspectorProtocol.eventHandler["Debugger.scriptParsed"] = function(messageObject)
{
if (/call-frame-this-host\.html$/.test(messageObject.params.url) && messageObject.params.startLine > 10) {
- InspectorTest.log("Found <script>");
+ ProtocolTest.log("Found <script>");
var scriptIdentifier = messageObject.params.scriptId;
var lineNumber = messageObject.params.startLine + 6;
var columnNumber = 12;
var location = {scriptId: scriptIdentifier, lineNumber: lineNumber, columnNumber: columnNumber};
- InspectorTest.sendCommand("Debugger.setBreakpoint", {location: location}, function() {
- InspectorTest.log("Running testFunction");
- InspectorTest.sendCommand("Runtime.evaluate", {expression: "testFunction()"});
+ InspectorProtocol.sendCommand("Debugger.setBreakpoint", {location: location}, function() {
+ ProtocolTest.log("Running testFunction");
+ InspectorProtocol.sendCommand("Runtime.evaluate", {expression: "testFunction()"});
});
}
}
- InspectorTest.eventHandler["Debugger.paused"] = function(messageObject)
+ InspectorProtocol.eventHandler["Debugger.paused"] = function(messageObject)
{
- InspectorTest.log("Hit Breakpoint!");
+ ProtocolTest.log("Hit Breakpoint!");
var thisValues = [ ];
var i;
for (i = 0; i < 3; i++)
@@ -39,17 +39,17 @@
function assertThisValue(index, actual, expected) {
var success = true;
if (actual.type != expected.type) {
- InspectorTest.log('FAIL: frame[' + index + '] expect type "' + expected.type + '", actual "' + actual.type + '"');
+ ProtocolTest.log('FAIL: frame[' + index + '] expect type "' + expected.type + '", actual "' + actual.type + '"');
success = false;
}
if (actual.className != expected.className) {
- InspectorTest.log('FAIL: frame[' + index + '] expect className "' + expected.className + '", actual "' + actual.className + '"');
+ ProtocolTest.log('FAIL: frame[' + index + '] expect className "' + expected.className + '", actual "' + actual.className + '"');
success = false;
}
if (success)
- InspectorTest.log('PASS: frame[' + index + '] type "' + actual.type + '" className "' + actual.className + '"');
+ ProtocolTest.log('PASS: frame[' + index + '] type "' + actual.type + '" className "' + actual.className + '"');
}
// frame 0 should be the anonymous inner function.
@@ -69,7 +69,7 @@
"type": "object",
"className": "Window"
});
- InspectorTest.completeTest();
+ ProtocolTest.completeTest();
}
}
</script>
diff --git a/LayoutTests/inspector/debugger/call-frame-this-nonstrict.html b/LayoutTests/inspector/debugger/call-frame-this-nonstrict.html
index cc15824..1df0340 100644
--- a/LayoutTests/inspector/debugger/call-frame-this-nonstrict.html
+++ b/LayoutTests/inspector/debugger/call-frame-this-nonstrict.html
@@ -11,42 +11,42 @@
// We set a breakpoint before evaluating 'sum += ...', and verify that
// call frame this values are what we expect.
- InspectorTest.sendCommand("Debugger.enable", {});
+ InspectorProtocol.sendCommand("Debugger.enable", {});
- InspectorTest.eventHandler["Debugger.scriptParsed"] = function(messageObject)
+ InspectorProtocol.eventHandler["Debugger.scriptParsed"] = function(messageObject)
{
if (/call-frame-this-nonstrict\.html$/.test(messageObject.params.url) && messageObject.params.startLine > 10) {
- InspectorTest.log("Found <script>");
+ ProtocolTest.log("Found <script>");
var scriptIdentifier = messageObject.params.scriptId;
var lineNumber = messageObject.params.startLine + 3;
var columnNumber = 4;
var location = {scriptId: scriptIdentifier, lineNumber: lineNumber, columnNumber: columnNumber};
- InspectorTest.sendCommand("Debugger.setBreakpoint", {location: location}, function() {
- InspectorTest.log("Running testFunction");
- InspectorTest.sendCommand("Runtime.evaluate", {expression: "testFunction()"});
+ InspectorProtocol.sendCommand("Debugger.setBreakpoint", {location: location}, function() {
+ ProtocolTest.log("Running testFunction");
+ InspectorProtocol.sendCommand("Runtime.evaluate", {expression: "testFunction()"});
});
}
}
var step = 0;
- InspectorTest.eventHandler["Debugger.paused"] = function(messageObject)
+ InspectorProtocol.eventHandler["Debugger.paused"] = function(messageObject)
{
function assertThisValue(step, actual, expected) {
var success = true;
if (actual.type != expected.type) {
- InspectorTest.log('FAIL: step ' + step + ': expect type "' + expected.type + '", actual "' + actual.type + '"');
+ ProtocolTest.log('FAIL: step ' + step + ': expect type "' + expected.type + '", actual "' + actual.type + '"');
success = false;
}
if (actual.className != expected.className) {
var actualResult
- InspectorTest.log('FAIL: step ' + step + ': expect className "' + expected.className + '", actual "' + actual.className + '"');
+ ProtocolTest.log('FAIL: step ' + step + ': expect className "' + expected.className + '", actual "' + actual.className + '"');
success = false;
}
if (success)
- InspectorTest.log('PASS: step ' + step + ': type "' + actual.type + '" className "' + actual.className + '"');
+ ProtocolTest.log('PASS: step ' + step + ': type "' + actual.type + '" className "' + actual.className + '"');
}
switch (step) {
@@ -92,9 +92,9 @@
});
break;
}
- InspectorTest.sendCommand("Debugger.resume", {});
+ InspectorProtocol.sendCommand("Debugger.resume", {});
if (step == 5)
- InspectorTest.completeTest();
+ ProtocolTest.completeTest();
step++;
}
}
diff --git a/LayoutTests/inspector/debugger/call-frame-this-strict.html b/LayoutTests/inspector/debugger/call-frame-this-strict.html
index f5b7eb1..bcb2c54 100644
--- a/LayoutTests/inspector/debugger/call-frame-this-strict.html
+++ b/LayoutTests/inspector/debugger/call-frame-this-strict.html
@@ -11,49 +11,49 @@
// We set a breakpoint before evaluating 'sum += ...', and verify that
// call frame this values are what we expect.
- InspectorTest.sendCommand("Debugger.enable", {});
+ InspectorProtocol.sendCommand("Debugger.enable", {});
- InspectorTest.eventHandler["Debugger.scriptParsed"] = function(messageObject)
+ InspectorProtocol.eventHandler["Debugger.scriptParsed"] = function(messageObject)
{
if (/call-frame-this-strict\.html$/.test(messageObject.params.url) && messageObject.params.startLine > 10) {
- InspectorTest.log("Found <script>");
+ ProtocolTest.log("Found <script>");
var scriptIdentifier = messageObject.params.scriptId;
var lineNumber = messageObject.params.startLine + 3;
var columnNumber = 4;
var location = {scriptId: scriptIdentifier, lineNumber: lineNumber, columnNumber: columnNumber};
- InspectorTest.sendCommand("Debugger.setBreakpoint", {location: location}, function() {
- InspectorTest.log("Running testFunction");
- InspectorTest.sendCommand("Runtime.evaluate", {expression: "testFunction()"});
+ InspectorProtocol.sendCommand("Debugger.setBreakpoint", {location: location}, function() {
+ ProtocolTest.log("Running testFunction");
+ InspectorProtocol.sendCommand("Runtime.evaluate", {expression: "testFunction()"});
});
}
}
var step = 0;
- InspectorTest.eventHandler["Debugger.paused"] = function(messageObject)
+ InspectorProtocol.eventHandler["Debugger.paused"] = function(messageObject)
{
function assertThisValue(step, actual, expected) {
var success = true;
if (actual.type != expected.type) {
- InspectorTest.log('FAIL: step ' + step + ': expect type "' + expected.type + '", actual "' + actual.type + '"');
+ ProtocolTest.log('FAIL: step ' + step + ': expect type "' + expected.type + '", actual "' + actual.type + '"');
success = false;
}
if (actual.type != "undefined") {
if (typeof actual.value != typeof expected.value) {
- InspectorTest.log('FAIL: step ' + step + ': expect value type "' + typeof expected.value + '", actual "' + typeof actual.value + '"');
+ ProtocolTest.log('FAIL: step ' + step + ': expect value type "' + typeof expected.value + '", actual "' + typeof actual.value + '"');
success = false;
}
if (actual.value != expected.value) {
var actualResult
- InspectorTest.log('FAIL: step ' + step + ': expect value "' + expected.value + '", actual "' + actual.value + '"');
+ ProtocolTest.log('FAIL: step ' + step + ': expect value "' + expected.value + '", actual "' + actual.value + '"');
success = false;
}
}
if (success)
- InspectorTest.log('PASS: step ' + step + ': type "' + actual.type + '" value "' + actual.value + '"');
+ ProtocolTest.log('PASS: step ' + step + ': type "' + actual.type + '" value "' + actual.value + '"');
}
switch (step) {
@@ -97,9 +97,9 @@
});
break;
}
- InspectorTest.sendCommand("Debugger.resume", {});
+ InspectorProtocol.sendCommand("Debugger.resume", {});
if (step == 5)
- InspectorTest.completeTest();
+ ProtocolTest.completeTest();
step++;
}
}
diff --git a/LayoutTests/inspector/debugger/debugger-statement.html b/LayoutTests/inspector/debugger/debugger-statement.html
index 2430242..16c4fd6 100644
--- a/LayoutTests/inspector/debugger/debugger-statement.html
+++ b/LayoutTests/inspector/debugger/debugger-statement.html
@@ -12,30 +12,30 @@
// This test setting 2 breakpoints in DFG compiled functions: one inlined,
// and one not inlined.
- InspectorTest.sendCommand("Debugger.enable", {});
+ InspectorProtocol.sendCommand("Debugger.enable", {});
var breakpointFound = false;
- InspectorTest.eventHandler["Debugger.scriptParsed"] = function(messageObject)
+ InspectorProtocol.eventHandler["Debugger.scriptParsed"] = function(messageObject)
{
if (/resources\/breakpoint\.js$/.test(messageObject.params.url)) {
- InspectorTest.log("Found breakpoint.js");
+ ProtocolTest.log("Found breakpoint.js");
- InspectorTest.sendCommand("Runtime.evaluate", {
+ InspectorProtocol.sendCommand("Runtime.evaluate", {
expression: "debuggerStatement();"
}, function(responseObject) {
if (breakpointFound)
- InspectorTest.log("PASS");
- InspectorTest.completeTest();
+ ProtocolTest.log("PASS");
+ ProtocolTest.completeTest();
});
}
}
- InspectorTest.eventHandler["Debugger.paused"] = function(messageObject)
+ InspectorProtocol.eventHandler["Debugger.paused"] = function(messageObject)
{
- InspectorTest.log("Broke at debugger statement\n");
+ ProtocolTest.log("Broke at debugger statement\n");
breakpointFound = true;
- InspectorTest.sendCommand("Debugger.resume", {});
+ InspectorProtocol.sendCommand("Debugger.resume", {});
}
}
</script>
diff --git a/LayoutTests/inspector/debugger/didSampleProbe-multiple-probes.html b/LayoutTests/inspector/debugger/didSampleProbe-multiple-probes.html
index 022ac02..b3bf1d1 100644
--- a/LayoutTests/inspector/debugger/didSampleProbe-multiple-probes.html
+++ b/LayoutTests/inspector/debugger/didSampleProbe-multiple-probes.html
@@ -5,9 +5,9 @@
<script>
function test()
{
- InspectorTest.importScript("probe-test.js");
+ ProtocolTest.importScript("probe-test.js");
- InspectorTest.sendCommand("Debugger.enable", {});
+ InspectorProtocol.sendCommand("Debugger.enable", {});
var samples = [];
const expectedSampleCount = 4;
@@ -18,7 +18,7 @@
function dumpSamples() {
for (var i = 0; i < samples.length; i++)
- InspectorTest.log("Sample " + (i + 1) + ": " + JSON.stringify(samples[i]));
+ ProtocolTest.log("Sample " + (i + 1) + ": " + JSON.stringify(samples[i]));
}
var tests = [
@@ -45,10 +45,10 @@
},
];
- InspectorTest.eventHandler["Debugger.scriptParsed"] = function(messageObject)
+ InspectorProtocol.eventHandler["Debugger.scriptParsed"] = function(messageObject)
{
if (/resources\/breakpoint\.js$/.test(messageObject.params.url)) {
- InspectorTest.log("Found breakpoint.js");
+ ProtocolTest.log("Found breakpoint.js");
var scriptIdentifier = messageObject.params.scriptId;
var location = {scriptId: scriptIdentifier, lineNumber: 18, columnNumber: 0};
var options = {
@@ -59,30 +59,30 @@
]
};
- InspectorTest.sendCommand("Debugger.setBreakpoint", {location: location, options: options}, function(responseObject) {
- InspectorTest.checkForError(responseObject);
+ InspectorProtocol.sendCommand("Debugger.setBreakpoint", {location: location, options: options}, function(responseObject) {
+ InspectorProtocol.checkForError(responseObject);
- InspectorTest.log("Running breakpointActions to trigger probe samples.");
- InspectorTest.sendCommand("Runtime.evaluate", {expression: "breakpointActions(12, {x:1,y:2})"});
- InspectorTest.sendCommand("Runtime.evaluate", {expression: "breakpointActions(12, {x:1,y:2})"});
+ ProtocolTest.log("Running breakpointActions to trigger probe samples.");
+ InspectorProtocol.sendCommand("Runtime.evaluate", {expression: "breakpointActions(12, {x:1,y:2})"});
+ InspectorProtocol.sendCommand("Runtime.evaluate", {expression: "breakpointActions(12, {x:1,y:2})"});
});
}
}
- InspectorTest.eventHandler["Debugger.didSampleProbe"] = function(messageObject)
+ InspectorProtocol.eventHandler["Debugger.didSampleProbe"] = function(messageObject)
{
- var sample = ProbeHelper.simplifiedProbeSample(messageObject);
+ var sample = ProtocolTest.Probe.sanitizeProbeSample(messageObject);
samples.push(sample);
- InspectorTest.log("Received probe sample payload: " + JSON.stringify(sample.payload));
+ ProtocolTest.log("Received probe sample payload: " + JSON.stringify(sample.payload));
if (receivedAllExpectedSamples()) {
tests.forEach(function(test) {
var result = test.predicate();
- InspectorTest.assert(result, test.message);
+ ProtocolTest.assert(result, test.message);
if (!result)
test.error();
});
- InspectorTest.completeTest();
+ ProtocolTest.completeTest();
}
}
}
diff --git a/LayoutTests/inspector/debugger/hit-breakpoint-from-console.html b/LayoutTests/inspector/debugger/hit-breakpoint-from-console.html
index d2d55c4..4a86c58 100644
--- a/LayoutTests/inspector/debugger/hit-breakpoint-from-console.html
+++ b/LayoutTests/inspector/debugger/hit-breakpoint-from-console.html
@@ -5,32 +5,32 @@
<script>
function test()
{
- InspectorTest.sendCommand("Debugger.enable", {});
+ InspectorProtocol.sendCommand("Debugger.enable", {});
- InspectorTest.eventHandler["Debugger.scriptParsed"] = function(messageObject)
+ InspectorProtocol.eventHandler["Debugger.scriptParsed"] = function(messageObject)
{
if (/resources\/breakpoint\.js$/.test(messageObject.params.url)) {
- InspectorTest.log("Found breakpoint.js");
+ ProtocolTest.log("Found breakpoint.js");
var scriptIdentifier = messageObject.params.scriptId;
var location = {scriptId: scriptIdentifier, lineNumber: 18, columnNumber: 0};
var options = {
condition: "a > 10",
};
- InspectorTest.sendCommand("Debugger.setBreakpoint", {location: location, options: options}, function(responseObject) {
- InspectorTest.checkForError(responseObject);
+ InspectorProtocol.sendCommand("Debugger.setBreakpoint", {location: location, options: options}, function(responseObject) {
+ InspectorProtocol.checkForError(responseObject);
// Should NOT hit breakpoint (a < 10).
- InspectorTest.sendCommand("Runtime.evaluate", {expression: "breakpointActions(2, {x:1,y:2})"});
+ InspectorProtocol.sendCommand("Runtime.evaluate", {expression: "breakpointActions(2, {x:1,y:2})"});
// Should hit breakpoint (a > 10).
- InspectorTest.sendCommand("Runtime.evaluate", {expression: "breakpointActions(12, {x:1,y:2})"});
+ InspectorProtocol.sendCommand("Runtime.evaluate", {expression: "breakpointActions(12, {x:1,y:2})"});
});
}
}
- InspectorTest.eventHandler["Debugger.paused"] = function(messageObject)
+ InspectorProtocol.eventHandler["Debugger.paused"] = function(messageObject)
{
- InspectorTest.log("Hit Breakpoint!");
- InspectorTest.log("PASS");
- InspectorTest.completeTest();
+ ProtocolTest.log("Hit Breakpoint!");
+ ProtocolTest.log("PASS");
+ ProtocolTest.completeTest();
}
}
diff --git a/LayoutTests/inspector/debugger/nested-inspectors.html b/LayoutTests/inspector/debugger/nested-inspectors.html
index 6f18bdc..7788250 100644
--- a/LayoutTests/inspector/debugger/nested-inspectors.html
+++ b/LayoutTests/inspector/debugger/nested-inspectors.html
@@ -8,40 +8,40 @@
function testFunction() {
// This function runs in the second inspector window. We can use this one to debug the first inspector.
- InspectorTest.sendCommand("Debugger.enable", {});
- InspectorTest.sendCommand("Debugger.setPauseOnExceptions", {state: "all"}, function(responseObject) {
- InspectorTest.checkForError(responseObject);
- InspectorTest.log("Debugger.setPauseOnExceptions - all");
+ InspectorProtocol.sendCommand("Debugger.enable", {});
+ InspectorProtocol.sendCommand("Debugger.setPauseOnExceptions", {state: "all"}, function(responseObject) {
+ InspectorProtocol.checkForError(responseObject);
+ ProtocolTest.log("Debugger.setPauseOnExceptions - all");
// Trigger an exception in the main inspector.
- InspectorTest.sendCommand("Runtime.evaluate", {expression: "setTimeout(function() { throw new Error('PASS: Expected exception') }, 0);"});
+ InspectorProtocol.sendCommand("Runtime.evaluate", {expression: "setTimeout(function() { throw new Error('PASS: Expected exception') }, 0);"});
});
- InspectorTest.eventHandler["Debugger.paused"] = function(messageObject)
+ InspectorProtocol.eventHandler["Debugger.paused"] = function(messageObject)
{
- InspectorTest.log("PASS: Paused!");
- InspectorTest.sendCommand("Debugger.resume", {});
+ ProtocolTest.log("PASS: Paused!");
+ InspectorProtocol.sendCommand("Debugger.resume", {});
}
- InspectorTest.eventHandler["Debugger.resumed"] = function(messageObject)
+ InspectorProtocol.eventHandler["Debugger.resumed"] = function(messageObject)
{
- InspectorTest.log("PASS: Resumed!");
+ ProtocolTest.log("PASS: Resumed!");
// Revert Debugger.setPauseOnExceptions as it can have an impact on the following tests.
- InspectorTest.sendCommand("Debugger.setPauseOnExceptions", {state: "none"}, function(responseObject) {
- InspectorTest.completeTest();
+ InspectorProtocol.sendCommand("Debugger.setPauseOnExceptions", {state: "none"}, function(responseObject) {
+ ProtocolTest.completeTest();
});
}
};
- window.log = InspectorTest.log.bind(InspectorTest);
+ window.log = ProtocolTest.log.bind(InspectorProtocol);
window.closeTest = function()
{
window.internals.closeDummyInspectorFrontend();
- InspectorTest.completeTest();
+ ProtocolTest.completeTest();
}
- var secondInspectorFrontend = window.internals.openDummyInspectorFrontend("ProtocolTestStub.html");
+ var secondInspectorFrontend = window.internals.openDummyInspectorFrontend("InspectorProtocolStub.html");
secondInspectorFrontend.addEventListener("load", function(event) {
secondInspectorFrontend.postMessage("(" + testFunction.toString() +")();", "*");
});
diff --git a/LayoutTests/inspector/debugger/pause-dedicated-worker.html b/LayoutTests/inspector/debugger/pause-dedicated-worker.html
index 96fbda8..dde9f0f 100644
--- a/LayoutTests/inspector/debugger/pause-dedicated-worker.html
+++ b/LayoutTests/inspector/debugger/pause-dedicated-worker.html
@@ -18,7 +18,7 @@
var workerRequestId = 1;
function sendCommandToWorker(method, params)
{
- InspectorTest.sendCommand("Worker.sendMessageToWorker", {
+ InspectorProtocol.sendCommand("Worker.sendMessageToWorker", {
"workerId": workerId,
"message": {
"method": method,
@@ -28,31 +28,31 @@
});
}
- InspectorTest.sendCommand("Worker.enable", {}, function(messageObject) {
+ InspectorProtocol.sendCommand("Worker.enable", {}, function(messageObject) {
if ("error" in messageObject) {
- InspectorTest.log("FAIL: Couldn't enable worker debugger: " + messageObject.error.message);
- InspectorTest.completeTest();
+ ProtocolTest.log("FAIL: Couldn't enable worker debugger: " + messageObject.error.message);
+ ProtocolTest.completeTest();
}
});
- InspectorTest.eventHandler["Worker.workerCreated"] = function(messageObject)
+ InspectorProtocol.eventHandler["Worker.workerCreated"] = function(messageObject)
{
workerId = messageObject["params"]["workerId"];
- InspectorTest.log("Worker created");
- InspectorTest.sendCommand("Worker.connectToWorker", { "workerId": workerId }, function(messageObject) {
- InspectorTest.log("didConnectToWorker");
+ ProtocolTest.log("Worker created");
+ InspectorProtocol.sendCommand("Worker.connectToWorker", { "workerId": workerId }, function(messageObject) {
+ ProtocolTest.log("didConnectToWorker");
sendCommandToWorker("Debugger.enable", {});
sendCommandToWorker("Debugger.pause", {});
});
}
- InspectorTest.eventHandler["Worker.dispatchMessageFromWorker"] = function(messageObject)
+ InspectorProtocol.eventHandler["Worker.dispatchMessageFromWorker"] = function(messageObject)
{
var message = messageObject["params"]["message"];
if (message["method"] === "Debugger.paused") {
- InspectorTest.log("SUCCESS: Worker paused");
+ ProtocolTest.log("SUCCESS: Worker paused");
sendCommandToWorker("Debugger.disable", {});
- InspectorTest.completeTest();
+ ProtocolTest.completeTest();
}
}
}
diff --git a/LayoutTests/inspector/debugger/pause-on-assert.html b/LayoutTests/inspector/debugger/pause-on-assert.html
index 9a8a4ce..412abb1 100644
--- a/LayoutTests/inspector/debugger/pause-on-assert.html
+++ b/LayoutTests/inspector/debugger/pause-on-assert.html
@@ -5,8 +5,8 @@
<script>
function test()
{
- InspectorTest.sendCommand("Debugger.enable", {});
- InspectorTest.sendCommand("Debugger.setPauseOnExceptions", {state: "all"}, InspectorTest.checkForError);
+ InspectorProtocol.sendCommand("Debugger.enable", {});
+ InspectorProtocol.sendCommand("Debugger.setPauseOnExceptions", {state: "all"}, InspectorProtocol.checkForError);
var step = null;
var steps = [
@@ -42,29 +42,29 @@
},
];
- InspectorTest.eventHandler["Debugger.paused"] = function(messageObject)
+ InspectorProtocol.eventHandler["Debugger.paused"] = function(messageObject)
{
if (step.pause)
- InspectorTest.log("PASS: Paused!");
+ ProtocolTest.log("PASS: Paused!");
else
- InspectorTest.log("FAIL: Paused when unexpected");
+ ProtocolTest.log("FAIL: Paused when unexpected");
- InspectorTest.sendCommand("Debugger.resume", {}, runNextStep);
+ InspectorProtocol.sendCommand("Debugger.resume", {}, runNextStep);
}
function runNextStep() {
step = steps.shift();
if (!step) {
- InspectorTest.completeTest();
+ ProtocolTest.completeTest();
return;
}
// Evalute the command inside a setTimeout so that we can hit exceptions and break.
// Otherwise, evaluating through RuntimeAgent will not trigger a pause.
// Likewise, if no pause is expected wait for a bit before continuing.
- InspectorTest.log(step.message);
- InspectorTest.sendCommand("Runtime.evaluate", {expression: "setTimeout(function(){" + step.evaluate + "}, 0)"}, function(responseObject) {
- InspectorTest.checkForError(responseObject);
+ ProtocolTest.log(step.message);
+ InspectorProtocol.sendCommand("Runtime.evaluate", {expression: "setTimeout(function(){" + step.evaluate + "}, 0)"}, function(responseObject) {
+ InspectorProtocol.checkForError(responseObject);
if (!step.pause)
setTimeout(runNextStep, 20);
});
diff --git a/LayoutTests/inspector/debugger/regress-133182.html b/LayoutTests/inspector/debugger/regress-133182.html
index e9120e0..7b008eb 100644
--- a/LayoutTests/inspector/debugger/regress-133182.html
+++ b/LayoutTests/inspector/debugger/regress-133182.html
@@ -24,27 +24,27 @@
// Evaluate statement and expect to pause.
if (testIndex < statementsWithUncaughtExceptions.length) {
var statement = statementsWithUncaughtExceptions[testIndex++];
- InspectorTest.sendCommand("Runtime.evaluate", {expression: "setTimeout(function() { " + statement + " }, 0);"});
+ InspectorProtocol.sendCommand("Runtime.evaluate", {expression: "setTimeout(function() { " + statement + " }, 0);"});
return;
}
// Done evaluating statements to pause. Evaluate some more we do not expect to pause.
- InspectorTest.log("PASS - paused for each uncaught exception");
- InspectorTest.completeTest();
+ ProtocolTest.log("PASS - paused for each uncaught exception");
+ ProtocolTest.completeTest();
}
- InspectorTest.sendCommand("Debugger.enable", {});
- InspectorTest.sendCommand("Debugger.setPauseOnExceptions", {state: "uncaught"}, function(responseObject) {
- InspectorTest.checkForError(responseObject);
+ InspectorProtocol.sendCommand("Debugger.enable", {});
+ InspectorProtocol.sendCommand("Debugger.setPauseOnExceptions", {state: "uncaught"}, function(responseObject) {
+ InspectorProtocol.checkForError(responseObject);
expectPause = true;
triggerNextUncaughtException();
});
- InspectorTest.eventHandler["Debugger.paused"] = function(messageObject)
+ InspectorProtocol.eventHandler["Debugger.paused"] = function(messageObject)
{
if (!expectPause) {
- InspectorTest.log("FAIL - debugger paused when we did not expect to");
- InspectorTest.completeTest();
+ ProtocolTest.log("FAIL - debugger paused when we did not expect to");
+ ProtocolTest.completeTest();
return;
}
@@ -52,15 +52,15 @@
console.log("[" + testIndex + "] Testing statement '" + statementsWithUncaughtExceptions[testIndex - 1] + "'");
console.log("[" + testIndex + "] Paused and about to step");
isStepping = true;
- InspectorTest.sendCommand("Debugger.stepOver", {});
+ InspectorProtocol.sendCommand("Debugger.stepOver", {});
} else {
console.log("[" + testIndex + "] Paused after stepping");
isStepping = false;
- InspectorTest.sendCommand("Debugger.resume", {});
+ InspectorProtocol.sendCommand("Debugger.resume", {});
}
}
- InspectorTest.eventHandler["Debugger.resumed"] = function(messageObject)
+ InspectorProtocol.eventHandler["Debugger.resumed"] = function(messageObject)
{
console.log("[" + testIndex + "] Resumed");
if (!isStepping)
diff --git a/LayoutTests/inspector/debugger/removeBreakpoint.html b/LayoutTests/inspector/debugger/removeBreakpoint.html
index 73c860d..1dd10c7 100644
--- a/LayoutTests/inspector/debugger/removeBreakpoint.html
+++ b/LayoutTests/inspector/debugger/removeBreakpoint.html
@@ -5,48 +5,48 @@
<script>
function test()
{
- InspectorTest.sendCommand("Debugger.enable", {});
+ InspectorProtocol.sendCommand("Debugger.enable", {});
var breakpointTriggered = 0;
- InspectorTest.eventHandler["Debugger.scriptParsed"] = function(messageObject)
+ InspectorProtocol.eventHandler["Debugger.scriptParsed"] = function(messageObject)
{
if (/resources\/breakpoint\.js$/.test(messageObject.params.url)) {
- InspectorTest.log("Found breakpoint.js");
+ ProtocolTest.log("Found breakpoint.js");
var scriptIdentifier = messageObject.params.scriptId;
var location = {scriptId: scriptIdentifier, lineNumber: 3, columnNumber: 0};
- InspectorTest.sendCommand("Debugger.setBreakpoint", {location: location}, function(responseObject) {
- InspectorTest.checkForError(responseObject);
- InspectorTest.log("Set Breakpoint, Triggering it");
+ InspectorProtocol.sendCommand("Debugger.setBreakpoint", {location: location}, function(responseObject) {
+ InspectorProtocol.checkForError(responseObject);
+ ProtocolTest.log("Set Breakpoint, Triggering it");
breakpointIdentifier = responseObject.result.breakpointId;
- InspectorTest.sendCommand("Runtime.evaluate", {expression: "breakpointBasic()"});
+ InspectorProtocol.sendCommand("Runtime.evaluate", {expression: "breakpointBasic()"});
});
}
}
- InspectorTest.eventHandler["Debugger.paused"] = function(messageObject)
+ InspectorProtocol.eventHandler["Debugger.paused"] = function(messageObject)
{
- InspectorTest.log("Hit Breakpoint!");
+ ProtocolTest.log("Hit Breakpoint!");
++breakpointTriggered;
if (breakpointTriggered === 1)
- InspectorTest.sendCommand("Debugger.resume", {});
+ InspectorProtocol.sendCommand("Debugger.resume", {});
else {
- InspectorTest.log("FAIL: should not have hit breakpoint after it was removed.");
- InspectorTest.completeTest();
+ ProtocolTest.log("FAIL: should not have hit breakpoint after it was removed.");
+ ProtocolTest.completeTest();
}
}
- InspectorTest.eventHandler["Debugger.resumed"] = function(messageObject)
+ InspectorProtocol.eventHandler["Debugger.resumed"] = function(messageObject)
{
- InspectorTest.log("Resumed, Removing Breakpoint and trying to trigger it again");
- InspectorTest.sendCommand("Debugger.removeBreakpoint", {"breakpointId": breakpointIdentifier}, function(responseObject) {
- InspectorTest.checkForError(responseObject);
- InspectorTest.sendCommand("Runtime.evaluate", {expression: "breakpointBasic()"}, function(responseObject) {
- InspectorTest.checkForError(responseObject);
+ ProtocolTest.log("Resumed, Removing Breakpoint and trying to trigger it again");
+ InspectorProtocol.sendCommand("Debugger.removeBreakpoint", {"breakpointId": breakpointIdentifier}, function(responseObject) {
+ InspectorProtocol.checkForError(responseObject);
+ InspectorProtocol.sendCommand("Runtime.evaluate", {expression: "breakpointBasic()"}, function(responseObject) {
+ InspectorProtocol.checkForError(responseObject);
setTimeout(function() {
- InspectorTest.log("PASS: did not hit breakpoint after removing it.");
- InspectorTest.completeTest();
+ ProtocolTest.log("PASS: did not hit breakpoint after removing it.");
+ ProtocolTest.completeTest();
}, 50);
});
});
diff --git a/LayoutTests/inspector/debugger/searchInContent-linebreaks.html b/LayoutTests/inspector/debugger/searchInContent-linebreaks.html
index d995dfc..3f726c8 100644
--- a/LayoutTests/inspector/debugger/searchInContent-linebreaks.html
+++ b/LayoutTests/inspector/debugger/searchInContent-linebreaks.html
@@ -13,12 +13,12 @@
var testResults = [];
- InspectorTest.sendCommand("Debugger.enable", {});
+ InspectorProtocol.sendCommand("Debugger.enable", {});
- InspectorTest.eventHandler["Debugger.scriptParsed"] = function(messageObject)
+ InspectorProtocol.eventHandler["Debugger.scriptParsed"] = function(messageObject)
{
if (/-linebreaks\.js$/.test(messageObject.params.url)) {
- InspectorTest.sendCommand("Debugger.searchInContent", {"scriptId": messageObject.params.scriptId, "query": "test"}, function(url, messageObject) {
+ InspectorProtocol.sendCommand("Debugger.searchInContent", {"scriptId": messageObject.params.scriptId, "query": "test"}, function(url, messageObject) {
var results = messageObject.result.result;
var testResult = {url: url, count: results.length, matches: []};
@@ -42,21 +42,21 @@
var sortedTestResults = testResults.sort(compareResultURLs);
- InspectorTest.log("Scripts searched: " + sortedTestResults.length);
- InspectorTest.log("");
+ ProtocolTest.log("Scripts searched: " + sortedTestResults.length);
+ ProtocolTest.log("");
for (var testResult of sortedTestResults) {
var fileName = /([\w-]+\.js)$/.exec(testResult.url)[1];
- InspectorTest.log("Script: " + fileName);
- InspectorTest.log("Results found: " + testResult.count);
+ ProtocolTest.log("Script: " + fileName);
+ ProtocolTest.log("Results found: " + testResult.count);
for (var match of testResult.matches)
- InspectorTest.log("Line " + match.lineNumber + ": " + JSON.stringify(match.lineContent));
+ ProtocolTest.log("Line " + match.lineNumber + ": " + JSON.stringify(match.lineContent));
- InspectorTest.log("");
+ ProtocolTest.log("");
}
- InspectorTest.completeTest();
+ ProtocolTest.completeTest();
}
}
</script>
diff --git a/LayoutTests/inspector/debugger/setBreakpoint-actions.html b/LayoutTests/inspector/debugger/setBreakpoint-actions.html
index 7fa2c43..4ad4bf3 100644
--- a/LayoutTests/inspector/debugger/setBreakpoint-actions.html
+++ b/LayoutTests/inspector/debugger/setBreakpoint-actions.html
@@ -5,11 +5,11 @@
<script>
function test()
{
- InspectorTest.importScript("console-test.js");
- InspectorTest.importScript("probe-test.js");
+ ProtocolTest.importScript("console-test.js");
+ ProtocolTest.importScript("probe-test.js");
- InspectorTest.sendCommand("Console.enable", {});
- InspectorTest.sendCommand("Debugger.enable", {});
+ InspectorProtocol.sendCommand("Console.enable", {});
+ InspectorProtocol.sendCommand("Debugger.enable", {});
var isExpectingLogs = false;
var isExpectingSounds = false;
@@ -25,10 +25,10 @@
return logCount === expectedLogCount && sampleCount === expectedSampleCount && soundCount === expectedSoundCount;
}
- InspectorTest.eventHandler["Debugger.scriptParsed"] = function(messageObject)
+ InspectorProtocol.eventHandler["Debugger.scriptParsed"] = function(messageObject)
{
if (/resources\/breakpoint\.js$/.test(messageObject.params.url)) {
- InspectorTest.log("Found breakpoint.js");
+ ProtocolTest.log("Found breakpoint.js");
var scriptIdentifier = messageObject.params.scriptId;
var location = {scriptId: scriptIdentifier, lineNumber: 18, columnNumber: 0};
var options = {
@@ -43,81 +43,81 @@
]
};
- InspectorTest.sendCommand("Debugger.setBreakpoint", {location: location, options: options}, function(responseObject) {
- InspectorTest.checkForError(responseObject);
+ InspectorProtocol.sendCommand("Debugger.setBreakpoint", {location: location, options: options}, function(responseObject) {
+ InspectorProtocol.checkForError(responseObject);
breakpointIdentifier = responseObject.result.breakpointId;
- InspectorTest.log("Running breakpointActions a few times that should not trigger");
- InspectorTest.sendCommand("Runtime.evaluate", {expression: "breakpointActions(1)"});
- InspectorTest.sendCommand("Runtime.evaluate", {expression: "breakpointActions(2, 12)"});
- InspectorTest.sendCommand("Runtime.evaluate", {expression: "breakpointActions(2, {x:1,y:2})"}, function() {
+ ProtocolTest.log("Running breakpointActions a few times that should not trigger");
+ InspectorProtocol.sendCommand("Runtime.evaluate", {expression: "breakpointActions(1)"});
+ InspectorProtocol.sendCommand("Runtime.evaluate", {expression: "breakpointActions(2, 12)"});
+ InspectorProtocol.sendCommand("Runtime.evaluate", {expression: "breakpointActions(2, {x:1,y:2})"}, function() {
isExpectingLogs = true;
isExpectingSounds = true;
isExpectingSamples = true;
- InspectorTest.log("Running breakpointActions to triggering the breakpoint actions");
- InspectorTest.sendCommand("Runtime.evaluate", {expression: "breakpointActions(12, {x:1,y:2})"}, function() {
- InspectorTest.sendCommand("Runtime.evaluate", {expression: "breakpointActions(100, document.body)"});
+ ProtocolTest.log("Running breakpointActions to triggering the breakpoint actions");
+ InspectorProtocol.sendCommand("Runtime.evaluate", {expression: "breakpointActions(12, {x:1,y:2})"}, function() {
+ InspectorProtocol.sendCommand("Runtime.evaluate", {expression: "breakpointActions(100, document.body)"});
});
});
});
}
}
- InspectorTest.eventHandler["Debugger.paused"] = function(messageObject)
+ InspectorProtocol.eventHandler["Debugger.paused"] = function(messageObject)
{
- InspectorTest.log("Hit Breakpoint!");
+ ProtocolTest.log("Hit Breakpoint!");
- InspectorTest.log("FAIL: should not have hit breakpoint, autoContinue was true");
- InspectorTest.completeTest();
+ ProtocolTest.log("FAIL: should not have hit breakpoint, autoContinue was true");
+ ProtocolTest.completeTest();
}
- InspectorTest.eventHandler["Debugger.playBreakpointActionSound"] = function(messageObject)
+ InspectorProtocol.eventHandler["Debugger.playBreakpointActionSound"] = function(messageObject)
{
if (!isExpectingSounds) {
- InspectorTest.log("FAIL: unexpected breakpoint sound.");
- InspectorTest.completeTest();
+ ProtocolTest.log("FAIL: unexpected breakpoint sound.");
+ ProtocolTest.completeTest();
return;
}
- InspectorTest.log("PASS: Breakpoint Sound");
+ ProtocolTest.log("PASS: Breakpoint Sound");
++soundCount;
if (receivedAllExpectedOutput())
- InspectorTest.completeTest();
+ ProtocolTest.completeTest();
}
- InspectorTest.eventHandler["Debugger.didSampleProbe"] = function(messageObject)
+ InspectorProtocol.eventHandler["Debugger.didSampleProbe"] = function(messageObject)
{
if (!isExpectingSamples) {
- InspectorTest.log("FAIL: unexpected probe sample, probe samples should only have come from breakpoint actions.");
- InspectorTest.completeTest();
+ ProtocolTest.log("FAIL: unexpected probe sample, probe samples should only have come from breakpoint actions.");
+ ProtocolTest.completeTest();
return;
}
- var simplifiedSample = ProbeHelper.simplifiedProbeSample(messageObject);
- InspectorTest.log("PASS: Probe sample payload: " + JSON.stringify(simplifiedSample.payload));
+ var simplifiedSample = ProtocolTest.Probe.sanitizeProbeSample(messageObject);
+ ProtocolTest.log("PASS: Probe sample payload: " + JSON.stringify(simplifiedSample.payload));
++sampleCount;
if (receivedAllExpectedOutput())
- InspectorTest.completeTest();
+ ProtocolTest.completeTest();
}
- InspectorTest.eventHandler["Console.messageAdded"] = function(messageObject)
+ InspectorProtocol.eventHandler["Console.messageAdded"] = function(messageObject)
{
if (!isExpectingLogs) {
- InspectorTest.log("FAIL: unexpected log, logs should only have come from breakpoint actions.");
- InspectorTest.completeTest();
+ ProtocolTest.log("FAIL: unexpected log, logs should only have come from breakpoint actions.");
+ ProtocolTest.completeTest();
return;
}
- var message = InspectorTest.Console.sanitizeConsoleMessage(messageObject);
- InspectorTest.log("PASS: Console Message: " + JSON.stringify(message));
+ var message = ProtocolTest.Console.sanitizeConsoleMessage(messageObject);
+ ProtocolTest.log("PASS: Console Message: " + JSON.stringify(message));
++logCount;
if (receivedAllExpectedOutput())
- InspectorTest.completeTest();
+ ProtocolTest.completeTest();
}
}
</script>
diff --git a/LayoutTests/inspector/debugger/setBreakpoint-autoContinue.html b/LayoutTests/inspector/debugger/setBreakpoint-autoContinue.html
index 10f9c5c..a040fbc 100644
--- a/LayoutTests/inspector/debugger/setBreakpoint-autoContinue.html
+++ b/LayoutTests/inspector/debugger/setBreakpoint-autoContinue.html
@@ -5,34 +5,34 @@
<script>
function test()
{
- InspectorTest.sendCommand("Debugger.enable", {});
+ InspectorProtocol.sendCommand("Debugger.enable", {});
var allowedToHitBreakpoint = false;
var breakpointIdentifier = null;
- InspectorTest.eventHandler["Debugger.scriptParsed"] = function(messageObject)
+ InspectorProtocol.eventHandler["Debugger.scriptParsed"] = function(messageObject)
{
if (/resources\/breakpoint\.js$/.test(messageObject.params.url)) {
- InspectorTest.log("Found breakpoint.js");
+ ProtocolTest.log("Found breakpoint.js");
var scriptIdentifier = messageObject.params.scriptId;
var location = {scriptId: scriptIdentifier, lineNumber: 13, columnNumber: 0};
var options = {autoContinue: true};
- InspectorTest.sendCommand("Debugger.setBreakpoint", {location: location, options: options}, function(responseObject) {
- InspectorTest.checkForError(responseObject);
+ InspectorProtocol.sendCommand("Debugger.setBreakpoint", {location: location, options: options}, function(responseObject) {
+ InspectorProtocol.checkForError(responseObject);
breakpointIdentifier = responseObject.result.breakpointId;
- InspectorTest.log("Running breakpointAutomaticallyContinue multiple times with automatically continue");
- InspectorTest.sendCommand("Runtime.evaluate", {expression: "breakpointAutomaticallyContinue()"});
- InspectorTest.sendCommand("Runtime.evaluate", {expression: "breakpointAutomaticallyContinue()"});
- InspectorTest.sendCommand("Runtime.evaluate", {expression: "breakpointAutomaticallyContinue()"}, function() {
- InspectorTest.log("Removing breakpoint");
- InspectorTest.sendCommand("Debugger.removeBreakpoint", {"breakpointId": breakpointIdentifier}, function(responseObject) {
- InspectorTest.checkForError(responseObject);
+ ProtocolTest.log("Running breakpointAutomaticallyContinue multiple times with automatically continue");
+ InspectorProtocol.sendCommand("Runtime.evaluate", {expression: "breakpointAutomaticallyContinue()"});
+ InspectorProtocol.sendCommand("Runtime.evaluate", {expression: "breakpointAutomaticallyContinue()"});
+ InspectorProtocol.sendCommand("Runtime.evaluate", {expression: "breakpointAutomaticallyContinue()"}, function() {
+ ProtocolTest.log("Removing breakpoint");
+ InspectorProtocol.sendCommand("Debugger.removeBreakpoint", {"breakpointId": breakpointIdentifier}, function(responseObject) {
+ InspectorProtocol.checkForError(responseObject);
allowedToHitBreakpoint = true;
options = {autoContinue: false};
- InspectorTest.log("Setting new breakpoint without autoContinue that should trigger");
- InspectorTest.sendCommand("Debugger.setBreakpoint", {location: location, options: options}, function(responseObject) {
- InspectorTest.checkForError(responseObject);
- InspectorTest.sendCommand("Runtime.evaluate", {expression: "breakpointAutomaticallyContinue()"});
+ ProtocolTest.log("Setting new breakpoint without autoContinue that should trigger");
+ InspectorProtocol.sendCommand("Debugger.setBreakpoint", {location: location, options: options}, function(responseObject) {
+ InspectorProtocol.checkForError(responseObject);
+ InspectorProtocol.sendCommand("Runtime.evaluate", {expression: "breakpointAutomaticallyContinue()"});
});
});
});
@@ -40,16 +40,16 @@
}
}
- InspectorTest.eventHandler["Debugger.paused"] = function(messageObject)
+ InspectorProtocol.eventHandler["Debugger.paused"] = function(messageObject)
{
- InspectorTest.log("Hit Breakpoint!");
+ ProtocolTest.log("Hit Breakpoint!");
if (!allowedToHitBreakpoint) {
- InspectorTest.log("FAIL: should not have hit breakpoint.");
- InspectorTest.completeTest();
+ ProtocolTest.log("FAIL: should not have hit breakpoint.");
+ ProtocolTest.completeTest();
} else {
- InspectorTest.log("PASS: hit breakpoint when allowed.");
- InspectorTest.completeTest();
+ ProtocolTest.log("PASS: hit breakpoint when allowed.");
+ ProtocolTest.completeTest();
}
}
}
diff --git a/LayoutTests/inspector/debugger/setBreakpoint-column.html b/LayoutTests/inspector/debugger/setBreakpoint-column.html
index 3483930..f5dafa5 100644
--- a/LayoutTests/inspector/debugger/setBreakpoint-column.html
+++ b/LayoutTests/inspector/debugger/setBreakpoint-column.html
@@ -11,32 +11,32 @@
// We set a breakpoint before evaluating `var b = ...`, and verify that
// by running some expressions at that call frame.
- InspectorTest.sendCommand("Debugger.enable", {});
+ InspectorProtocol.sendCommand("Debugger.enable", {});
- InspectorTest.eventHandler["Debugger.scriptParsed"] = function(messageObject)
+ InspectorProtocol.eventHandler["Debugger.scriptParsed"] = function(messageObject)
{
if (/setBreakpoint-column\.html$/.test(messageObject.params.url) && messageObject.params.startLine > 10) {
- InspectorTest.log("Found <script>");
+ ProtocolTest.log("Found <script>");
var scriptIdentifier = messageObject.params.scriptId;
var lineNumber = messageObject.params.startLine + 2;
var columnNumber = 10;
var location = {scriptId: scriptIdentifier, lineNumber: lineNumber, columnNumber: columnNumber};
- InspectorTest.sendCommand("Debugger.setBreakpoint", {location: location}, function() {
- InspectorTest.log("Running testFunction");
- InspectorTest.sendCommand("Runtime.evaluate", {expression: "testFunction()"});
+ InspectorProtocol.sendCommand("Debugger.setBreakpoint", {location: location}, function() {
+ ProtocolTest.log("Running testFunction");
+ InspectorProtocol.sendCommand("Runtime.evaluate", {expression: "testFunction()"});
});
}
}
- InspectorTest.eventHandler["Debugger.paused"] = function(messageObject)
+ InspectorProtocol.eventHandler["Debugger.paused"] = function(messageObject)
{
- InspectorTest.log("Hit Breakpoint!");
+ ProtocolTest.log("Hit Breakpoint!");
var callFrameIdentifier = messageObject.params.callFrames[0].callFrameId;
- InspectorTest.sendCommand("Debugger.evaluateOnCallFrame", {callFrameId: callFrameIdentifier, expression: "a"}, function(messageObject) {
- InspectorTest.log("Evaluted value of `a` (expecting number 1) was: " + JSON.stringify(messageObject.result.result));
- InspectorTest.sendCommand("Debugger.evaluateOnCallFrame", {callFrameId: callFrameIdentifier, expression: "b"}, function(messageObject) {
- InspectorTest.log("Evaluted value of `b` (expecting undefined) was: " + JSON.stringify(messageObject.result.result));
- InspectorTest.completeTest();
+ InspectorProtocol.sendCommand("Debugger.evaluateOnCallFrame", {callFrameId: callFrameIdentifier, expression: "a"}, function(messageObject) {
+ ProtocolTest.log("Evaluted value of `a` (expecting number 1) was: " + JSON.stringify(messageObject.result.result));
+ InspectorProtocol.sendCommand("Debugger.evaluateOnCallFrame", {callFrameId: callFrameIdentifier, expression: "b"}, function(messageObject) {
+ ProtocolTest.log("Evaluted value of `b` (expecting undefined) was: " + JSON.stringify(messageObject.result.result));
+ ProtocolTest.completeTest();
});
});
}
diff --git a/LayoutTests/inspector/debugger/setBreakpoint-condition.html b/LayoutTests/inspector/debugger/setBreakpoint-condition.html
index 682b650..72d2d21 100644
--- a/LayoutTests/inspector/debugger/setBreakpoint-condition.html
+++ b/LayoutTests/inspector/debugger/setBreakpoint-condition.html
@@ -5,70 +5,70 @@
<script>
function test()
{
- InspectorTest.sendCommand("Debugger.enable", {});
+ InspectorProtocol.sendCommand("Debugger.enable", {});
var inBreakpoint = false;
var breakpointTriggered = 0;
- InspectorTest.eventHandler["Debugger.scriptParsed"] = function(messageObject)
+ InspectorProtocol.eventHandler["Debugger.scriptParsed"] = function(messageObject)
{
if (/resources\/breakpoint\.js$/.test(messageObject.params.url)) {
- InspectorTest.log("Found breakpoint.js");
+ ProtocolTest.log("Found breakpoint.js");
var scriptIdentifier = messageObject.params.scriptId;
var location = {scriptId: scriptIdentifier, lineNumber: 8, columnNumber: 0};
var options = {condition: "(a + b) > 10"};
- InspectorTest.sendCommand("Debugger.setBreakpoint", {location: location, options: options}, function(responseObject) {
- InspectorTest.checkForError(responseObject);
- InspectorTest.log("Running breakpointWithCondition multiple times");
- InspectorTest.sendCommand("Runtime.evaluate", {expression: "breakpointWithCondition(1, 2)"});
- InspectorTest.sendCommand("Runtime.evaluate", {expression: "breakpointWithCondition(5, 5)"});
- InspectorTest.sendCommand("Runtime.evaluate", {expression: "breakpointWithCondition(7, 4)"});
+ InspectorProtocol.sendCommand("Debugger.setBreakpoint", {location: location, options: options}, function(responseObject) {
+ InspectorProtocol.checkForError(responseObject);
+ ProtocolTest.log("Running breakpointWithCondition multiple times");
+ InspectorProtocol.sendCommand("Runtime.evaluate", {expression: "breakpointWithCondition(1, 2)"});
+ InspectorProtocol.sendCommand("Runtime.evaluate", {expression: "breakpointWithCondition(5, 5)"});
+ InspectorProtocol.sendCommand("Runtime.evaluate", {expression: "breakpointWithCondition(7, 4)"});
});
}
}
- InspectorTest.eventHandler["Debugger.paused"] = function(messageObject)
+ InspectorProtocol.eventHandler["Debugger.paused"] = function(messageObject)
{
- InspectorTest.log("Hit Breakpoint!");
+ ProtocolTest.log("Hit Breakpoint!");
inBreakpoint = true;
++breakpointTriggered;
var callFrameIdentifier = messageObject.params.callFrames[0].callFrameId;
if (breakpointTriggered === 1) {
- InspectorTest.sendCommand("Debugger.evaluateOnCallFrame", {callFrameId: callFrameIdentifier, expression: "a"}, function(messageObject) {
- InspectorTest.log("Evaluted value of `a` (expecting number 7) was: " + JSON.stringify(messageObject.result.result));
- InspectorTest.sendCommand("Debugger.evaluateOnCallFrame", {callFrameId: callFrameIdentifier, expression: "b"}, function(messageObject) {
- InspectorTest.log("Evaluted value of `b` (expecting number 4) was: " + JSON.stringify(messageObject.result.result));
- InspectorTest.sendCommand("Debugger.resume", {});
+ InspectorProtocol.sendCommand("Debugger.evaluateOnCallFrame", {callFrameId: callFrameIdentifier, expression: "a"}, function(messageObject) {
+ ProtocolTest.log("Evaluted value of `a` (expecting number 7) was: " + JSON.stringify(messageObject.result.result));
+ InspectorProtocol.sendCommand("Debugger.evaluateOnCallFrame", {callFrameId: callFrameIdentifier, expression: "b"}, function(messageObject) {
+ ProtocolTest.log("Evaluted value of `b` (expecting number 4) was: " + JSON.stringify(messageObject.result.result));
+ InspectorProtocol.sendCommand("Debugger.resume", {});
});
});
} else if (breakpointTriggered === 2) {
- InspectorTest.sendCommand("Debugger.evaluateOnCallFrame", {callFrameId: callFrameIdentifier, expression: "a"}, function(messageObject) {
- InspectorTest.log("Evaluted value of `a` (expecting number 4) was: " + JSON.stringify(messageObject.result.result));
- InspectorTest.sendCommand("Debugger.evaluateOnCallFrame", {callFrameId: callFrameIdentifier, expression: "b"}, function(messageObject) {
- InspectorTest.log("Evaluted value of `b` (expecting number 7) was: " + JSON.stringify(messageObject.result.result));
- InspectorTest.log("PASS: hit breakpoints with expected values");
- InspectorTest.completeTest();
+ InspectorProtocol.sendCommand("Debugger.evaluateOnCallFrame", {callFrameId: callFrameIdentifier, expression: "a"}, function(messageObject) {
+ ProtocolTest.log("Evaluted value of `a` (expecting number 4) was: " + JSON.stringify(messageObject.result.result));
+ InspectorProtocol.sendCommand("Debugger.evaluateOnCallFrame", {callFrameId: callFrameIdentifier, expression: "b"}, function(messageObject) {
+ ProtocolTest.log("Evaluted value of `b` (expecting number 7) was: " + JSON.stringify(messageObject.result.result));
+ ProtocolTest.log("PASS: hit breakpoints with expected values");
+ ProtocolTest.completeTest();
});
});
} else {
- InspectorTest.log("FAIL: hit too many breakpoints.");
- InspectorTest.completeTest();
+ ProtocolTest.log("FAIL: hit too many breakpoints.");
+ ProtocolTest.completeTest();
}
}
- InspectorTest.eventHandler["Debugger.resumed"] = function(messageObject)
+ InspectorProtocol.eventHandler["Debugger.resumed"] = function(messageObject)
{
- InspectorTest.log("Resumed, running breakpointWithCondition multiple times again");
+ ProtocolTest.log("Resumed, running breakpointWithCondition multiple times again");
inBreakpoint = false;
- InspectorTest.sendCommand("Runtime.evaluate", {expression: "breakpointWithCondition(9, 0)"});
- InspectorTest.sendCommand("Runtime.evaluate", {expression: "breakpointWithCondition(12, -4)"});
- InspectorTest.sendCommand("Runtime.evaluate", {expression: "breakpointWithCondition(4, 7)"}, function() {
+ InspectorProtocol.sendCommand("Runtime.evaluate", {expression: "breakpointWithCondition(9, 0)"});
+ InspectorProtocol.sendCommand("Runtime.evaluate", {expression: "breakpointWithCondition(12, -4)"});
+ InspectorProtocol.sendCommand("Runtime.evaluate", {expression: "breakpointWithCondition(4, 7)"}, function() {
setTimeout(function() {
if (!inBreakpoint) {
- InspectorTest.log("FAIL: Did not hit conditional breakpoint the second time");
- InspectorTest.completeTest();
+ ProtocolTest.log("FAIL: Did not hit conditional breakpoint the second time");
+ ProtocolTest.completeTest();
}
}, 100);
});
diff --git a/LayoutTests/inspector/debugger/setBreakpoint-dfg-and-modify-local.html b/LayoutTests/inspector/debugger/setBreakpoint-dfg-and-modify-local.html
index 6285285..352ece5 100644
--- a/LayoutTests/inspector/debugger/setBreakpoint-dfg-and-modify-local.html
+++ b/LayoutTests/inspector/debugger/setBreakpoint-dfg-and-modify-local.html
@@ -12,54 +12,54 @@
// This test setting 2 breakpoints in DFG compiled functions: one inlined,
// and one not inlined.
- InspectorTest.sendCommand("Debugger.enable", {});
+ InspectorProtocol.sendCommand("Debugger.enable", {});
var breakpointId = null;
var scriptId = 0;
var startLine = 0;
- InspectorTest.eventHandler["Debugger.scriptParsed"] = function(messageObject)
+ InspectorProtocol.eventHandler["Debugger.scriptParsed"] = function(messageObject)
{
if (/resources\/breakpoint\.js$/.test(messageObject.params.url)) {
- InspectorTest.log("Found breakpoint.js");
+ ProtocolTest.log("Found breakpoint.js");
scriptId = messageObject.params.scriptId;
startLine = messageObject.params.startLine;
- InspectorTest.sendCommand("Runtime.evaluate", {
+ InspectorProtocol.sendCommand("Runtime.evaluate", {
expression: "dfgWithoutInline2();"
}, function(responseObject) {
- InspectorTest.log("dfg function warmed up\n");
+ ProtocolTest.log("dfg function warmed up\n");
var location1 = {scriptId: scriptId, lineNumber: 2, columnNumber: 0};
- InspectorTest.sendCommand("Debugger.setBreakpoint", {location: location1}, function(responseObject) {
- InspectorTest.checkForError(responseObject);
- InspectorTest.log("Breakpoint set in breakpointBasic()");
+ InspectorProtocol.sendCommand("Debugger.setBreakpoint", {location: location1}, function(responseObject) {
+ InspectorProtocol.checkForError(responseObject);
+ ProtocolTest.log("Breakpoint set in breakpointBasic()");
breakpointId = responseObject.result.breakpointId;
- InspectorTest.sendCommand("Runtime.evaluate", {
+ InspectorProtocol.sendCommand("Runtime.evaluate", {
expression: "callNotInlineable2();"
}, function(responseObject) {
- InspectorTest.log("Test complete");
- InspectorTest.completeTest();
+ ProtocolTest.log("Test complete");
+ ProtocolTest.completeTest();
});
});
});
}
}
- InspectorTest.eventHandler["Debugger.paused"] = function(messageObject)
+ InspectorProtocol.eventHandler["Debugger.paused"] = function(messageObject)
{
- InspectorTest.log("Hit Breakpoint!");
+ ProtocolTest.log("Hit Breakpoint!");
var callFrames = messageObject.params.callFrames;
if (callFrames.length < 3)
- InspectorTest.log("FAIL: too few frames in stack trace");
+ ProtocolTest.log("FAIL: too few frames in stack trace");
var callFrameId = callFrames[1].callFrameId;
- InspectorTest.log("Evaluating in DFG frame at frame[1]: 'x = 20000;'");
- InspectorTest.sendCommand("Debugger.evaluateOnCallFrame", { callFrameId: callFrameId, expression: "x = 20000;" }, function(responseObject) {
- InspectorTest.sendCommand("Debugger.resume", {}, function(responseObject) {
- InspectorTest.log("Resumed from breakpoint");
+ ProtocolTest.log("Evaluating in DFG frame at frame[1]: 'x = 20000;'");
+ InspectorProtocol.sendCommand("Debugger.evaluateOnCallFrame", { callFrameId: callFrameId, expression: "x = 20000;" }, function(responseObject) {
+ InspectorProtocol.sendCommand("Debugger.resume", {}, function(responseObject) {
+ ProtocolTest.log("Resumed from breakpoint");
});
});
}
diff --git a/LayoutTests/inspector/debugger/setBreakpoint-dfg-callee-and-examine-dfg-local.html b/LayoutTests/inspector/debugger/setBreakpoint-dfg-callee-and-examine-dfg-local.html
index 23e932e..032bd21 100644
--- a/LayoutTests/inspector/debugger/setBreakpoint-dfg-callee-and-examine-dfg-local.html
+++ b/LayoutTests/inspector/debugger/setBreakpoint-dfg-callee-and-examine-dfg-local.html
@@ -12,52 +12,52 @@
// This test setting a breakpoints in DFG compiled functions callee and then modify
// and examine a global and local via the DFG frame.
- InspectorTest.sendCommand("Debugger.enable", {});
+ InspectorProtocol.sendCommand("Debugger.enable", {});
var breakpointId = null;
var scriptId = 0;
var startLine = 0;
- InspectorTest.eventHandler["Debugger.scriptParsed"] = function(messageObject)
+ InspectorProtocol.eventHandler["Debugger.scriptParsed"] = function(messageObject)
{
if (/resources\/breakpoint\.js$/.test(messageObject.params.url)) {
- InspectorTest.log("Found breakpoint.js");
+ ProtocolTest.log("Found breakpoint.js");
scriptId = messageObject.params.scriptId;
startLine = messageObject.params.startLine;
- InspectorTest.sendCommand("Runtime.evaluate", {
+ InspectorProtocol.sendCommand("Runtime.evaluate", {
expression: "dfgWithoutInline3();"
}, function(responseObject) {
- InspectorTest.log("dfg function warmed up\n");
+ ProtocolTest.log("dfg function warmed up\n");
var location1 = {scriptId: scriptId, lineNumber: 2, columnNumber: 0};
- InspectorTest.sendCommand("Debugger.setBreakpoint", {location: location1}, function(responseObject) {
- InspectorTest.checkForError(responseObject);
- InspectorTest.log("Breakpoint set in breakpointBasic()");
+ InspectorProtocol.sendCommand("Debugger.setBreakpoint", {location: location1}, function(responseObject) {
+ InspectorProtocol.checkForError(responseObject);
+ ProtocolTest.log("Breakpoint set in breakpointBasic()");
breakpointId = responseObject.result.breakpointId;
- InspectorTest.sendCommand("Runtime.evaluate", {
+ InspectorProtocol.sendCommand("Runtime.evaluate", {
expression: "dfgWithoutInline3();"
}, function(responseObject) {
- InspectorTest.log("Test complete");
- InspectorTest.completeTest();
+ ProtocolTest.log("Test complete");
+ ProtocolTest.completeTest();
});
});
});
}
}
- InspectorTest.eventHandler["Debugger.paused"] = function(messageObject)
+ InspectorProtocol.eventHandler["Debugger.paused"] = function(messageObject)
{
function dumpResponse(response)
{
try {
if (response.result.wasThrown) {
- InspectorTest.log("Exception thrown processing request");
+ ProtocolTest.log("Exception thrown processing request");
return false;
}
- InspectorTest.log("Response value is " + response.result.result.value);
+ ProtocolTest.log("Response value is " + response.result.result.value);
return true;
} catch (e) {
return false;
@@ -66,39 +66,39 @@
function resumeFromBreakpoint()
{
- InspectorTest.sendCommand("Debugger.resume", {}, function(responseObject) {
- InspectorTest.log("Resumed from breakpoint");
+ InspectorProtocol.sendCommand("Debugger.resume", {}, function(responseObject) {
+ ProtocolTest.log("Resumed from breakpoint");
});
}
- InspectorTest.log("Hit Breakpoint!");
+ ProtocolTest.log("Hit Breakpoint!");
var callFrames = messageObject.params.callFrames;
if (callFrames.length < 3) {
- InspectorTest.log("FAIL: too few frames in stack trace");
+ ProtocolTest.log("FAIL: too few frames in stack trace");
resumeFromBreakpoint();
return;
}
var callFrameId = callFrames[2].callFrameId;
- InspectorTest.log("Evaluating in DFG frame at frame[2]: 'globalVal3 = 30;'");
- InspectorTest.sendCommand("Debugger.evaluateOnCallFrame", { callFrameId: callFrameId, expression: "globalVal3 = 30;" }, function(responseObject) {
+ ProtocolTest.log("Evaluating in DFG frame at frame[2]: 'globalVal3 = 30;'");
+ InspectorProtocol.sendCommand("Debugger.evaluateOnCallFrame", { callFrameId: callFrameId, expression: "globalVal3 = 30;" }, function(responseObject) {
if (!dumpResponse(responseObject)) {
resumeFromBreakpoint();
return;
}
- InspectorTest.log("Evaluating in DFG frame at frame[2]: 'localVal3 = 12;'");
- InspectorTest.sendCommand("Debugger.evaluateOnCallFrame", { callFrameId: callFrameId, expression: "localVal3 = 12;" }, function(responseObject) {
+ ProtocolTest.log("Evaluating in DFG frame at frame[2]: 'localVal3 = 12;'");
+ InspectorProtocol.sendCommand("Debugger.evaluateOnCallFrame", { callFrameId: callFrameId, expression: "localVal3 = 12;" }, function(responseObject) {
if (!dumpResponse(responseObject)) {
resumeFromBreakpoint();
return;
}
- InspectorTest.log("Evaluating in DFG frame at frame[2]: 'localVal3'");
- InspectorTest.sendCommand("Debugger.evaluateOnCallFrame", { callFrameId: callFrameId, expression: "localVal3" }, function(responseObject) {
+ ProtocolTest.log("Evaluating in DFG frame at frame[2]: 'localVal3'");
+ InspectorProtocol.sendCommand("Debugger.evaluateOnCallFrame", { callFrameId: callFrameId, expression: "localVal3" }, function(responseObject) {
if (!dumpResponse(responseObject)) {
resumeFromBreakpoint();
return;
}
- InspectorTest.sendCommand("Debugger.resume", {}, function(responseObject) {
- InspectorTest.log("Resumed from breakpoint");
+ InspectorProtocol.sendCommand("Debugger.resume", {}, function(responseObject) {
+ ProtocolTest.log("Resumed from breakpoint");
});
});
});
diff --git a/LayoutTests/inspector/debugger/setBreakpoint-dfg.html b/LayoutTests/inspector/debugger/setBreakpoint-dfg.html
index f3f0724..0307a42 100644
--- a/LayoutTests/inspector/debugger/setBreakpoint-dfg.html
+++ b/LayoutTests/inspector/debugger/setBreakpoint-dfg.html
@@ -12,39 +12,39 @@
// This test setting 2 breakpoints in DFG compiled functions: one inlined,
// and one not inlined.
- InspectorTest.sendCommand("Debugger.enable", {});
+ InspectorProtocol.sendCommand("Debugger.enable", {});
var dfgNonInlinedBreakpointId = null;
var dfgInlinedBreakpointId = null;
var scriptIdentifier = 0;
var startLine = 0;
- InspectorTest.eventHandler["Debugger.scriptParsed"] = function(messageObject)
+ InspectorProtocol.eventHandler["Debugger.scriptParsed"] = function(messageObject)
{
if (/resources\/breakpoint\.js$/.test(messageObject.params.url)) {
- InspectorTest.log("Found breakpoint.js");
+ ProtocolTest.log("Found breakpoint.js");
scriptIdentifier = messageObject.params.scriptId;
startLine = messageObject.params.startLine;
- InspectorTest.sendCommand("Runtime.evaluate", {
+ InspectorProtocol.sendCommand("Runtime.evaluate", {
expression: "dfgWithoutInline(); dfgWithInline();"
}, function(responseObject) {
- InspectorTest.log("dfg functions warmed up\n");
+ ProtocolTest.log("dfg functions warmed up\n");
var location1 = {scriptId: scriptIdentifier, lineNumber: 22, columnNumber: 0};
- InspectorTest.sendCommand("Debugger.setBreakpoint", {location: location1}, function(responseObject) {
- InspectorTest.checkForError(responseObject);
- InspectorTest.log("Breakpoint set in notInlineable()");
+ InspectorProtocol.sendCommand("Debugger.setBreakpoint", {location: location1}, function(responseObject) {
+ InspectorProtocol.checkForError(responseObject);
+ ProtocolTest.log("Breakpoint set in notInlineable()");
dfgNonInlinedBreakpointId = responseObject.result.breakpointId;
var location2 = {scriptId: scriptIdentifier, lineNumber: 28, columnNumber: 0};
- InspectorTest.sendCommand("Debugger.setBreakpoint", {location: location2}, function(responseObject) {
- InspectorTest.checkForError(responseObject);
- InspectorTest.log("Breakpoint set in inlineable()\n");
+ InspectorProtocol.sendCommand("Debugger.setBreakpoint", {location: location2}, function(responseObject) {
+ InspectorProtocol.checkForError(responseObject);
+ ProtocolTest.log("Breakpoint set in inlineable()\n");
dfgInlinedBreakpointId = responseObject.result.breakpointId;
- InspectorTest.sendCommand("Runtime.evaluate", {
+ InspectorProtocol.sendCommand("Runtime.evaluate", {
expression: "dfgWithoutInline(); dfgWithInline();"
});
});
@@ -54,24 +54,24 @@
}
var breakpointsHit = 0;
- InspectorTest.eventHandler["Debugger.paused"] = function(messageObject)
+ InspectorProtocol.eventHandler["Debugger.paused"] = function(messageObject)
{
var breakpointId = null;
breakpointsHit++;
- InspectorTest.log("Hit Breakpoint " + breakpointsHit + "!");
+ ProtocolTest.log("Hit Breakpoint " + breakpointsHit + "!");
if (breakpointsHit == 1)
breakpointId = dfgNonInlinedBreakpointId;
else if (breakpointsHit == 2)
breakpointId = dfgInlinedBreakpointId;
else
- InspectorTest.log("Unexpected breakpoint");
+ ProtocolTest.log("Unexpected breakpoint");
- InspectorTest.sendCommand("Debugger.removeBreakpoint", {"breakpointId": breakpointId}, function(responseObject) {
- InspectorTest.log("Removed Breakpoint " + breakpointsHit + "!");
- InspectorTest.sendCommand("Debugger.resume", {}, function(responseObject) {
+ InspectorProtocol.sendCommand("Debugger.removeBreakpoint", {"breakpointId": breakpointId}, function(responseObject) {
+ ProtocolTest.log("Removed Breakpoint " + breakpointsHit + "!");
+ InspectorProtocol.sendCommand("Debugger.resume", {}, function(responseObject) {
if (breakpointsHit == 2) {
- InspectorTest.log("PASS");
- InspectorTest.completeTest();
+ ProtocolTest.log("PASS");
+ ProtocolTest.completeTest();
}
});
});
diff --git a/LayoutTests/inspector/debugger/setBreakpoint-options-exception.html b/LayoutTests/inspector/debugger/setBreakpoint-options-exception.html
index 44c6893..cf91e24 100644
--- a/LayoutTests/inspector/debugger/setBreakpoint-options-exception.html
+++ b/LayoutTests/inspector/debugger/setBreakpoint-options-exception.html
@@ -5,51 +5,51 @@
<script>
function test()
{
- InspectorTest.importScript("console-test.js");
+ ProtocolTest.importScript("console-test.js");
- InspectorTest.sendCommand("Console.enable", {});
- InspectorTest.sendCommand("Debugger.enable", {});
+ InspectorProtocol.sendCommand("Console.enable", {});
+ InspectorProtocol.sendCommand("Debugger.enable", {});
var logsSeen = 0;
const expectedLogs = 2;
- InspectorTest.eventHandler["Debugger.scriptParsed"] = function(messageObject)
+ InspectorProtocol.eventHandler["Debugger.scriptParsed"] = function(messageObject)
{
if (/resources\/breakpoint\.js$/.test(messageObject.params.url)) {
- InspectorTest.log("Found breakpoint.js");
+ ProtocolTest.log("Found breakpoint.js");
var scriptIdentifier = messageObject.params.scriptId;
var location = {scriptId: scriptIdentifier, lineNumber: 8, columnNumber: 0};
var options = {condition: "this.will.cause.exception", autoContinue: true};
- InspectorTest.sendCommand("Debugger.setBreakpoint", {location: location, options: options}, function(responseObject) {
- InspectorTest.checkForError(responseObject);
- InspectorTest.log("Running breakpointWithCondition to trigger condition exception.");
- InspectorTest.sendCommand("Runtime.evaluate", {expression: "breakpointWithCondition(1,2)"}, function() {
+ InspectorProtocol.sendCommand("Debugger.setBreakpoint", {location: location, options: options}, function(responseObject) {
+ InspectorProtocol.checkForError(responseObject);
+ ProtocolTest.log("Running breakpointWithCondition to trigger condition exception.");
+ InspectorProtocol.sendCommand("Runtime.evaluate", {expression: "breakpointWithCondition(1,2)"}, function() {
location = {scriptId: scriptIdentifier, lineNumber: 18, columnNumber: 0};
options = {actions: [{"type": "evaluate", "data": "this.will.cause.exception"}], autoContinue: true};
- InspectorTest.sendCommand("Debugger.setBreakpoint", {location: location, options: options}, function(responseObject) {
- InspectorTest.log("Running breakpointActions to trigger actions exception.");
- InspectorTest.sendCommand("Runtime.evaluate", {expression: "breakpointActions(1,2)"});
+ InspectorProtocol.sendCommand("Debugger.setBreakpoint", {location: location, options: options}, function(responseObject) {
+ ProtocolTest.log("Running breakpointActions to trigger actions exception.");
+ InspectorProtocol.sendCommand("Runtime.evaluate", {expression: "breakpointActions(1,2)"});
});
});
});
}
}
- InspectorTest.eventHandler["Debugger.paused"] = function(messageObject)
+ InspectorProtocol.eventHandler["Debugger.paused"] = function(messageObject)
{
- InspectorTest.log("Hit Breakpoint!");
+ ProtocolTest.log("Hit Breakpoint!");
- InspectorTest.log("FAIL: should not have hit breakpoint, autoContinue was true");
- InspectorTest.completeTest();
+ ProtocolTest.log("FAIL: should not have hit breakpoint, autoContinue was true");
+ ProtocolTest.completeTest();
}
- InspectorTest.eventHandler["Console.messageAdded"] = function(messageObject)
+ InspectorProtocol.eventHandler["Console.messageAdded"] = function(messageObject)
{
- var message = InspectorTest.Console.sanitizeConsoleMessage(messageObject);
- InspectorTest.log("PASS: Console Message: " + JSON.stringify(message));
+ var message = ProtocolTest.Console.sanitizeConsoleMessage(messageObject);
+ ProtocolTest.log("PASS: Console Message: " + JSON.stringify(message));
if (++logsSeen === expectedLogs)
- InspectorTest.completeTest();
+ ProtocolTest.completeTest();
}
}
</script>
diff --git a/LayoutTests/inspector/debugger/setBreakpoint.html b/LayoutTests/inspector/debugger/setBreakpoint.html
index 143a23c..8a86726e 100644
--- a/LayoutTests/inspector/debugger/setBreakpoint.html
+++ b/LayoutTests/inspector/debugger/setBreakpoint.html
@@ -5,35 +5,35 @@
<script>
function test()
{
- InspectorTest.sendCommand("Debugger.enable", {});
+ InspectorProtocol.sendCommand("Debugger.enable", {});
- InspectorTest.eventHandler["Debugger.scriptParsed"] = function(messageObject)
+ InspectorProtocol.eventHandler["Debugger.scriptParsed"] = function(messageObject)
{
if (/resources\/breakpoint\.js$/.test(messageObject.params.url)) {
- InspectorTest.log("Found breakpoint.js");
+ ProtocolTest.log("Found breakpoint.js");
var scriptIdentifier = messageObject.params.scriptId;
var location = {scriptId: scriptIdentifier, lineNumber: 3, columnNumber: 0};
- InspectorTest.sendCommand("Debugger.setBreakpoint", {location: location}, function(responseObject) {
- InspectorTest.checkForError(responseObject);
- InspectorTest.sendCommand("Debugger.setBreakpoint", {location: location}, function(responseObject) {
+ InspectorProtocol.sendCommand("Debugger.setBreakpoint", {location: location}, function(responseObject) {
+ InspectorProtocol.checkForError(responseObject);
+ InspectorProtocol.sendCommand("Debugger.setBreakpoint", {location: location}, function(responseObject) {
if (!responseObject.error) {
- InspectorTest.log("FAIL: Expected error setting duplicate breakpoint");
- InspectorTest.completeTest();
+ ProtocolTest.log("FAIL: Expected error setting duplicate breakpoint");
+ ProtocolTest.completeTest();
} else {
- InspectorTest.log("PASS: Received error setting duplicate breakpoint: " + responseObject.error.message);
- InspectorTest.log("Running breakpointBasic");
- InspectorTest.sendCommand("Runtime.evaluate", {expression: "breakpointBasic()"});
+ ProtocolTest.log("PASS: Received error setting duplicate breakpoint: " + responseObject.error.message);
+ ProtocolTest.log("Running breakpointBasic");
+ InspectorProtocol.sendCommand("Runtime.evaluate", {expression: "breakpointBasic()"});
}
});
});
}
}
- InspectorTest.eventHandler["Debugger.paused"] = function(messageObject)
+ InspectorProtocol.eventHandler["Debugger.paused"] = function(messageObject)
{
- InspectorTest.log("Hit Breakpoint!");
- InspectorTest.log("PASS");
- InspectorTest.completeTest();
+ ProtocolTest.log("Hit Breakpoint!");
+ ProtocolTest.log("PASS");
+ ProtocolTest.completeTest();
}
}
</script>
diff --git a/LayoutTests/inspector/debugger/setBreakpointByUrl-sourceURL.html b/LayoutTests/inspector/debugger/setBreakpointByUrl-sourceURL.html
index 0ef0f24..dae4f91 100644
--- a/LayoutTests/inspector/debugger/setBreakpointByUrl-sourceURL.html
+++ b/LayoutTests/inspector/debugger/setBreakpointByUrl-sourceURL.html
@@ -8,30 +8,30 @@
function test()
{
- InspectorTest.sendCommand("Debugger.enable", {});
+ InspectorProtocol.sendCommand("Debugger.enable", {});
- InspectorTest.eventHandler["Debugger.scriptParsed"] = function(messageObject)
+ InspectorProtocol.eventHandler["Debugger.scriptParsed"] = function(messageObject)
{
if (/sourceURL-test\.js$/.test(messageObject.params.url)) {
- InspectorTest.log("Found sourceURL-test.js");
+ ProtocolTest.log("Found sourceURL-test.js");
var params = {url: messageObject.params.url, lineNumber: 3, columnNumber: 0};
- InspectorTest.sendCommand("Debugger.setBreakpointByUrl", params, function(responseObject) {
- InspectorTest.checkForError(responseObject);
- InspectorTest.log("Running sourceURLFunction");
- InspectorTest.sendCommand("Runtime.evaluate", {expression: "sourceURLFunction()"});
+ InspectorProtocol.sendCommand("Debugger.setBreakpointByUrl", params, function(responseObject) {
+ InspectorProtocol.checkForError(responseObject);
+ ProtocolTest.log("Running sourceURLFunction");
+ InspectorProtocol.sendCommand("Runtime.evaluate", {expression: "sourceURLFunction()"});
});
}
}
- InspectorTest.eventHandler["Debugger.paused"] = function(messageObject)
+ InspectorProtocol.eventHandler["Debugger.paused"] = function(messageObject)
{
- InspectorTest.log("Hit Breakpoint!");
+ ProtocolTest.log("Hit Breakpoint!");
var callFrameIdentifier = messageObject.params.callFrames[0].callFrameId;
- InspectorTest.sendCommand("Debugger.evaluateOnCallFrame", {callFrameId: callFrameIdentifier, expression: "a"}, function(messageObject) {
- InspectorTest.log("Evaluted value of `a` (expecting number 1) was: " + JSON.stringify(messageObject.result.result));
- InspectorTest.sendCommand("Debugger.evaluateOnCallFrame", {callFrameId: callFrameIdentifier, expression: "c"}, function(messageObject) {
- InspectorTest.log("Evaluted value of `c` (expecting undefined) was: " + JSON.stringify(messageObject.result.result));
- InspectorTest.completeTest();
+ InspectorProtocol.sendCommand("Debugger.evaluateOnCallFrame", {callFrameId: callFrameIdentifier, expression: "a"}, function(messageObject) {
+ ProtocolTest.log("Evaluted value of `a` (expecting number 1) was: " + JSON.stringify(messageObject.result.result));
+ InspectorProtocol.sendCommand("Debugger.evaluateOnCallFrame", {callFrameId: callFrameIdentifier, expression: "c"}, function(messageObject) {
+ ProtocolTest.log("Evaluted value of `c` (expecting undefined) was: " + JSON.stringify(messageObject.result.result));
+ ProtocolTest.completeTest();
});
});
}
diff --git a/LayoutTests/inspector/debugger/setPauseOnExceptions-all.html b/LayoutTests/inspector/debugger/setPauseOnExceptions-all.html
index b2c03f1..9e6f2dc 100644
--- a/LayoutTests/inspector/debugger/setPauseOnExceptions-all.html
+++ b/LayoutTests/inspector/debugger/setPauseOnExceptions-all.html
@@ -43,7 +43,7 @@
var statement = list[i];
var last = i === list.length - 1;
var responseCallback = last ? function() { setTimeout(callback, 10); } : function(){};
- InspectorTest.sendCommand("Runtime.evaluate", {expression: "setTimeout(function() { " + statement + " }, 0);"}, responseCallback);
+ InspectorProtocol.sendCommand("Runtime.evaluate", {expression: "setTimeout(function() { " + statement + " }, 0);"}, responseCallback);
}
}
@@ -51,7 +51,7 @@
{
var statements = statementsWithoutExceptions;
evaluateStatements(statements, function() {
- InspectorTest.log("PASS - did not pause on non-exception statements");
+ ProtocolTest.log("PASS - did not pause on non-exception statements");
callback();
});
}
@@ -64,7 +64,7 @@
// Evaluate statement and expect to pause.
if (currentCaughtExceptionStatement < statementsWithCaughtExceptions.length) {
var statement = statementsWithCaughtExceptions[currentCaughtExceptionStatement++];
- InspectorTest.sendCommand("Runtime.evaluate", {expression: "setTimeout(function() { " + statement + " }, 0);"});
+ InspectorProtocol.sendCommand("Runtime.evaluate", {expression: "setTimeout(function() { " + statement + " }, 0);"});
return;
}
@@ -73,7 +73,7 @@
return;
// Done evaluating caught exceptions statements. Move on to uncaught exceptions.
- InspectorTest.log("PASS - paused for each caught exception");
+ ProtocolTest.log("PASS - paused for each caught exception");
triggerNext = triggerNextUncaughtException;
triggerNext();
}
@@ -83,7 +83,7 @@
// Evaluate statement and expect to pause.
if (currentUncaughtExceptionStatement < statementsWithUncaughtExceptions.length) {
var statement = statementsWithUncaughtExceptions[currentUncaughtExceptionStatement++];
- InspectorTest.sendCommand("Runtime.evaluate", {expression: "setTimeout(function() { " + statement + " }, 0);"});
+ InspectorProtocol.sendCommand("Runtime.evaluate", {expression: "setTimeout(function() { " + statement + " }, 0);"});
return;
}
@@ -92,40 +92,40 @@
return;
// Done evaluating statements to pause. Evaluate some more we do not expect to pause.
- InspectorTest.log("PASS - paused for each uncaught exception");
+ ProtocolTest.log("PASS - paused for each uncaught exception");
expectPause = false;
evaluateExpectedNoPauses(function() {
- InspectorTest.completeTest();
+ ProtocolTest.completeTest();
});
}
- InspectorTest.sendCommand("Debugger.enable", {});
- InspectorTest.sendCommand("Debugger.setPauseOnExceptions", {state: "all"}, function(responseObject) {
- InspectorTest.checkForError(responseObject);
- InspectorTest.log("Debugger.setPauseOnExceptions - all");
+ InspectorProtocol.sendCommand("Debugger.enable", {});
+ InspectorProtocol.sendCommand("Debugger.setPauseOnExceptions", {state: "all"}, function(responseObject) {
+ InspectorProtocol.checkForError(responseObject);
+ ProtocolTest.log("Debugger.setPauseOnExceptions - all");
evaluateExpectedNoPauses(function() {
expectPause = true;
triggerNext();
});
});
- InspectorTest.eventHandler["Debugger.paused"] = function(messageObject)
+ InspectorProtocol.eventHandler["Debugger.paused"] = function(messageObject)
{
- InspectorTest.log("Paused!");
+ ProtocolTest.log("Paused!");
if (!expectPause) {
- InspectorTest.log("FAIL - debugger paused when we did not expect to");
- InspectorTest.completeTest();
+ ProtocolTest.log("FAIL - debugger paused when we did not expect to");
+ ProtocolTest.completeTest();
return;
}
- InspectorTest.sendCommand("Debugger.resume", {});
+ InspectorProtocol.sendCommand("Debugger.resume", {});
}
- InspectorTest.eventHandler["Debugger.resumed"] = function(messageObject)
+ InspectorProtocol.eventHandler["Debugger.resumed"] = function(messageObject)
{
- InspectorTest.log("Resumed");
+ ProtocolTest.log("Resumed");
triggerNext();
}
}
diff --git a/LayoutTests/inspector/debugger/setPauseOnExceptions-none.html b/LayoutTests/inspector/debugger/setPauseOnExceptions-none.html
index ed6ec49..8e32d54 100644
--- a/LayoutTests/inspector/debugger/setPauseOnExceptions-none.html
+++ b/LayoutTests/inspector/debugger/setPauseOnExceptions-none.html
@@ -5,38 +5,38 @@
<script>
function test()
{
- InspectorTest.sendCommand("Debugger.enable", {});
- InspectorTest.sendCommand("Debugger.setPauseOnExceptions", {state: "none"}, function(responseObject) {
- InspectorTest.checkForError(responseObject);
- InspectorTest.log("Debugger.setPauseOnExceptions - none");
- InspectorTest.sendCommand("Runtime.evaluate", {expression: "setTimeout(function() { 1+1; }, 0);"});
- InspectorTest.sendCommand("Runtime.evaluate", {expression: "setTimeout(function() { noException(); }, 0);"});
- InspectorTest.sendCommand("Runtime.evaluate", {expression: "setTimeout(function() { catchNested(noException, 7); }, 0);"});
- InspectorTest.sendCommand("Runtime.evaluate", {expression: "setTimeout(function() { try{ ({}).a.b.c.d } catch (e) { console.log('caught inline: ' + JSON.stringify(e)); } }, 0);"});
- InspectorTest.sendCommand("Runtime.evaluate", {expression: "setTimeout(function() { catchNested(exceptionBasic, 1); }, 0);"});
- InspectorTest.sendCommand("Runtime.evaluate", {expression: "setTimeout(function() { catchNested(exceptionDOM, 2); }, 0);"});
- InspectorTest.sendCommand("Runtime.evaluate", {expression: "setTimeout(function() { catchNested(exceptionInHostFunction, 3); }, 0);"});
- InspectorTest.sendCommand("Runtime.evaluate", {expression: "setTimeout(function() { catchNested(throwString, 10); }, 0);"});
- InspectorTest.sendCommand("Runtime.evaluate", {expression: "setTimeout(function() { catchNested(throwParam, 5, new Error('error message')); }, 0);"});
- InspectorTest.sendCommand("Runtime.evaluate", {expression: "setTimeout(function() { {}.a.b.c.d; }, 0);"});
- InspectorTest.sendCommand("Runtime.evaluate", {expression: "setTimeout(function() { exceptionBasic(); }, 0);"});
- InspectorTest.sendCommand("Runtime.evaluate", {expression: "setTimeout(function() { exceptionDOM(); }, 0);"});
- InspectorTest.sendCommand("Runtime.evaluate", {expression: "setTimeout(function() { exceptionInHostFunction(); }, 0);"});
- InspectorTest.sendCommand("Runtime.evaluate", {expression: "setTimeout(function() { throwString(); }, 0);"});
- InspectorTest.sendCommand("Runtime.evaluate", {expression: "setTimeout(function() { throwParam({x:1}); }, 0);"});
- InspectorTest.sendCommand("Runtime.evaluate", {expression: "setTimeout(function() { throwParam(new Error('error message')); }, 0);"}, function() {
+ InspectorProtocol.sendCommand("Debugger.enable", {});
+ InspectorProtocol.sendCommand("Debugger.setPauseOnExceptions", {state: "none"}, function(responseObject) {
+ InspectorProtocol.checkForError(responseObject);
+ ProtocolTest.log("Debugger.setPauseOnExceptions - none");
+ InspectorProtocol.sendCommand("Runtime.evaluate", {expression: "setTimeout(function() { 1+1; }, 0);"});
+ InspectorProtocol.sendCommand("Runtime.evaluate", {expression: "setTimeout(function() { noException(); }, 0);"});
+ InspectorProtocol.sendCommand("Runtime.evaluate", {expression: "setTimeout(function() { catchNested(noException, 7); }, 0);"});
+ InspectorProtocol.sendCommand("Runtime.evaluate", {expression: "setTimeout(function() { try{ ({}).a.b.c.d } catch (e) { console.log('caught inline: ' + JSON.stringify(e)); } }, 0);"});
+ InspectorProtocol.sendCommand("Runtime.evaluate", {expression: "setTimeout(function() { catchNested(exceptionBasic, 1); }, 0);"});
+ InspectorProtocol.sendCommand("Runtime.evaluate", {expression: "setTimeout(function() { catchNested(exceptionDOM, 2); }, 0);"});
+ InspectorProtocol.sendCommand("Runtime.evaluate", {expression: "setTimeout(function() { catchNested(exceptionInHostFunction, 3); }, 0);"});
+ InspectorProtocol.sendCommand("Runtime.evaluate", {expression: "setTimeout(function() { catchNested(throwString, 10); }, 0);"});
+ InspectorProtocol.sendCommand("Runtime.evaluate", {expression: "setTimeout(function() { catchNested(throwParam, 5, new Error('error message')); }, 0);"});
+ InspectorProtocol.sendCommand("Runtime.evaluate", {expression: "setTimeout(function() { {}.a.b.c.d; }, 0);"});
+ InspectorProtocol.sendCommand("Runtime.evaluate", {expression: "setTimeout(function() { exceptionBasic(); }, 0);"});
+ InspectorProtocol.sendCommand("Runtime.evaluate", {expression: "setTimeout(function() { exceptionDOM(); }, 0);"});
+ InspectorProtocol.sendCommand("Runtime.evaluate", {expression: "setTimeout(function() { exceptionInHostFunction(); }, 0);"});
+ InspectorProtocol.sendCommand("Runtime.evaluate", {expression: "setTimeout(function() { throwString(); }, 0);"});
+ InspectorProtocol.sendCommand("Runtime.evaluate", {expression: "setTimeout(function() { throwParam({x:1}); }, 0);"});
+ InspectorProtocol.sendCommand("Runtime.evaluate", {expression: "setTimeout(function() { throwParam(new Error('error message')); }, 0);"}, function() {
setTimeout(function() {
- InspectorTest.log("PASS: No pauses");
- InspectorTest.completeTest();
+ ProtocolTest.log("PASS: No pauses");
+ ProtocolTest.completeTest();
}, 10);
});
});
- InspectorTest.eventHandler["Debugger.paused"] = function(messageObject)
+ InspectorProtocol.eventHandler["Debugger.paused"] = function(messageObject)
{
- InspectorTest.log("Paused!");
- InspectorTest.log("FAIL");
- InspectorTest.completeTest();
+ ProtocolTest.log("Paused!");
+ ProtocolTest.log("FAIL");
+ ProtocolTest.completeTest();
}
}
</script>
diff --git a/LayoutTests/inspector/debugger/setPauseOnExceptions-uncaught.html b/LayoutTests/inspector/debugger/setPauseOnExceptions-uncaught.html
index 06b2b26..9143b69 100644
--- a/LayoutTests/inspector/debugger/setPauseOnExceptions-uncaught.html
+++ b/LayoutTests/inspector/debugger/setPauseOnExceptions-uncaught.html
@@ -42,7 +42,7 @@
var statement = list[i];
var last = i === list.length - 1;
var responseCallback = last ? function() { setTimeout(callback, 10); } : function(){};
- InspectorTest.sendCommand("Runtime.evaluate", {expression: "setTimeout(function() { " + statement + " }, 0);"}, responseCallback);
+ InspectorProtocol.sendCommand("Runtime.evaluate", {expression: "setTimeout(function() { " + statement + " }, 0);"}, responseCallback);
}
}
@@ -50,7 +50,7 @@
{
var statements = statementsWithoutExceptions.concat(statementsWithCaughtExceptions);
evaluateStatements(statements, function() {
- InspectorTest.log("PASS - did not pause on non-exception statements or caught exception statements");
+ ProtocolTest.log("PASS - did not pause on non-exception statements or caught exception statements");
callback();
});
}
@@ -60,7 +60,7 @@
// Evaluate statement and expect to pause.
if (currentUncaughtExceptionStatement < statementsWithUncaughtExceptions.length) {
var statement = statementsWithUncaughtExceptions[currentUncaughtExceptionStatement++];
- InspectorTest.sendCommand("Runtime.evaluate", {expression: "setTimeout(function() { " + statement + " }, 0);"});
+ InspectorProtocol.sendCommand("Runtime.evaluate", {expression: "setTimeout(function() { " + statement + " }, 0);"});
return;
}
@@ -69,41 +69,41 @@
return;
// Done evaluating statements to pause. Evaluate some more we do not expect to pause.
- InspectorTest.log("PASS - paused for each uncaught exception");
+ ProtocolTest.log("PASS - paused for each uncaught exception");
expectPause = false;
evaluateExpectedNoPauses(function() {
- InspectorTest.log("PASS");
- InspectorTest.completeTest();
+ ProtocolTest.log("PASS");
+ ProtocolTest.completeTest();
});
}
- InspectorTest.sendCommand("Debugger.enable", {});
- InspectorTest.sendCommand("Debugger.setPauseOnExceptions", {state: "uncaught"}, function(responseObject) {
- InspectorTest.checkForError(responseObject);
- InspectorTest.log("Debugger.setPauseOnExceptions - uncaught");
+ InspectorProtocol.sendCommand("Debugger.enable", {});
+ InspectorProtocol.sendCommand("Debugger.setPauseOnExceptions", {state: "uncaught"}, function(responseObject) {
+ InspectorProtocol.checkForError(responseObject);
+ ProtocolTest.log("Debugger.setPauseOnExceptions - uncaught");
evaluateExpectedNoPauses(function() {
expectPause = true;
triggerNextUncaughtException();
});
});
- InspectorTest.eventHandler["Debugger.paused"] = function(messageObject)
+ InspectorProtocol.eventHandler["Debugger.paused"] = function(messageObject)
{
- InspectorTest.log("Paused!");
+ ProtocolTest.log("Paused!");
if (!expectPause) {
- InspectorTest.log("FAIL - debugger paused when we did not expect to");
- InspectorTest.completeTest();
+ ProtocolTest.log("FAIL - debugger paused when we did not expect to");
+ ProtocolTest.completeTest();
return;
}
- InspectorTest.sendCommand("Debugger.resume", {});
+ InspectorProtocol.sendCommand("Debugger.resume", {});
}
- InspectorTest.eventHandler["Debugger.resumed"] = function(messageObject)
+ InspectorProtocol.eventHandler["Debugger.resumed"] = function(messageObject)
{
- InspectorTest.log("Resumed");
+ ProtocolTest.log("Resumed");
triggerNextUncaughtException();
}
}
diff --git a/LayoutTests/inspector/debugger/setVariableValue.html b/LayoutTests/inspector/debugger/setVariableValue.html
index ab0cc69..7c8aee7 100644
--- a/LayoutTests/inspector/debugger/setVariableValue.html
+++ b/LayoutTests/inspector/debugger/setVariableValue.html
@@ -15,14 +15,14 @@
try {
processStepOrFail(s);
} catch (e) {
- InspectorTest.log(e.stack);
- InspectorTest.completeTest();
+ ProtocolTest.log(e.stack);
+ ProtocolTest.completeTest();
}
}
function processStepOrFail(s) {
if (!s) {
- InspectorTest.completeTest();
+ ProtocolTest.completeTest();
return;
}
if (!s.command) {
@@ -37,29 +37,29 @@
if ("error" in response) {
if (!("errorHandler" in s)) {
// Error message is not logged intentionally, it may be platform-specific.
- InspectorTest.log("Protocol command '" + s.command + "' failed");
- InspectorTest.completeTest();
+ ProtocolTest.log("Protocol command '" + s.command + "' failed");
+ ProtocolTest.completeTest();
return;
}
try {
next = s.errorHandler(response.error);
} catch (e) {
- InspectorTest.log(e.stack);
- InspectorTest.completeTest();
+ ProtocolTest.log(e.stack);
+ ProtocolTest.completeTest();
return;
}
} else {
try {
next = s.callback(response.result);
} catch (e) {
- InspectorTest.log(e.stack);
- InspectorTest.completeTest();
+ ProtocolTest.log(e.stack);
+ ProtocolTest.completeTest();
return;
}
}
processStep(next);
}
- InspectorTest.sendCommand(s.command, s.params, innerCallback);
+ InspectorProtocol.sendCommand(s.command, s.params, innerCallback);
}
}
@@ -95,8 +95,8 @@
};
function callbackLogClosureEval(result) {
- InspectorTest.log("Closure returns: " + JSON.stringify(result.result));
- InspectorTest.log(" (expected: 'ttttrue52013')");
+ ProtocolTest.log("Closure returns: " + JSON.stringify(result.result));
+ ProtocolTest.log(" (expected: 'ttttrue52013')");
var params = {
functionObjectId: functionObjectId,
@@ -110,7 +110,7 @@
}
function setVariableCallback() {
- InspectorTest.log("Debugger.setVariableValue OK");
+ ProtocolTest.log("Debugger.setVariableValue OK");
var params = {
objectId: functionObjectId,
@@ -123,8 +123,8 @@
}
function callbackLogClosureEval2(result) {
- InspectorTest.log("Closure returns: " + JSON.stringify(result.result));
- InspectorTest.log(" (expected: 'ttttrue42013')");
+ ProtocolTest.log("Closure returns: " + JSON.stringify(result.result));
+ ProtocolTest.log(" (expected: 'ttttrue42013')");
var params = {
// No target is specified
@@ -138,7 +138,7 @@
}
function setVariableErrorCallback3(error) {
- InspectorTest.log("Expected error: " + JSON.stringify(error));
+ ProtocolTest.log("Expected error: " + JSON.stringify(error));
var params = {
functionObjectId: functionObjectId,
@@ -152,7 +152,7 @@
}
function setVariableErrorCallback4(error) {
- InspectorTest.log("Expected error");
+ ProtocolTest.log("Expected error");
var params = {
functionObjectId: functionObjectId,
@@ -166,7 +166,7 @@
}
function setVariableErrorCallback5(error) {
- InspectorTest.log("Expected error");
+ ProtocolTest.log("Expected error");
// End of test.
return;
diff --git a/LayoutTests/inspector/debugger/terminate-dedicated-worker-while-paused.html b/LayoutTests/inspector/debugger/terminate-dedicated-worker-while-paused.html
index 45bc3f7..864b1a4 100644
--- a/LayoutTests/inspector/debugger/terminate-dedicated-worker-while-paused.html
+++ b/LayoutTests/inspector/debugger/terminate-dedicated-worker-while-paused.html
@@ -18,7 +18,7 @@
var workerRequestId = 1;
function sendCommandToWorker(method, params)
{
- InspectorTest.sendCommand("Worker.sendMessageToWorker", {
+ InspectorProtocol.sendCommand("Worker.sendMessageToWorker", {
"workerId": workerId,
"message": {
"method": method,
@@ -28,32 +28,32 @@
});
}
- InspectorTest.sendCommand("Worker.enable", {}, function(messageObject) {
+ InspectorProtocol.sendCommand("Worker.enable", {}, function(messageObject) {
if ("error" in messageObject) {
- InspectorTest.log("FAIL: Couldn't enable worker debugger: " + messageObject.error.message);
- InspectorTest.completeTest();
+ ProtocolTest.log("FAIL: Couldn't enable worker debugger: " + messageObject.error.message);
+ ProtocolTest.completeTest();
}
});
- InspectorTest.eventHandler["Worker.workerCreated"] = function(messageObject)
+ InspectorProtocol.eventHandler["Worker.workerCreated"] = function(messageObject)
{
workerId = messageObject["params"]["workerId"];
- InspectorTest.log("Worker created");
- InspectorTest.sendCommand("Worker.connectToWorker", {"workerId": workerId}, function(messageObject) {
- InspectorTest.log("didConnectToWorker");
+ ProtocolTest.log("Worker created");
+ InspectorProtocol.sendCommand("Worker.connectToWorker", {"workerId": workerId}, function(messageObject) {
+ ProtocolTest.log("didConnectToWorker");
sendCommandToWorker("Debugger.enable", {});
sendCommandToWorker("Debugger.pause", {});
});
}
- InspectorTest.eventHandler["Worker.dispatchMessageFromWorker"] = function(messageObject)
+ InspectorProtocol.eventHandler["Worker.dispatchMessageFromWorker"] = function(messageObject)
{
var message = messageObject["params"]["message"];
if (message["method"] === "Debugger.paused") {
- InspectorTest.log("Worker paused");
- InspectorTest.sendCommand("Runtime.evaluate", {"expression": "worker.terminate()"}, function(messageObject) {
- InspectorTest.log("SUCCESS: Did terminate paused worker");
- InspectorTest.completeTest();
+ ProtocolTest.log("Worker paused");
+ InspectorProtocol.sendCommand("Runtime.evaluate", {"expression": "worker.terminate()"}, function(messageObject) {
+ ProtocolTest.log("SUCCESS: Did terminate paused worker");
+ ProtocolTest.completeTest();
});
}
}
diff --git a/LayoutTests/inspector/dom-debugger/node-removed.html b/LayoutTests/inspector/dom-debugger/node-removed.html
index 2880f11..ac78beb 100644
--- a/LayoutTests/inspector/dom-debugger/node-removed.html
+++ b/LayoutTests/inspector/dom-debugger/node-removed.html
@@ -19,11 +19,11 @@
{
var nodesById = {};
- InspectorTest.eventHandler["DOM.setChildNodes"] = onSetChildNodes;
- InspectorTest.eventHandler["DOM.childNodeRemoved"] = onChildNodeRemoved;
- InspectorTest.eventHandler["DOM.childNodeInserted"] = onChildNodeInserted;
- InspectorTest.eventHandler["Debugger.paused"] = onDebuggerPaused;
- InspectorTest.eventHandler["Debugger.scriptParsed"] = onScriptParsed;
+ InspectorProtocol.eventHandler["DOM.setChildNodes"] = onSetChildNodes;
+ InspectorProtocol.eventHandler["DOM.childNodeRemoved"] = onChildNodeRemoved;
+ InspectorProtocol.eventHandler["DOM.childNodeInserted"] = onChildNodeInserted;
+ InspectorProtocol.eventHandler["Debugger.paused"] = onDebuggerPaused;
+ InspectorProtocol.eventHandler["Debugger.scriptParsed"] = onScriptParsed;
function createNodeAttributesMap(attributes)
{
@@ -70,23 +70,23 @@
function onChildNodeRemoved(response)
{
var nodeId = response.params.nodeId;
- InspectorTest.assert(getNodeIdentifier(nodeId) === "div#target_element", "onChildNodeRemoved called for #target_element");
+ ProtocolTest.assert(getNodeIdentifier(nodeId) === "div#target_element", "onChildNodeRemoved called for #target_element");
delete nodesById[nodeId];
}
function onChildNodeInserted(response)
{
collectNode(response.params.node);
- InspectorTest.assert(getNodeIdentifier(response.params.parentNodeId) === "div#final_container", "onChildNodeInserted called for parent node #final_container");
- InspectorTest.assert(getNodeIdentifier(response.params.node.nodeId) === "div#target_element", "onChildNodeInserted called for child node #target_element");
+ 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");
}
function onDebuggerPaused(response)
{
- InspectorTest.log("Stopped on DOM breakpoint");
- InspectorTest.sendCommand("Runtime.evaluate", {"expression": "moveNode()"}, function() {
- InspectorTest.sendCommand("Debugger.resume");
- InspectorTest.completeTest();
+ ProtocolTest.log("Stopped on DOM breakpoint");
+ InspectorProtocol.sendCommand("Runtime.evaluate", {"expression": "moveNode()"}, function() {
+ InspectorProtocol.sendCommand("Debugger.resume");
+ ProtocolTest.completeTest();
});
}
@@ -95,19 +95,19 @@
// FIXME: The DOM breakpoints are not working unless there's a JS brakpoint set. Setting a fake breakpoint to workaround that.
// https://bugs.webkit.org/show_bug.cgi?id=123770
if (/node-removed\.html$/.test(messageObject.params.url) && messageObject.params.startLine > 20) {
- InspectorTest.eventHandler["Debugger.scriptParsed"] = null;
- InspectorTest.log("Found <script>");
+ InspectorProtocol.eventHandler["Debugger.scriptParsed"] = null;
+ ProtocolTest.log("Found <script>");
var location = {scriptId: messageObject.params.scriptId, lineNumber: messageObject.params.startLine + 2, columnNumber: 0};
- InspectorTest.sendCommand("Debugger.setBreakpoint", {location: location}, function() {
- InspectorTest.sendCommand("DOM.getDocument", {}, onGotDocument);
+ InspectorProtocol.sendCommand("Debugger.setBreakpoint", {location: location}, function() {
+ InspectorProtocol.sendCommand("DOM.getDocument", {}, onGotDocument);
});
}
}
function onGotDocument(response)
{
- InspectorTest.checkForError(response);
- InspectorTest.sendCommand("DOM.querySelectorAll", {"nodeId": response.result.root.nodeId, "selector": "#target_element,#final_container"}, onQuerySelectorAll);
+ InspectorProtocol.checkForError(response);
+ InspectorProtocol.sendCommand("DOM.querySelectorAll", {"nodeId": response.result.root.nodeId, "selector": "#target_element,#final_container"}, onQuerySelectorAll);
}
function onQuerySelectorAll(response)
@@ -115,13 +115,13 @@
var targetElementId = response.result.nodeIds[0];
var finalContainerId = response.result.nodeIds[1];
- InspectorTest.sendCommand("DOMDebugger.setDOMBreakpoint", {nodeId: targetElementId, type: "node-removed"});
- InspectorTest.sendCommand("DOM.requestChildNodes", {nodeId: finalContainerId});
+ InspectorProtocol.sendCommand("DOMDebugger.setDOMBreakpoint", {nodeId: targetElementId, type: "node-removed"});
+ InspectorProtocol.sendCommand("DOM.requestChildNodes", {nodeId: finalContainerId});
- InspectorTest.sendCommand("Runtime.evaluate", {"expression": "removeNode()"});
+ InspectorProtocol.sendCommand("Runtime.evaluate", {"expression": "removeNode()"});
}
- InspectorTest.sendCommand("Debugger.enable", {});
+ InspectorProtocol.sendCommand("Debugger.enable", {});
}
</script>
</head>
diff --git a/LayoutTests/inspector/dom/dom-remove-events.html b/LayoutTests/inspector/dom/dom-remove-events.html
index 995feb4..08c9b08 100644
--- a/LayoutTests/inspector/dom/dom-remove-events.html
+++ b/LayoutTests/inspector/dom/dom-remove-events.html
@@ -16,9 +16,9 @@
{
var nodesById = {};
- InspectorTest.eventHandler["DOM.setChildNodes"] = onSetChildNodes;
- InspectorTest.eventHandler["DOM.childNodeRemoved"] = onChildNodeRemoved;
- InspectorTest.eventHandler["DOM.childNodeInserted"] = onChildNodeInserted;
+ InspectorProtocol.eventHandler["DOM.setChildNodes"] = onSetChildNodes;
+ InspectorProtocol.eventHandler["DOM.childNodeRemoved"] = onChildNodeRemoved;
+ InspectorProtocol.eventHandler["DOM.childNodeInserted"] = onChildNodeInserted;
function createNodeAttributesMap(node)
{
@@ -47,31 +47,31 @@
function onChildNodeRemoved(response)
{
var nodeId = response.params.nodeId;
- InspectorTest.assert(getNodeIdentifier(nodeId) === "target_element", "onChildNodeRemoved called for #target_element");
+ ProtocolTest.assert(getNodeIdentifier(nodeId) === "target_element", "onChildNodeRemoved called for #target_element");
delete nodesById[nodeId];
}
function onChildNodeInserted(response)
{
collectNode(response.params.node);
- InspectorTest.assert(getNodeIdentifier(response.params.parentNodeId) === "final_container", "onChildNodeInserted called for parent node #final_container");
- InspectorTest.assert(getNodeIdentifier(response.params.node.nodeId) === "target_element", "onChildNodeInserted called for child node #target_element");
+ 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");
}
- InspectorTest.sendCommand("DOM.getDocument", {}, onGotDocument);
+ InspectorProtocol.sendCommand("DOM.getDocument", {}, onGotDocument);
function onGotDocument(msg)
{
- InspectorTest.checkForError(msg);
- InspectorTest.sendCommand("DOM.querySelector", {"nodeId": msg.result.root.nodeId, "selector": "#final_container"}, onQuerySelector);
+ InspectorProtocol.checkForError(msg);
+ InspectorProtocol.sendCommand("DOM.querySelector", {"nodeId": msg.result.root.nodeId, "selector": "#final_container"}, onQuerySelector);
}
function onQuerySelector(response)
{
// Make sure we receive the children of the "#final_container" as they are added.
- InspectorTest.sendCommand("DOM.requestChildNodes", {nodeId: response.result.nodeId});
- InspectorTest.sendCommand("Runtime.evaluate", {"expression": "moveNode()"}, function() {
- InspectorTest.completeTest();
+ InspectorProtocol.sendCommand("DOM.requestChildNodes", {nodeId: response.result.nodeId});
+ InspectorProtocol.sendCommand("Runtime.evaluate", {"expression": "moveNode()"}, function() {
+ ProtocolTest.completeTest();
});
}
}
diff --git a/LayoutTests/inspector/dom/dom-search-crash.html b/LayoutTests/inspector/dom/dom-search-crash.html
index fa010a4..efe2aa4 100644
--- a/LayoutTests/inspector/dom/dom-search-crash.html
+++ b/LayoutTests/inspector/dom/dom-search-crash.html
@@ -4,18 +4,18 @@
<script>
function test()
{
- InspectorTest.sendCommand("DOM.getDocument", {}, onGotDocument);
+ InspectorProtocol.sendCommand("DOM.getDocument", {}, onGotDocument);
function onGotDocument(message) {
- InspectorTest.checkForError(message);
- InspectorTest.sendCommand("DOM.performSearch", {query: "FooBar"}, onSearchCompleted);
+ InspectorProtocol.checkForError(message);
+ InspectorProtocol.sendCommand("DOM.performSearch", {query: "FooBar"}, onSearchCompleted);
}
function onSearchCompleted(message)
{
- InspectorTest.checkForError(message);
- InspectorTest.log("PASS: Test passes if it doesn't crash.");
- InspectorTest.completeTest();
+ InspectorProtocol.checkForError(message);
+ ProtocolTest.log("PASS: Test passes if it doesn't crash.");
+ ProtocolTest.completeTest();
}
}
</script>
diff --git a/LayoutTests/inspector/dom/dom-search-with-context.html b/LayoutTests/inspector/dom/dom-search-with-context.html
index f0c22bb..328c30f 100644
--- a/LayoutTests/inspector/dom/dom-search-with-context.html
+++ b/LayoutTests/inspector/dom/dom-search-with-context.html
@@ -5,7 +5,7 @@
function test()
{
// Create a DOM listener to convert nodeIds to tag names.
- InspectorTest.importScript("../dom/resources/InspectorDOMListener.js");
+ ProtocolTest.importScript("../dom/resources/InspectorDOMListener.js");
var dom = createDOMListener();
// Caching the output to avoid searching through the log.
@@ -44,10 +44,10 @@
}
];
- InspectorTest.sendCommand("DOM.getDocument", {}, onGotDocument);
+ InspectorProtocol.sendCommand("DOM.getDocument", {}, onGotDocument);
function onGotDocument(message) {
- InspectorTest.checkForError(message);
+ InspectorProtocol.checkForError(message);
dom.collectNode(message.result.root);
documentId = message.result.root.nodeId;
performSearches(domSearchQueries, testFinished);
@@ -68,8 +68,8 @@
{
resolveSelectors(queryData.nodes, function(nodeIds) {
output.push("=== Query: " + JSON.stringify(queryData.query) + " in [" + queryData.nodes.join(", ") + "] ===");
- InspectorTest.sendCommand("DOM.performSearch", {query: queryData.query, nodeIds: nodeIds}, function(message) {
- InspectorTest.checkForError(message);
+ InspectorProtocol.sendCommand("DOM.performSearch", {query: queryData.query, nodeIds: nodeIds}, function(message) {
+ InspectorProtocol.checkForError(message);
printSearchResults(message.result, callback);
});
});
@@ -82,8 +82,8 @@
if (!remaining)
return callback(results);
nodes.forEach(function(selector, index) {
- InspectorTest.sendCommand("DOM.querySelector", {nodeId: documentId, selector: selector}, function(message) {
- InspectorTest.checkForError(message);
+ InspectorProtocol.sendCommand("DOM.querySelector", {nodeId: documentId, selector: selector}, function(message) {
+ InspectorProtocol.checkForError(message);
results[index] = message.result.nodeId;
if (--remaining <= 0)
callback(results);
@@ -98,7 +98,7 @@
return callback();
var options = {"searchId": results.searchId, "fromIndex": 0, "toIndex": results.resultCount};
- InspectorTest.sendCommand("DOM.getSearchResults", options, function(message) {
+ InspectorProtocol.sendCommand("DOM.getSearchResults", options, function(message) {
for (var nodeId of message.result.nodeIds)
output.push(dom.getNodeIdentifier(nodeId));
callback();
@@ -107,8 +107,8 @@
function testFinished()
{
- InspectorTest.log(output.join("\n"));
- InspectorTest.completeTest();
+ ProtocolTest.log(output.join("\n"));
+ ProtocolTest.completeTest();
}
}
</script>
diff --git a/LayoutTests/inspector/dom/dom-search.html b/LayoutTests/inspector/dom/dom-search.html
index 423264b..63b4ab6 100644
--- a/LayoutTests/inspector/dom/dom-search.html
+++ b/LayoutTests/inspector/dom/dom-search.html
@@ -5,19 +5,19 @@
function test()
{
// Loading the queries from external file to avoid having them show up in the results.
- InspectorTest.importScript("../../../../inspector/dom/resources/dom-search-queries.js");
+ ProtocolTest.importScript("../../../../inspector/dom/resources/dom-search-queries.js");
// Create a DOM listener to convert nodeIds to tag names.
- InspectorTest.importScript("../dom/resources/InspectorDOMListener.js");
+ ProtocolTest.importScript("../dom/resources/InspectorDOMListener.js");
var dom = createDOMListener();
// Caching the output to avoid searching through the log.
var output = [];
- InspectorTest.sendCommand("DOM.getDocument", {}, onGotDocument);
+ InspectorProtocol.sendCommand("DOM.getDocument", {}, onGotDocument);
function onGotDocument(message) {
- InspectorTest.checkForError(message);
+ InspectorProtocol.checkForError(message);
dom.collectNode(message.result.root);
performSearches(domSearchQueries, testFinished);
}
@@ -36,8 +36,8 @@
function search(query, callback)
{
output.push("=== Query: " + JSON.stringify(query) + " ===");
- InspectorTest.sendCommand("DOM.performSearch", {query: query}, function(message) {
- InspectorTest.checkForError(message);
+ InspectorProtocol.sendCommand("DOM.performSearch", {query: query}, function(message) {
+ InspectorProtocol.checkForError(message);
printSearchResults(message.result, callback);
});
}
@@ -49,7 +49,7 @@
return callback();
var options = {"searchId": results.searchId, "fromIndex": 0, "toIndex": results.resultCount};
- InspectorTest.sendCommand("DOM.getSearchResults", options, function onResultsReceived(message) {
+ InspectorProtocol.sendCommand("DOM.getSearchResults", options, function onResultsReceived(message) {
for (var nodeId of message.result.nodeIds)
output.push(dom.getNodeIdentifier(nodeId));
callback();
@@ -58,8 +58,8 @@
function testFinished()
{
- InspectorTest.log(output.join("\n"));
- InspectorTest.completeTest();
+ ProtocolTest.log(output.join("\n"));
+ ProtocolTest.completeTest();
}
}
</script>
diff --git a/LayoutTests/inspector/dom/focus.html b/LayoutTests/inspector/dom/focus.html
index dd77e51..21fe199 100644
--- a/LayoutTests/inspector/dom/focus.html
+++ b/LayoutTests/inspector/dom/focus.html
@@ -10,32 +10,32 @@
function test()
{
- InspectorTest.sendCommand("DOM.getDocument", {}, onGotDocument);
+ InspectorProtocol.sendCommand("DOM.getDocument", {}, onGotDocument);
function onGotDocument(msg) {
if (msg.error) {
- InspectorTest.log(msg.error.message);
- InspectorTest.completeTest();
+ ProtocolTest.log(msg.error.message);
+ ProtocolTest.completeTest();
return;
}
var node = msg.result.root;
- InspectorTest.sendCommand("DOM.querySelector", { "nodeId": node.nodeId, "selector": "#second" }, onQuerySelector);
+ InspectorProtocol.sendCommand("DOM.querySelector", { "nodeId": node.nodeId, "selector": "#second" }, onQuerySelector);
}
function onQuerySelector(msg) {
if (msg.error) {
- InspectorTest.log(msg.error.message);
- InspectorTest.completeTest();
+ ProtocolTest.log(msg.error.message);
+ ProtocolTest.completeTest();
return;
}
var node = msg.result;
- InspectorTest.sendCommand("DOM.focus", { "nodeId": node.nodeId }, onFocus);
+ InspectorProtocol.sendCommand("DOM.focus", { "nodeId": node.nodeId }, onFocus);
}
function onFocus(msg) {
if (msg.error)
- InspectorTest.log(msg.error);
- InspectorTest.completeTest();
+ ProtocolTest.log(msg.error);
+ ProtocolTest.completeTest();
}
}
</script>
diff --git a/LayoutTests/inspector/dom/getAccessibilityPropertiesForNode.html b/LayoutTests/inspector/dom/getAccessibilityPropertiesForNode.html
index 023b78c..2ec615a 100644
--- a/LayoutTests/inspector/dom/getAccessibilityPropertiesForNode.html
+++ b/LayoutTests/inspector/dom/getAccessibilityPropertiesForNode.html
@@ -139,45 +139,45 @@
var documentNodeId = null;
function onGotDocument(response) {
- InspectorTest.checkForError(response);
+ InspectorProtocol.checkForError(response);
documentNodeId = response.result.root.nodeId;
- InspectorTest.sendCommand("DOM.getAccessibilityPropertiesForNode", {"nodeId": documentNodeId}, onGotAccessibilityPropertiesForDocumentNode);
+ InspectorProtocol.sendCommand("DOM.getAccessibilityPropertiesForNode", {"nodeId": documentNodeId}, onGotAccessibilityPropertiesForDocumentNode);
}
function onGotAccessibilityPropertiesForDocumentNode(response) {
- InspectorTest.checkForError(response);
- InspectorTest.log("#document");
+ InspectorProtocol.checkForError(response);
+ ProtocolTest.log("#document");
logAccessibilityProperties(response.result.properties);
- InspectorTest.log("\n");
- InspectorTest.sendCommand("DOM.querySelectorAll", {"nodeId": documentNodeId, "selector": ".ex"}, onGotQuerySelectorAll);
+ ProtocolTest.log("\n");
+ InspectorProtocol.sendCommand("DOM.querySelectorAll", {"nodeId": documentNodeId, "selector": ".ex"}, onGotQuerySelectorAll);
}
function onGotQuerySelectorAll(response) {
- InspectorTest.checkForError(response);
+ InspectorProtocol.checkForError(response);
examples = response.result.nodeIds;
- InspectorTest.log("Total elements to be tested: " + examples.length + ".");
+ ProtocolTest.log("Total elements to be tested: " + examples.length + ".");
loop();
}
function loop() {
if (examples.length) {
- InspectorTest.sendCommand("DOM.getOuterHTML", {"nodeId": examples[examples.length-1]}, onGotOuterHTML);
+ InspectorProtocol.sendCommand("DOM.getOuterHTML", {"nodeId": examples[examples.length-1]}, onGotOuterHTML);
} else {
finishTest();
}
}
function onGotOuterHTML(response) {
- InspectorTest.checkForError(response);
+ InspectorProtocol.checkForError(response);
var outerHTML = response.result.outerHTML;
outerHTML = outerHTML.replace(/ class="ex"/g, ""); // remove any duplicated, unnecessary class attributes
outerHTML = outerHTML.replace(/;base64,.*?"/, "...\""); // suppress full data URIs in output
- InspectorTest.log("\n" + outerHTML);
- InspectorTest.sendCommand("DOM.getAccessibilityPropertiesForNode", {"nodeId": examples[examples.length-1]}, onGotAccessibilityProperties);
+ ProtocolTest.log("\n" + outerHTML);
+ InspectorProtocol.sendCommand("DOM.getAccessibilityPropertiesForNode", {"nodeId": examples[examples.length-1]}, onGotAccessibilityProperties);
}
function onGotAccessibilityProperties(response) {
- InspectorTest.checkForError(response);
+ InspectorProtocol.checkForError(response);
logAccessibilityProperties(response.result.properties);
examples.pop();
loop();
@@ -193,7 +193,7 @@
case "mouseEventNodeId":
case "parentNodeId":
if (typeof value === "number")
- InspectorTest.log(" " + key + ": exists");
+ ProtocolTest.log(" " + key + ": exists");
break;
case "childNodeIds":
case "controlledNodeIds":
@@ -201,23 +201,23 @@
case "ownedNodeIds":
case "selectedChildNodeIds":
if (typeof value === "object" && value.length)
- InspectorTest.log(" " + key + ".length: " + value.length);
+ ProtocolTest.log(" " + key + ".length: " + value.length);
break;
default:
- InspectorTest.log(" " + key + ": " + value);
+ ProtocolTest.log(" " + key + ": " + value);
}
}
}
function finishTest() {
- InspectorTest.sendCommand("Runtime.evaluate", {"expression": "cleanup()"}, function(){
- InspectorTest.completeTest();
+ InspectorProtocol.sendCommand("Runtime.evaluate", {"expression": "cleanup()"}, function(){
+ ProtocolTest.completeTest();
});
}
- InspectorTest.sendCommand("DOM.getDocument", {}, onGotDocument);
+ InspectorProtocol.sendCommand("DOM.getDocument", {}, onGotDocument);
}
</script>
diff --git a/LayoutTests/inspector/dom/getAccessibilityPropertiesForNode_liveRegion.html b/LayoutTests/inspector/dom/getAccessibilityPropertiesForNode_liveRegion.html
index 5c1a260..bb1491f 100644
--- a/LayoutTests/inspector/dom/getAccessibilityPropertiesForNode_liveRegion.html
+++ b/LayoutTests/inspector/dom/getAccessibilityPropertiesForNode_liveRegion.html
@@ -62,36 +62,36 @@
var bodyNodeId = null;
function onGotDocument(response) {
- InspectorTest.checkForError(response);
+ InspectorProtocol.checkForError(response);
documentNodeId = response.result.root.nodeId;
- InspectorTest.sendCommand("DOM.querySelectorAll", {"nodeId": documentNodeId, "selector": ".ex"}, onGotQuerySelectorAll);
+ InspectorProtocol.sendCommand("DOM.querySelectorAll", {"nodeId": documentNodeId, "selector": ".ex"}, onGotQuerySelectorAll);
}
function onGotQuerySelectorAll(response) {
- InspectorTest.checkForError(response);
+ InspectorProtocol.checkForError(response);
examples = response.result.nodeIds;
- InspectorTest.log("Total elements to be tested: " + examples.length + ".");
+ ProtocolTest.log("Total elements to be tested: " + examples.length + ".");
loop();
}
function loop() {
if (examples.length) {
- InspectorTest.sendCommand("DOM.getOuterHTML", {"nodeId": examples[examples.length-1]}, onGotOuterHTML);
+ InspectorProtocol.sendCommand("DOM.getOuterHTML", {"nodeId": examples[examples.length-1]}, onGotOuterHTML);
} else {
finishTest();
}
}
function onGotOuterHTML(response) {
- InspectorTest.checkForError(response);
+ InspectorProtocol.checkForError(response);
var outerHTML = response.result.outerHTML;
outerHTML = outerHTML.replace(/ class="ex"/g, ""); // remove any duplicated, unnecessary class attributes
- InspectorTest.log("\n" + outerHTML);
- InspectorTest.sendCommand("DOM.getAccessibilityPropertiesForNode", {"nodeId": examples[examples.length-1]}, onGotAccessibilityProperties);
+ ProtocolTest.log("\n" + outerHTML);
+ InspectorProtocol.sendCommand("DOM.getAccessibilityPropertiesForNode", {"nodeId": examples[examples.length-1]}, onGotAccessibilityProperties);
}
function onGotAccessibilityProperties(response) {
- InspectorTest.checkForError(response);
+ InspectorProtocol.checkForError(response);
logAccessibilityProperties(response.result.properties);
examples.pop();
loop();
@@ -106,7 +106,7 @@
case "liveRegionAtomic":
case "liveRegionRelevant":
case "liveRegionStatus":
- InspectorTest.log(" " + key + ": " + value);
+ ProtocolTest.log(" " + key + ": " + value);
break;
default:
continue;
@@ -115,12 +115,12 @@
}
function finishTest() {
- InspectorTest.sendCommand("Runtime.evaluate", {"expression": "cleanup()"}, function(){
- InspectorTest.completeTest();
+ InspectorProtocol.sendCommand("Runtime.evaluate", {"expression": "cleanup()"}, function(){
+ ProtocolTest.completeTest();
});
}
- InspectorTest.sendCommand("DOM.getDocument", {}, onGotDocument);
+ InspectorProtocol.sendCommand("DOM.getDocument", {}, onGotDocument);
}
</script>
diff --git a/LayoutTests/inspector/dom/getAccessibilityPropertiesForNode_mouseEventNodeId.html b/LayoutTests/inspector/dom/getAccessibilityPropertiesForNode_mouseEventNodeId.html
index dbb5ab8..ce6f210 100644
--- a/LayoutTests/inspector/dom/getAccessibilityPropertiesForNode_mouseEventNodeId.html
+++ b/LayoutTests/inspector/dom/getAccessibilityPropertiesForNode_mouseEventNodeId.html
@@ -76,47 +76,47 @@
var bodyNodeId = null;
function onGotDocument(response) {
- InspectorTest.checkForError(response);
+ InspectorProtocol.checkForError(response);
documentNodeId = response.result.root.nodeId;
- InspectorTest.sendCommand("DOM.querySelector", {"nodeId": documentNodeId, "selector": "body"}, onGotBody);
+ InspectorProtocol.sendCommand("DOM.querySelector", {"nodeId": documentNodeId, "selector": "body"}, onGotBody);
}
function onGotBody(response) {
- InspectorTest.checkForError(response);
+ InspectorProtocol.checkForError(response);
bodyNodeId = response.result.nodeId;
- InspectorTest.sendCommand("DOM.getAccessibilityPropertiesForNode", {"nodeId": bodyNodeId}, onGotAccessibilityPropertiesForBodyNode);
+ InspectorProtocol.sendCommand("DOM.getAccessibilityPropertiesForNode", {"nodeId": bodyNodeId}, onGotAccessibilityPropertiesForBodyNode);
}
function onGotAccessibilityPropertiesForBodyNode(response) {
- InspectorTest.checkForError(response);
- InspectorTest.sendCommand("DOM.querySelectorAll", {"nodeId": documentNodeId, "selector": ".ex"}, onGotQuerySelectorAll);
+ InspectorProtocol.checkForError(response);
+ InspectorProtocol.sendCommand("DOM.querySelectorAll", {"nodeId": documentNodeId, "selector": ".ex"}, onGotQuerySelectorAll);
}
function onGotQuerySelectorAll(response) {
- InspectorTest.checkForError(response);
+ InspectorProtocol.checkForError(response);
examples = response.result.nodeIds;
- InspectorTest.log("Total elements to be tested: " + examples.length + ".");
+ ProtocolTest.log("Total elements to be tested: " + examples.length + ".");
loop();
}
function loop() {
if (examples.length) {
- InspectorTest.sendCommand("DOM.getOuterHTML", {"nodeId": examples[examples.length-1]}, onGotOuterHTML);
+ InspectorProtocol.sendCommand("DOM.getOuterHTML", {"nodeId": examples[examples.length-1]}, onGotOuterHTML);
} else {
finishTest();
}
}
function onGotOuterHTML(response) {
- InspectorTest.checkForError(response);
+ InspectorProtocol.checkForError(response);
var outerHTML = response.result.outerHTML;
outerHTML = outerHTML.replace(/ class="ex"/g, ""); // remove any duplicated, unnecessary class attributes
- InspectorTest.log("\n" + outerHTML);
- InspectorTest.sendCommand("DOM.getAccessibilityPropertiesForNode", {"nodeId": examples[examples.length-1]}, onGotAccessibilityProperties);
+ ProtocolTest.log("\n" + outerHTML);
+ InspectorProtocol.sendCommand("DOM.getAccessibilityPropertiesForNode", {"nodeId": examples[examples.length-1]}, onGotAccessibilityProperties);
}
function onGotAccessibilityProperties(response) {
- InspectorTest.checkForError(response);
+ InspectorProtocol.checkForError(response);
logAccessibilityProperties(response.result.properties);
examples.pop();
loop();
@@ -132,16 +132,16 @@
msg += "self";
else
msg += "ancestor element";
- InspectorTest.log(msg);
+ ProtocolTest.log(msg);
}
function finishTest() {
- InspectorTest.sendCommand("Runtime.evaluate", {"expression": "cleanup()"}, function(){
- InspectorTest.completeTest();
+ InspectorProtocol.sendCommand("Runtime.evaluate", {"expression": "cleanup()"}, function(){
+ ProtocolTest.completeTest();
});
}
- InspectorTest.sendCommand("DOM.getDocument", {}, onGotDocument);
+ InspectorProtocol.sendCommand("DOM.getDocument", {}, onGotDocument);
}
</script>
diff --git a/LayoutTests/inspector/dom/highlight-flow-with-no-region.html b/LayoutTests/inspector/dom/highlight-flow-with-no-region.html
index b308f43..09c346d 100644
--- a/LayoutTests/inspector/dom/highlight-flow-with-no-region.html
+++ b/LayoutTests/inspector/dom/highlight-flow-with-no-region.html
@@ -9,16 +9,16 @@
<script>
function test()
{
- InspectorTest.sendCommand("DOM.getDocument", {}, onGotDocument);
+ InspectorProtocol.sendCommand("DOM.getDocument", {}, onGotDocument);
function onGotDocument(msg) {
- InspectorTest.checkForError(msg);
+ InspectorProtocol.checkForError(msg);
var node = msg.result.root;
- InspectorTest.sendCommand("DOM.querySelector", { "nodeId": node.nodeId, "selector": "#inspectedElement" }, onQuerySelector);
+ InspectorProtocol.sendCommand("DOM.querySelector", { "nodeId": node.nodeId, "selector": "#inspectedElement" }, onQuerySelector);
}
function onQuerySelector(msg) {
- InspectorTest.checkForError(msg);
+ InspectorProtocol.checkForError(msg);
var node = msg.result;
var highlightConfig = {
showInfo: true,
@@ -27,12 +27,12 @@
borderColor: {r: 255, g: 255, b: 255},
marginColor: {r: 255, g: 255, b: 255},
};
- InspectorTest.sendCommand("DOM.highlightNode", { "highlightConfig": highlightConfig, "nodeId": node.nodeId }, onHighlightComplete);
+ InspectorProtocol.sendCommand("DOM.highlightNode", { "highlightConfig": highlightConfig, "nodeId": node.nodeId }, onHighlightComplete);
}
function onHighlightComplete(msg) {
- InspectorTest.checkForError(msg);
- InspectorTest.completeTest();
+ InspectorProtocol.checkForError(msg);
+ ProtocolTest.completeTest();
}
}
</script>
diff --git a/LayoutTests/inspector/dom/remove-multiple-nodes.html b/LayoutTests/inspector/dom/remove-multiple-nodes.html
index 138ffcc..511ad48 100644
--- a/LayoutTests/inspector/dom/remove-multiple-nodes.html
+++ b/LayoutTests/inspector/dom/remove-multiple-nodes.html
@@ -18,9 +18,9 @@
{
var nodesById = {};
- InspectorTest.eventHandler["DOM.setChildNodes"] = onSetChildNodes;
- InspectorTest.eventHandler["DOM.childNodeRemoved"] = onChildNodeRemoved;
- InspectorTest.eventHandler["DOM.childNodeInserted"] = onChildNodeInserted;
+ InspectorProtocol.eventHandler["DOM.setChildNodes"] = onSetChildNodes;
+ InspectorProtocol.eventHandler["DOM.childNodeRemoved"] = onChildNodeRemoved;
+ InspectorProtocol.eventHandler["DOM.childNodeInserted"] = onChildNodeInserted;
function createNodeAttributesMap(attributes)
{
@@ -67,32 +67,32 @@
function onChildNodeRemoved(response)
{
var nodeId = response.params.nodeId;
- InspectorTest.log("Removing node " + getNodeIdentifier(nodeId));
+ ProtocolTest.log("Removing node " + getNodeIdentifier(nodeId));
delete nodesById[nodeId];
}
function onChildNodeInserted(response)
{
collectNode(response.params.node);
- InspectorTest.log("Inserting node " + getNodeIdentifier(response.params.node.nodeId) + " into " + getNodeIdentifier(response.params.parentNodeId));
+ ProtocolTest.log("Inserting node " + getNodeIdentifier(response.params.node.nodeId) + " into " + getNodeIdentifier(response.params.parentNodeId));
}
- InspectorTest.sendCommand("DOM.getDocument", {}, onGotDocument);
+ InspectorProtocol.sendCommand("DOM.getDocument", {}, onGotDocument);
function onGotDocument(msg)
{
- InspectorTest.checkForError(msg);
- InspectorTest.sendCommand("DOM.querySelectorAll", {"nodeId": msg.result.root.nodeId, "selector": "#parent_container,#final_container"}, onQuerySelectorAll);
+ InspectorProtocol.checkForError(msg);
+ InspectorProtocol.sendCommand("DOM.querySelectorAll", {"nodeId": msg.result.root.nodeId, "selector": "#parent_container,#final_container"}, onQuerySelectorAll);
}
function onQuerySelectorAll(response)
{
// Make sure we receive the children of the "#final_container" as they are added.
for (var i = 0; i < response.result.nodeIds.length; ++i)
- InspectorTest.sendCommand("DOM.requestChildNodes", {nodeId: response.result.nodeIds[i]});
+ InspectorProtocol.sendCommand("DOM.requestChildNodes", {nodeId: response.result.nodeIds[i]});
- InspectorTest.sendCommand("Runtime.evaluate", {"expression": "moveNode()"}, function() {
- InspectorTest.completeTest();
+ InspectorProtocol.sendCommand("Runtime.evaluate", {"expression": "moveNode()"}, function() {
+ ProtocolTest.completeTest();
});
}
}
diff --git a/LayoutTests/inspector/dom/request-child-nodes-depth.html b/LayoutTests/inspector/dom/request-child-nodes-depth.html
index eef9d99..4d3dfdf 100644
--- a/LayoutTests/inspector/dom/request-child-nodes-depth.html
+++ b/LayoutTests/inspector/dom/request-child-nodes-depth.html
@@ -9,7 +9,7 @@
getDocument();
- InspectorTest.eventHandler["DOM.setChildNodes"] = function setChildNodes(messageObject)
+ InspectorProtocol.eventHandler["DOM.setChildNodes"] = function setChildNodes(messageObject)
{
eventsCount++;
@@ -20,7 +20,7 @@
else if (eventsCount === 3)
gotAllChildren(messageObject);
else
- InspectorTest.log(JSON.stringify(messageObject, null, " "));
+ ProtocolTest.log(JSON.stringify(messageObject, null, " "));
};
function getDocument()
@@ -104,15 +104,15 @@
{
assert("Expected number of setChildNodes events", eventsCount, 3);
- InspectorTest.completeTest();
+ ProtocolTest.completeTest();
};
function step(test)
{
- InspectorTest.log("\n=== " + test.name + " ===\n");
- InspectorTest.sendCommand(test.command, test.parameters, function(messageObject) {
+ ProtocolTest.log("\n=== " + test.name + " ===\n");
+ InspectorProtocol.sendCommand(test.command, test.parameters, function(messageObject) {
if (messageObject.hasOwnProperty("error"))
- InspectorTest.log("Backend error: " + messageObject.error.message + " (" + messageObject.error.code + ")\n");
+ ProtocolTest.log("Backend error: " + messageObject.error.message + " (" + messageObject.error.code + ")\n");
if (test.callback)
test.callback(messageObject.result);
@@ -122,10 +122,10 @@
function assert(message, actual, expected)
{
if (actual === expected)
- InspectorTest.log("PASS: " + message);
+ ProtocolTest.log("PASS: " + message);
else {
- InspectorTest.log("FAIL: " + message + ", expected \"" + expected + "\" but got \"" + actual + "\"");
- InspectorTest.completeTest();
+ ProtocolTest.log("FAIL: " + message + ", expected \"" + expected + "\" but got \"" + actual + "\"");
+ ProtocolTest.completeTest();
}
};
};
diff --git a/LayoutTests/inspector/layers/layers-anonymous.html b/LayoutTests/inspector/layers/layers-anonymous.html
index dc08b42..004227d 100644
--- a/LayoutTests/inspector/layers/layers-anonymous.html
+++ b/LayoutTests/inspector/layers/layers-anonymous.html
@@ -8,7 +8,7 @@
var nodes;
- InspectorTest.eventHandler["DOM.setChildNodes"] = setChildNodes;
+ InspectorProtocol.eventHandler["DOM.setChildNodes"] = setChildNodes;
enableLayerTreeAgent();
@@ -71,7 +71,7 @@
assert("Node has id", node.attributes[0], "id");
assert("Node has expected id", node.attributes[1], "first-letter");
- InspectorTest.completeTest();
+ ProtocolTest.completeTest();
};
function setChildNodes (messageObject) {
@@ -87,20 +87,20 @@
function logTestName(name)
{
- InspectorTest.log("\n=== " + name + " ===\n");
+ ProtocolTest.log("\n=== " + name + " ===\n");
};
function runCommand(command)
{
- InspectorTest.sendCommand(command.command, command.parameters, function(messageObject) {
+ InspectorProtocol.sendCommand(command.command, command.parameters, function(messageObject) {
if (messageObject.hasOwnProperty("error")) {
- InspectorTest.log("FAIL: " + messageObject.error.message + " (" + messageObject.error.code + ")");
- InspectorTest.completeTest();
+ ProtocolTest.log("FAIL: " + messageObject.error.message + " (" + messageObject.error.code + ")");
+ ProtocolTest.completeTest();
return;
}
if (command.name)
- InspectorTest.log("PASS");
+ ProtocolTest.log("PASS");
if (command.callback)
command.callback(messageObject.result);
@@ -110,9 +110,9 @@
function assert(name, actual, expected)
{
if (expected === actual)
- InspectorTest.log("PASS: " + name + ".");
+ ProtocolTest.log("PASS: " + name + ".");
else
- InspectorTest.log("FAIL: " + name + ". Expected " + expected + " but got " + actual);
+ ProtocolTest.log("FAIL: " + name + ". Expected " + expected + " but got " + actual);
};
};
diff --git a/LayoutTests/inspector/layers/layers-blending-compositing-reasons.html b/LayoutTests/inspector/layers/layers-blending-compositing-reasons.html
index 0940b92..fc887b7 100644
--- a/LayoutTests/inspector/layers/layers-blending-compositing-reasons.html
+++ b/LayoutTests/inspector/layers/layers-blending-compositing-reasons.html
@@ -8,7 +8,7 @@
var nodes = [];
- InspectorTest.eventHandler["DOM.setChildNodes"] = setChildNodes;
+ InspectorProtocol.eventHandler["DOM.setChildNodes"] = setChildNodes;
enableLayerTreeAgent();
@@ -76,7 +76,7 @@
}
if (++count === layers.length)
- InspectorTest.completeTest();
+ ProtocolTest.completeTest();
};
layers.forEach(function (layer) {
@@ -105,16 +105,16 @@
function logTestName(name)
{
- InspectorTest.log("\n=== " + name + " ===\n");
+ ProtocolTest.log("\n=== " + name + " ===\n");
};
function runCommand(command)
{
- InspectorTest.sendCommand(command.command, command.parameters, function(messageObject) {
- InspectorTest.checkForError(messageObject);
+ InspectorProtocol.sendCommand(command.command, command.parameters, function(messageObject) {
+ InspectorProtocol.checkForError(messageObject);
if (command.name)
- InspectorTest.log("PASS");
+ ProtocolTest.log("PASS");
if (command.callback)
command.callback(messageObject.result);
@@ -124,9 +124,9 @@
function assert(name, actual, expected)
{
if (expected === actual)
- InspectorTest.log("PASS: " + name + ".");
+ ProtocolTest.log("PASS: " + name + ".");
else
- InspectorTest.log("FAIL: " + name + ". Expected " + expected + " but got " + actual);
+ ProtocolTest.log("FAIL: " + name + ". Expected " + expected + " but got " + actual);
};
};
diff --git a/LayoutTests/inspector/layers/layers-compositing-reasons.html b/LayoutTests/inspector/layers/layers-compositing-reasons.html
index 1e38032..5bd9351 100644
--- a/LayoutTests/inspector/layers/layers-compositing-reasons.html
+++ b/LayoutTests/inspector/layers/layers-compositing-reasons.html
@@ -8,7 +8,7 @@
var nodes = [];
- InspectorTest.eventHandler["DOM.setChildNodes"] = setChildNodes;
+ InspectorProtocol.eventHandler["DOM.setChildNodes"] = setChildNodes;
enableLayerTreeAgent();
@@ -76,7 +76,7 @@
}
if (++count === layers.length)
- InspectorTest.completeTest();
+ ProtocolTest.completeTest();
};
layers.forEach(function (layer) {
@@ -105,20 +105,20 @@
function logTestName(name)
{
- InspectorTest.log("\n=== " + name + " ===\n");
+ ProtocolTest.log("\n=== " + name + " ===\n");
};
function runCommand(command)
{
- InspectorTest.sendCommand(command.command, command.parameters, function(messageObject) {
+ InspectorProtocol.sendCommand(command.command, command.parameters, function(messageObject) {
if (messageObject.hasOwnProperty("error")) {
- InspectorTest.log("FAIL: " + messageObject.error.message + " (" + messageObject.error.code + ")");
- InspectorTest.completeTest();
+ ProtocolTest.log("FAIL: " + messageObject.error.message + " (" + messageObject.error.code + ")");
+ ProtocolTest.completeTest();
return;
}
if (command.name)
- InspectorTest.log("PASS");
+ ProtocolTest.log("PASS");
if (command.callback)
command.callback(messageObject.result);
@@ -128,9 +128,9 @@
function assert(name, actual, expected)
{
if (expected === actual)
- InspectorTest.log("PASS: " + name + ".");
+ ProtocolTest.log("PASS: " + name + ".");
else
- InspectorTest.log("FAIL: " + name + ". Expected " + expected + " but got " + actual);
+ ProtocolTest.log("FAIL: " + name + ". Expected " + expected + " but got " + actual);
};
};
diff --git a/LayoutTests/inspector/layers/layers-for-node.html b/LayoutTests/inspector/layers/layers-for-node.html
index cfd655d..d5fed01 100644
--- a/LayoutTests/inspector/layers/layers-for-node.html
+++ b/LayoutTests/inspector/layers/layers-for-node.html
@@ -17,7 +17,7 @@
var initialLayers;
var eventsCount = 0;
- InspectorTest.eventHandler["LayerTree.layerTreeDidChange"] = function (messageObject) {
+ InspectorProtocol.eventHandler["LayerTree.layerTreeDidChange"] = function (messageObject) {
eventsCount++;
};
@@ -99,7 +99,7 @@
{
var attributes = attributesDictionaryFromArray(result.attributes);
if (attributes.id !== "last-element")
- InspectorTest.log("FAIL: Did not obtain the expected element for the last inserted layer.");
+ ProtocolTest.log("FAIL: Did not obtain the expected element for the last inserted layer.");
finishTest();
};
@@ -107,11 +107,11 @@
function finishTest()
{
if (!eventsCount)
- InspectorTest.log("FAIL: Did not receive layerTreeDidChange events.");
+ ProtocolTest.log("FAIL: Did not receive layerTreeDidChange events.");
else
- InspectorTest.log("\n=== Test complete, all expected conditions met ===");
+ ProtocolTest.log("\n=== Test complete, all expected conditions met ===");
- InspectorTest.completeTest();
+ ProtocolTest.completeTest();
};
function layerMutations(oldLayers, newLayers)
@@ -157,20 +157,20 @@
return value;
};
- InspectorTest.log("\n" + JSON.stringify(layers, replacer, " "));
+ ProtocolTest.log("\n" + JSON.stringify(layers, replacer, " "));
};
function step(test)
{
- InspectorTest.log("\n=== " + test.name + " ===\n")
- InspectorTest.sendCommand(test.command, test.parameters, function(messageObject) {
+ ProtocolTest.log("\n=== " + test.name + " ===\n")
+ InspectorProtocol.sendCommand(test.command, test.parameters, function(messageObject) {
if (messageObject.hasOwnProperty("error")) {
- InspectorTest.log("FAIL: " + messageObject.error.message + " (" + messageObject.error.code + ")");
- InspectorTest.completeTest();
+ ProtocolTest.log("FAIL: " + messageObject.error.message + " (" + messageObject.error.code + ")");
+ ProtocolTest.completeTest();
return;
}
- InspectorTest.log("PASS");
+ ProtocolTest.log("PASS");
test.callback(messageObject.result);
});
};
@@ -178,9 +178,9 @@
function assert(name, actual, expected)
{
if (expected === actual)
- InspectorTest.log("PASS: " + name + ".");
+ ProtocolTest.log("PASS: " + name + ".");
else
- InspectorTest.log("FAIL: " + name + ". Expected " + expected + " but got " + actual);
+ ProtocolTest.log("FAIL: " + name + ". Expected " + expected + " but got " + actual);
};
};
diff --git a/LayoutTests/inspector/layers/layers-generated-content.html b/LayoutTests/inspector/layers/layers-generated-content.html
index 4709ce3..ee9da7d 100644
--- a/LayoutTests/inspector/layers/layers-generated-content.html
+++ b/LayoutTests/inspector/layers/layers-generated-content.html
@@ -8,7 +8,7 @@
var nodes;
- InspectorTest.eventHandler["DOM.setChildNodes"] = setChildNodes;
+ InspectorProtocol.eventHandler["DOM.setChildNodes"] = setChildNodes;
enableLayerTreeAgent();
@@ -88,7 +88,7 @@
assert("Generating node has id", node.attributes[0], "id");
assert("Generating node has expected id", node.attributes[1], "generator");
- InspectorTest.completeTest();
+ ProtocolTest.completeTest();
};
function setChildNodes (messageObject) {
@@ -104,20 +104,20 @@
function logTestName(name)
{
- InspectorTest.log("\n=== " + name + " ===\n");
+ ProtocolTest.log("\n=== " + name + " ===\n");
};
function runCommand(command)
{
- InspectorTest.sendCommand(command.command, command.parameters, function(messageObject) {
+ InspectorProtocol.sendCommand(command.command, command.parameters, function(messageObject) {
if (messageObject.hasOwnProperty("error")) {
- InspectorTest.log("FAIL: " + messageObject.error.message + " (" + messageObject.error.code + ")");
- InspectorTest.completeTest();
+ ProtocolTest.log("FAIL: " + messageObject.error.message + " (" + messageObject.error.code + ")");
+ ProtocolTest.completeTest();
return;
}
if (command.name)
- InspectorTest.log("PASS");
+ ProtocolTest.log("PASS");
if (command.callback)
command.callback(messageObject.result);
@@ -127,9 +127,9 @@
function assert(name, actual, expected)
{
if (expected === actual)
- InspectorTest.log("PASS: " + name + ".");
+ ProtocolTest.log("PASS: " + name + ".");
else
- InspectorTest.log("FAIL: " + name + ". Expected " + expected + " but got " + actual);
+ ProtocolTest.log("FAIL: " + name + ". Expected " + expected + " but got " + actual);
};
};
diff --git a/LayoutTests/inspector/layers/layers-reflected-content.html b/LayoutTests/inspector/layers/layers-reflected-content.html
index 0322058..b2fc90f 100644
--- a/LayoutTests/inspector/layers/layers-reflected-content.html
+++ b/LayoutTests/inspector/layers/layers-reflected-content.html
@@ -8,7 +8,7 @@
var nodes;
- InspectorTest.eventHandler["DOM.setChildNodes"] = setChildNodes;
+ InspectorProtocol.eventHandler["DOM.setChildNodes"] = setChildNodes;
enableLayerTreeAgent();
@@ -72,7 +72,7 @@
assert("Node has CSS class", node.attributes[0], "class");
assert("Node has expected CSS class", node.attributes[1], "reflected composited");
- InspectorTest.completeTest();
+ ProtocolTest.completeTest();
};
function setChildNodes (messageObject) {
@@ -88,20 +88,20 @@
function logTestName(name)
{
- InspectorTest.log("\n=== " + name + " ===\n");
+ ProtocolTest.log("\n=== " + name + " ===\n");
};
function runCommand(command)
{
- InspectorTest.sendCommand(command.command, command.parameters, function(messageObject) {
+ InspectorProtocol.sendCommand(command.command, command.parameters, function(messageObject) {
if (messageObject.hasOwnProperty("error")) {
- InspectorTest.log("FAIL: " + messageObject.error.message + " (" + messageObject.error.code + ")");
- InspectorTest.completeTest();
+ ProtocolTest.log("FAIL: " + messageObject.error.message + " (" + messageObject.error.code + ")");
+ ProtocolTest.completeTest();
return;
}
if (command.name)
- InspectorTest.log("PASS");
+ ProtocolTest.log("PASS");
if (command.callback)
command.callback(messageObject.result);
@@ -111,9 +111,9 @@
function assert(name, actual, expected)
{
if (expected === actual)
- InspectorTest.log("PASS: " + name + ".");
+ ProtocolTest.log("PASS: " + name + ".");
else
- InspectorTest.log("FAIL: " + name + ". Expected " + expected + " but got " + actual);
+ ProtocolTest.log("FAIL: " + name + ". Expected " + expected + " but got " + actual);
};
};
diff --git a/LayoutTests/inspector/page/archive.html b/LayoutTests/inspector/page/archive.html
index 8aedf3d..2bcb2a4 100644
--- a/LayoutTests/inspector/page/archive.html
+++ b/LayoutTests/inspector/page/archive.html
@@ -4,17 +4,17 @@
<script>
function test()
{
- InspectorTest.sendCommand("Page.enable", {});
- InspectorTest.sendCommand("Page.archive", {}, function(event) {
+ InspectorProtocol.sendCommand("Page.enable", {});
+ InspectorProtocol.sendCommand("Page.archive", {}, function(event) {
var data = event.result.data;
if (!data)
- InspectorTest.log("FAIL: no data");
+ ProtocolTest.log("FAIL: no data");
else if (data.length < 1000)
- InspectorTest.log("FAIL: unexpectedly short data. A serialized archive should be pretty large.");
+ ProtocolTest.log("FAIL: unexpectedly short data. A serialized archive should be pretty large.");
else
- InspectorTest.log("PASS: Received archive data.");
+ ProtocolTest.log("PASS: Received archive data.");
- InspectorTest.completeTest();
+ ProtocolTest.completeTest();
});
}
</script>
diff --git a/LayoutTests/inspector/page/frameScheduledNavigation.html b/LayoutTests/inspector/page/frameScheduledNavigation.html
index 5ab19ec..44d8bae 100644
--- a/LayoutTests/inspector/page/frameScheduledNavigation.html
+++ b/LayoutTests/inspector/page/frameScheduledNavigation.html
@@ -10,29 +10,29 @@
function test()
{
- InspectorTest.eventHandler["Page.frameScheduledNavigation"] = onScheduled;
- InspectorTest.eventHandler["Page.frameStartedLoading"] = onStarted;
- InspectorTest.eventHandler["Page.frameClearedScheduledNavigation"] = onCleared;
- InspectorTest.sendCommand("Page.enable", {});
+ InspectorProtocol.eventHandler["Page.frameScheduledNavigation"] = onScheduled;
+ InspectorProtocol.eventHandler["Page.frameStartedLoading"] = onStarted;
+ InspectorProtocol.eventHandler["Page.frameClearedScheduledNavigation"] = onCleared;
+ InspectorProtocol.sendCommand("Page.enable", {});
function onScheduled(msg)
{
- InspectorTest.log("Scheduled navigation with delay " + msg.params.delay);
+ ProtocolTest.log("Scheduled navigation with delay " + msg.params.delay);
}
function onStarted(msg)
{
// This event should be received before the scheduled navigation is cleared.
- InspectorTest.log("Started loading");
+ ProtocolTest.log("Started loading");
}
function onCleared(msg)
{
- InspectorTest.log("Cleared scheduled navigation");
- InspectorTest.completeTest();
+ ProtocolTest.log("Cleared scheduled navigation");
+ ProtocolTest.completeTest();
}
- InspectorTest.sendCommand("Runtime.evaluate", { "expression": "load()" });
+ InspectorProtocol.sendCommand("Runtime.evaluate", { "expression": "load()" });
}
</script>
diff --git a/LayoutTests/inspector/page/frameStartedLoading.html b/LayoutTests/inspector/page/frameStartedLoading.html
index b3a940d..1fb2d03 100644
--- a/LayoutTests/inspector/page/frameStartedLoading.html
+++ b/LayoutTests/inspector/page/frameStartedLoading.html
@@ -12,21 +12,21 @@
function test()
{
- InspectorTest.eventHandler["Page.frameStartedLoading"] = onStart;
- InspectorTest.eventHandler["Page.frameStoppedLoading"] = onStop;
- InspectorTest.sendCommand("Page.enable", {});
+ InspectorProtocol.eventHandler["Page.frameStartedLoading"] = onStart;
+ InspectorProtocol.eventHandler["Page.frameStoppedLoading"] = onStop;
+ InspectorProtocol.sendCommand("Page.enable", {});
function onStart()
{
- InspectorTest.log("Started loading");
+ ProtocolTest.log("Started loading");
}
function onStop()
{
- InspectorTest.log("Stopped loading");
- InspectorTest.completeTest();
+ ProtocolTest.log("Stopped loading");
+ ProtocolTest.completeTest();
}
- InspectorTest.sendCommand("Runtime.evaluate", { "expression": "load()" });
+ InspectorProtocol.sendCommand("Runtime.evaluate", { "expression": "load()" });
}
</script>
diff --git a/LayoutTests/inspector/page/javascriptDialogEvents.html b/LayoutTests/inspector/page/javascriptDialogEvents.html
index 04e37b0..ef6d389 100644
--- a/LayoutTests/inspector/page/javascriptDialogEvents.html
+++ b/LayoutTests/inspector/page/javascriptDialogEvents.html
@@ -13,27 +13,27 @@
function test()
{
- InspectorTest.eventHandler["Page.javascriptDialogOpening"] = onOpening;
- InspectorTest.eventHandler["Page.javascriptDialogClosed"] = onClosed;
- InspectorTest.sendCommand("Page.enable", {});
+ InspectorProtocol.eventHandler["Page.javascriptDialogOpening"] = onOpening;
+ InspectorProtocol.eventHandler["Page.javascriptDialogClosed"] = onClosed;
+ InspectorProtocol.sendCommand("Page.enable", {});
function onOpening(event)
{
- InspectorTest.log("Opening with message: " + event.params.message);
+ ProtocolTest.log("Opening with message: " + event.params.message);
}
function onClosed()
{
- InspectorTest.log("Closed");
+ ProtocolTest.log("Closed");
}
- InspectorTest.sendCommand("Page.navigate", { "url": "nosuchurl" });
- InspectorTest.sendCommand("Runtime.evaluate", { "expression": "alert('alert')" });
- InspectorTest.sendCommand("Runtime.evaluate", { "expression": "confirm('confirm')" });
- InspectorTest.sendCommand("Runtime.evaluate", { "expression": "prompt('prompt')" }, onDone);
+ InspectorProtocol.sendCommand("Page.navigate", { "url": "nosuchurl" });
+ InspectorProtocol.sendCommand("Runtime.evaluate", { "expression": "alert('alert')" });
+ InspectorProtocol.sendCommand("Runtime.evaluate", { "expression": "confirm('confirm')" });
+ InspectorProtocol.sendCommand("Runtime.evaluate", { "expression": "prompt('prompt')" }, onDone);
function onDone()
{
- InspectorTest.completeTest();
+ ProtocolTest.completeTest();
}
}
diff --git a/LayoutTests/inspector/page/setEmulatedMedia.html b/LayoutTests/inspector/page/setEmulatedMedia.html
index 188a5a5..bd18757 100644
--- a/LayoutTests/inspector/page/setEmulatedMedia.html
+++ b/LayoutTests/inspector/page/setEmulatedMedia.html
@@ -9,12 +9,12 @@
function test()
{
- InspectorTest.sendCommand("Page.enable", {});
- InspectorTest.sendCommand("Page.setEmulatedMedia", {"media": "print"}, function(messageObject) {
+ InspectorProtocol.sendCommand("Page.enable", {});
+ InspectorProtocol.sendCommand("Page.setEmulatedMedia", {"media": "print"}, function(messageObject) {
if (messageObject.error)
- InspectorTest.log("FAILED: " + messageObject.error.message);
- InspectorTest.sendCommand("Page.disable", {});
- InspectorTest.completeTest();
+ ProtocolTest.log("FAILED: " + messageObject.error.message);
+ InspectorProtocol.sendCommand("Page.disable", {});
+ ProtocolTest.completeTest();
});
}
</script>
diff --git a/LayoutTests/inspector/runtime/getProperties.html b/LayoutTests/inspector/runtime/getProperties.html
index c44fe23..b11b64d 100644
--- a/LayoutTests/inspector/runtime/getProperties.html
+++ b/LayoutTests/inspector/runtime/getProperties.html
@@ -4,7 +4,7 @@
<script>
function test()
{
- var suite = new InspectorTest.AsyncTestSuite("Runtime.getProperties");
+ var suite = new ProtocolTest.AsyncTestSuite("Runtime.getProperties");
addGetPropertiesTestCase({
name: "CheckPropertiesOfWrapperObject",
@@ -33,8 +33,8 @@
name,
description,
test: function(resolve, reject) {
- InspectorTest.log("Evaluating expression: " + expression);
- InspectorTest.awaitCommand({
+ ProtocolTest.log("Evaluating expression: " + expression);
+ InspectorProtocol.awaitCommand({
method: "Runtime.evaluate",
params: {expression}
})
@@ -43,7 +43,7 @@
if (objectId === undefined)
throw new Error("objectId is expected");
- return InspectorTest.awaitCommand({
+ return InspectorProtocol.awaitCommand({
method: "Runtime.getProperties",
params: {objectId, ownProperties: true}
});
@@ -61,14 +61,14 @@
function dumpGetPropertiesResult(protocolResult) {
var properties = protocolResult.result;
if (properties) {
- InspectorTest.log("Properties:");
+ ProtocolTest.log("Properties:");
properties.sort(NamedThingComparator);
properties.map(dumpSingleProperty);
}
var internalProperties = protocolResult.internalProperties;
if (internalProperties) {
- InspectorTest.log("Internal properties:");
+ ProtocolTest.log("Internal properties:");
internalProperties.sort(NamedThingComparator);
internalProperties.map(dumpSingleProperty);
}
@@ -76,9 +76,9 @@
function dumpSingleProperty(property) {
var {name, value} = property;
if (value)
- InspectorTest.log(" " + name + " " + value.type + " " + (value.value || value.description));
+ ProtocolTest.log(" " + name + " " + value.type + " " + (value.value || value.description));
else
- InspectorTest.log(" " + name);
+ ProtocolTest.log(" " + name);
}
function NamedThingComparator(o1, o2) {
diff --git a/LayoutTests/inspector/unit-tests/async-test-suite.html b/LayoutTests/inspector/unit-tests/async-test-suite.html
index e25de42..863148a 100644
--- a/LayoutTests/inspector/unit-tests/async-test-suite.html
+++ b/LayoutTests/inspector/unit-tests/async-test-suite.html
@@ -6,60 +6,60 @@
function test()
{
try {
- new InspectorTest.AsyncTestSuite();
- InspectorTest.log("FAIL: instantiating AsyncTestSuite requires name argument.");
+ new ProtocolTest.AsyncTestSuite();
+ ProtocolTest.log("FAIL: instantiating AsyncTestSuite requires name argument.");
} catch (e) {
- InspectorTest.log("PASS: instantiating AsyncTestSuite requires name argument.");
+ ProtocolTest.log("PASS: instantiating AsyncTestSuite requires name argument.");
}
try {
- new InspectorTest.AsyncTestSuite({});
- InspectorTest.log("FAIL: instantiating AsyncTestSuite requires string name argument.");
+ new ProtocolTest.AsyncTestSuite({});
+ ProtocolTest.log("FAIL: instantiating AsyncTestSuite requires string name argument.");
} catch (e) {
- InspectorTest.log("PASS: instantiating AsyncTestSuite requires string name argument.");
+ ProtocolTest.log("PASS: instantiating AsyncTestSuite requires string name argument.");
}
- var badArgsSuite = new InspectorTest.AsyncTestSuite("dummy");
+ var badArgsSuite = new ProtocolTest.AsyncTestSuite("dummy");
try {
badArgsSuite.addTestCase();
- InspectorTest.log("FAIL: should not be able to add empty test case.");
+ ProtocolTest.log("FAIL: should not be able to add empty test case.");
} catch (e) {
- InspectorTest.log("PASS: should not be able to add empty test case.");
+ ProtocolTest.log("PASS: should not be able to add empty test case.");
}
try {
badArgsSuite.addTestCase("string");
- InspectorTest.log("FAIL: should not be able to add non-object test case.");
+ ProtocolTest.log("FAIL: should not be able to add non-object test case.");
} catch (e) {
- InspectorTest.log("PASS: should not be able to add non-object test case.");
+ ProtocolTest.log("PASS: should not be able to add non-object test case.");
}
try {
badArgsSuite.addTestCase({
name: {},
test: function() {},
});
- InspectorTest.log("FAIL: test case should require string name.");
+ ProtocolTest.log("FAIL: test case should require string name.");
} catch (e) {
- InspectorTest.log("PASS: test case should require string name.");
+ ProtocolTest.log("PASS: test case should require string name.");
}
try {
badArgsSuite.addTestCase({
name: "foo",
test: null,
});
- InspectorTest.log("FAIL: test case should require test function.");
+ ProtocolTest.log("FAIL: test case should require test function.");
} catch (e) {
- InspectorTest.log("PASS: test case should require test function.");
+ ProtocolTest.log("PASS: test case should require test function.");
}
- var runEmptySuite = new InspectorTest.AsyncTestSuite("AsyncTestSuite.RunEmptySuite");
+ var runEmptySuite = new ProtocolTest.AsyncTestSuite("AsyncTestSuite.RunEmptySuite");
try {
runEmptySuite.runTestCases();
- InspectorTest.log("FAIL: should not be able to run empty test suite.");
+ ProtocolTest.log("FAIL: should not be able to run empty test suite.");
} catch (e) {
- InspectorTest.log("PASS: should not be able to run empty test suite.");
+ ProtocolTest.log("PASS: should not be able to run empty test suite.");
}
- var runTwiceSuite = new InspectorTest.AsyncTestSuite("AsyncTestSuite.RunTwiceSuite");
+ var runTwiceSuite = new ProtocolTest.AsyncTestSuite("AsyncTestSuite.RunTwiceSuite");
runTwiceSuite.addTestCase({
name: "DummyTest0",
description: "Check that a suite can't run more than once.",
@@ -73,15 +73,15 @@
// Test cases won't run in this event loop; this call should still throw.
// Later tests are chained to this suite to avoid nondeterminism.
runTwiceSuite.runTestCases();
- InspectorTest.log("FAIL: should not be able to run a test suite twice.");
+ ProtocolTest.log("FAIL: should not be able to run a test suite twice.");
} catch (e) {
- InspectorTest.log("PASS: should not be able to run a test suite twice.");
+ ProtocolTest.log("PASS: should not be able to run a test suite twice.");
}
var rejectToken = {"token": 666};
var thrownError = new Error(rejectToken);
- var sequentialExecutionSuite = new InspectorTest.AsyncTestSuite("AsyncTestSuite.SequentialExecution");
+ var sequentialExecutionSuite = new ProtocolTest.AsyncTestSuite("AsyncTestSuite.SequentialExecution");
sequentialExecutionSuite.addTestCase({
name: "DummyTest1",
description: "Check test case execution order.",
@@ -111,7 +111,7 @@
}
});
- var abortOnFailureSuite = new InspectorTest.AsyncTestSuite("AsyncTestSuite.AbortOnFailure");
+ var abortOnFailureSuite = new ProtocolTest.AsyncTestSuite("AsyncTestSuite.AbortOnFailure");
abortOnFailureSuite.addTestCase({
name: "PassingTest5",
description: "This test is a dummy.",
@@ -136,41 +136,41 @@
result = result.then(function() {
var promise = sequentialExecutionSuite.runTestCases();
- InspectorTest.assert(result instanceof Promise, "AsyncTestSuite.RunTestCases() should return a Promise.");
+ ProtocolTest.assert(result instanceof Promise, "AsyncTestSuite.RunTestCases() should return a Promise.");
return promise;
});
result = result.then(function resolved() {
- InspectorTest.log("FAIL: Promise from sequentialExecutionSuite.runTestCases() should reject when a test case fails.");
+ ProtocolTest.log("FAIL: Promise from sequentialExecutionSuite.runTestCases() should reject when a test case fails.");
return Promise.resolve(); // Continue this test.
}, function rejected(e) {
- InspectorTest.log("PASS: Promise from sequentialExecutionSuite.runTestCases() should reject when a test case fails.");
- InspectorTest.assert(e === thrownError, "Promise from sequentialExecutionSuite.runTestCases() should reject without altering its result value.");
+ 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.");
- InspectorTest.assert(sequentialExecutionSuite.runCount === 4, "sequentialExecutionSuite should have executed four tests.");
- InspectorTest.assert(sequentialExecutionSuite.passCount === 3, "sequentialExecutionSuite should have passed three tests.");
- InspectorTest.assert(sequentialExecutionSuite.failCount === 1, "sequentialExecutionSuite should have failed 1 test.");
- InspectorTest.assert(sequentialExecutionSuite.skipCount === 0, "sequentialExecutionSuite should have skipped zero tests.");
+ 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.");
return Promise.resolve(); // Continue this test.
});
result = result.then(function() {
return abortOnFailureSuite.runTestCases();
}).then(function resolved() {
- InspectorTest.log("FAIL: Promise from abortOnFailureSuite.runTestCases() should reject when a test case fails.");
+ ProtocolTest.log("FAIL: Promise from abortOnFailureSuite.runTestCases() should reject when a test case fails.");
return Promise.resolve(); // Continue this test.
}, function rejected(e) {
- InspectorTest.log("PASS: Promise from abortOnFailureSuite.runTestCases() should reject when a test case fails.");
- InspectorTest.assert(e === rejectToken, "Promise from abortOnFailureSuite.runTestCases() should reject without altering its result value.");
- InspectorTest.assert(abortOnFailureSuite.runCount === 2, "abortOnFailureSuite should have executed two tests.");
- InspectorTest.assert(abortOnFailureSuite.passCount === 1, "abortOnFailureSuite should have passed one test.");
- InspectorTest.assert(abortOnFailureSuite.failCount === 1, "abortOnFailureSuite should have failed one test.");
- InspectorTest.assert(abortOnFailureSuite.skipCount === 1, "abortOnFailureSuite should have skipped one test.");
+ 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.");
return Promise.resolve(); // Continue this test.
});
// This will finish the test whether the chain was resolved or rejected.
- result = result.then(function() { InspectorTest.completeTest(); });
+ result = result.then(function() { ProtocolTest.completeTest(); });
}
</script>
</head>
diff --git a/LayoutTests/inspector/unit-tests/sync-test-suite.html b/LayoutTests/inspector/unit-tests/sync-test-suite.html
index ea6b9e4..9843508 100644
--- a/LayoutTests/inspector/unit-tests/sync-test-suite.html
+++ b/LayoutTests/inspector/unit-tests/sync-test-suite.html
@@ -6,60 +6,60 @@
function test()
{
try {
- new InspectorTest.SyncTestSuite();
- InspectorTest.log("FAIL: instantiating SyncTestSuite requires name argument.");
+ new ProtocolTest.SyncTestSuite();
+ ProtocolTest.log("FAIL: instantiating SyncTestSuite requires name argument.");
} catch (e) {
- InspectorTest.log("PASS: instantiating SyncTestSuite requires name argument.");
+ ProtocolTest.log("PASS: instantiating SyncTestSuite requires name argument.");
}
try {
- new InspectorTest.SyncTestSuite({});
- InspectorTest.log("FAIL: instantiating SyncTestSuite requires string name argument.");
+ new ProtocolTest.SyncTestSuite({});
+ ProtocolTest.log("FAIL: instantiating SyncTestSuite requires string name argument.");
} catch (e) {
- InspectorTest.log("PASS: instantiating SyncTestSuite requires string name argument.");
+ ProtocolTest.log("PASS: instantiating SyncTestSuite requires string name argument.");
}
- var badArgsSuite = new InspectorTest.SyncTestSuite("dummy");
+ var badArgsSuite = new ProtocolTest.SyncTestSuite("dummy");
try {
badArgsSuite.addTestCase();
- InspectorTest.log("FAIL: should not be able to add empty test case.");
+ ProtocolTest.log("FAIL: should not be able to add empty test case.");
} catch (e) {
- InspectorTest.log("PASS: should not be able to add empty test case.");
+ ProtocolTest.log("PASS: should not be able to add empty test case.");
}
try {
badArgsSuite.addTestCase("string");
- InspectorTest.log("FAIL: should not be able to add non-object test case.");
+ ProtocolTest.log("FAIL: should not be able to add non-object test case.");
} catch (e) {
- InspectorTest.log("PASS: should not be able to add non-object test case.");
+ ProtocolTest.log("PASS: should not be able to add non-object test case.");
}
try {
badArgsSuite.addTestCase({
name: {},
test: function() { return true; },
});
- InspectorTest.log("FAIL: test case should require string name.");
+ ProtocolTest.log("FAIL: test case should require string name.");
} catch (e) {
- InspectorTest.log("PASS: test case should require string name.");
+ ProtocolTest.log("PASS: test case should require string name.");
}
try {
badArgsSuite.addTestCase({
name: "foo",
test: null,
});
- InspectorTest.log("FAIL: test case should require test function.");
+ ProtocolTest.log("FAIL: test case should require test function.");
} catch (e) {
- InspectorTest.log("PASS: test case should require test function.");
+ ProtocolTest.log("PASS: test case should require test function.");
}
- var runEmptySuite = new InspectorTest.SyncTestSuite("SyncTestSuite.RunEmptySuite");
+ var runEmptySuite = new ProtocolTest.SyncTestSuite("SyncTestSuite.RunEmptySuite");
try {
runEmptySuite.runTestCases();
- InspectorTest.log("FAIL: should not be able to run empty test suite.");
+ ProtocolTest.log("FAIL: should not be able to run empty test suite.");
} catch (e) {
- InspectorTest.log("PASS: should not be able to run empty test suite.");
+ ProtocolTest.log("PASS: should not be able to run empty test suite.");
}
- var runTwiceSuite = new InspectorTest.SyncTestSuite("SyncTestSuite.RunTwiceSuite");
+ var runTwiceSuite = new ProtocolTest.SyncTestSuite("SyncTestSuite.RunTwiceSuite");
runTwiceSuite.addTestCase({
name: "DummyTest0",
description: "Check that a suite can't run more than once.",
@@ -68,17 +68,17 @@
try {
var result = runTwiceSuite.runTestCases();
- InspectorTest.assert(result === true, "Return value of runTwiceSuite.runTestCases() should be true when all tests pass.");
+ ProtocolTest.assert(result === true, "Return value of runTwiceSuite.runTestCases() should be true when all tests pass.");
runTwiceSuite.runTestCases(); // Try to trigger an error.
- InspectorTest.log("FAIL: should not be able to run a test suite twice.");
+ ProtocolTest.log("FAIL: should not be able to run a test suite twice.");
} catch (e) {
- InspectorTest.log("PASS: should not be able to run a test suite twice.");
+ ProtocolTest.log("PASS: should not be able to run a test suite twice.");
}
var thrownError = new Error({"token": 666});
- var sequentialExecutionSuite = new InspectorTest.SyncTestSuite("SyncTestSuite.SequentialExecution");
+ var sequentialExecutionSuite = new ProtocolTest.SyncTestSuite("SyncTestSuite.SequentialExecution");
sequentialExecutionSuite.addTestCase({
name: "DummyTest1",
description: "Check test case execution order.",
@@ -101,13 +101,13 @@
});
var result = sequentialExecutionSuite.runTestCases();
- InspectorTest.assert(result === false, "Return value of sequentialExecutionSuite.runTestCases() should be false when a test case fails.");
- InspectorTest.assert(sequentialExecutionSuite.runCount === 4, "sequentialExecutionSuite should have executed four tests.");
- InspectorTest.assert(sequentialExecutionSuite.passCount === 3, "sequentialExecutionSuite should have passed three tests.");
- InspectorTest.assert(sequentialExecutionSuite.failCount === 1, "sequentialExecutionSuite should have failed 1 test.");
- InspectorTest.assert(sequentialExecutionSuite.skipCount === 0, "sequentialExecutionSuite should have skipped zero tests.");
+ 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.");
- var abortOnFailureSuite = new InspectorTest.SyncTestSuite("SyncTestSuite.AbortOnFailure");
+ var abortOnFailureSuite = new ProtocolTest.SyncTestSuite("SyncTestSuite.AbortOnFailure");
abortOnFailureSuite.addTestCase({
name: "PassingTest5",
description: "This test is a dummy.",
@@ -125,13 +125,13 @@
});
abortOnFailureSuite.runTestCases();
- InspectorTest.assert(result === false, "Return value of abortOnFailureSuite.runTestCases() should be false when a test case fails.");
- InspectorTest.assert(abortOnFailureSuite.runCount === 2, "abortOnFailureSuite should have executed two tests.");
- InspectorTest.assert(abortOnFailureSuite.passCount === 1, "abortOnFailureSuite should have passed one test.");
- InspectorTest.assert(abortOnFailureSuite.failCount === 1, "abortOnFailureSuite should have failed one test.");
- InspectorTest.assert(abortOnFailureSuite.skipCount === 1, "abortOnFailureSuite should have skipped one test.");
+ 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.");
- InspectorTest.completeTest();
+ ProtocolTest.completeTest();
}
</script>
</head>