From: achicu@adobe.com Date: Fri, 25 Oct 2013 22:24:49 +0000 (+0000) Subject: Web Inspector: CSS Regions: Add layout tests for the new events in the DOMTreeManager X-Git-Url: http://git.webkit.org/?p=WebKit-https.git;a=commitdiff_plain;h=95ee37ba528c1a77f6e2138ecbebe5b560324144;hp=80ee727bc3385046d9863957637ec4f74ac8b055 Web Inspector: CSS Regions: Add layout tests for the new events in the DOMTreeManager https://bugs.webkit.org/show_bug.cgi?id=123361 Reviewed by Timothy Hatcher. Created a test to check that WebInspector.DOMTree.Event.ContentFlowWasAdded and WebInspector.DOMTree.Event.ContentFlowWasRemoved are dispatched when a flow is added and removed. * http/tests/inspector-protocol/resources/InspectorTest.js: (InspectorTest.assert): Similar to InspectorTest.log, but also takes a boolean and prefixes the message with "FAIL" or "PASS" depending on the value. (InspectorTest.importInspectorScripts): Added the required CSS Agent scripts to enable the flow thread events. * inspector-protocol/model/content-flow-list-expected.txt: Added. * inspector-protocol/model/content-flow-list.html: Added. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@158062 268f45cc-cd09-0410-ab3c-d52691b4dbfc --- diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog index 8663d54..917d7a4 100644 --- a/LayoutTests/ChangeLog +++ b/LayoutTests/ChangeLog @@ -1,3 +1,21 @@ +2013-10-25 Alexandru Chiculita + + Web Inspector: CSS Regions: Add layout tests for the new events in the DOMTreeManager + https://bugs.webkit.org/show_bug.cgi?id=123361 + + Reviewed by Timothy Hatcher. + + Created a test to check that WebInspector.DOMTree.Event.ContentFlowWasAdded and + WebInspector.DOMTree.Event.ContentFlowWasRemoved are dispatched when a flow is added + and removed. + + * http/tests/inspector-protocol/resources/InspectorTest.js: + (InspectorTest.assert): Similar to InspectorTest.log, but also takes a boolean and prefixes the message + with "FAIL" or "PASS" depending on the value. + (InspectorTest.importInspectorScripts): Added the required CSS Agent scripts to enable the flow thread events. + * inspector-protocol/model/content-flow-list-expected.txt: Added. + * inspector-protocol/model/content-flow-list.html: Added. + 2013-10-25 Oliver Hunt Fix a number of problems with destructuring of arguments diff --git a/LayoutTests/http/tests/inspector-protocol/resources/InspectorTest.js b/LayoutTests/http/tests/inspector-protocol/resources/InspectorTest.js index f496364..8e0fb6e 100644 --- a/LayoutTests/http/tests/inspector-protocol/resources/InspectorTest.js +++ b/LayoutTests/http/tests/inspector-protocol/resources/InspectorTest.js @@ -75,6 +75,17 @@ InspectorTest.log = function(message) } /** +* Logs an assert message to document. +* @param {boolean} condition +* @param {string} message +*/ +InspectorTest.assert = function(condition, message) +{ + var status = condition ? "PASS" : "FAIL"; + this.sendCommand("Runtime.evaluate", { "expression": "log(" + JSON.stringify(status + ": " + message) + ")" } ); +} + +/** * Logs message directly to process stdout via alert function (hopefully followed by flush call). * This message should survive process crash or kill by timeout. * @param {string} message @@ -130,6 +141,7 @@ InspectorTest.importInspectorScripts = function() "Setting", "PageObserver", "DOMObserver", + "CSSObserver", "FrameResourceManager", "RuntimeManager", "Frame", @@ -143,7 +155,9 @@ InspectorTest.importInspectorScripts = function() "ContentFlow", "DOMTree", "ExecutionContext", - "ExecutionContextList" + "ExecutionContextList", + "CSSStyleManager", + "Color" ]; for (var i = 0; i < inspectorScripts.length; ++i) InspectorTest.importScript("../../../../../Source/WebInspectorUI/UserInterface/" + inspectorScripts[i] + ".js"); @@ -154,9 +168,11 @@ InspectorTest.importInspectorScripts = function() InspectorBackend.registerPageDispatcher(new WebInspector.PageObserver); InspectorBackend.registerDOMDispatcher(new WebInspector.DOMObserver); + InspectorBackend.registerCSSDispatcher(new WebInspector.CSSObserver); WebInspector.frameResourceManager = new WebInspector.FrameResourceManager; WebInspector.domTreeManager = new WebInspector.DOMTreeManager; + WebInspector.cssStyleManager = new WebInspector.CSSStyleManager; InspectorFrontendHost.loaded(); } diff --git a/LayoutTests/inspector-protocol/model/content-flow-list-expected.txt b/LayoutTests/inspector-protocol/model/content-flow-list-expected.txt new file mode 100644 index 0000000..5a150c25 --- /dev/null +++ b/LayoutTests/inspector-protocol/model/content-flow-list-expected.txt @@ -0,0 +1,7 @@ +Testing that the ContentFlows events are correctly dispatched when new flows are created/removed. + +PASS: ContentFlow was added +PASS: Flow count is 1 +PASS: ContentFlow was removed +PASS: Flow count is 0 + diff --git a/LayoutTests/inspector-protocol/model/content-flow-list.html b/LayoutTests/inspector-protocol/model/content-flow-list.html new file mode 100644 index 0000000..a273eb1 --- /dev/null +++ b/LayoutTests/inspector-protocol/model/content-flow-list.html @@ -0,0 +1,56 @@ + + + + + + + + +

Testing that the ContentFlows events are correctly dispatched when new flows are created/removed.

+ +
+ +