Chromium Code Reviews| Index: LayoutTests/inspector/sources/debugger/properties-special.html |
| diff --git a/LayoutTests/inspector/sources/debugger/properties-special.html b/LayoutTests/inspector/sources/debugger/properties-special.html |
| index 6ddbf9ab883c89d4753b849d9c7068d50dbcf259..c1b40ebd17a6155a3ba1c4528212dc1dc050b370 100644 |
| --- a/LayoutTests/inspector/sources/debugger/properties-special.html |
| +++ b/LayoutTests/inspector/sources/debugger/properties-special.html |
| @@ -4,56 +4,39 @@ |
| <script src="../../../http/tests/inspector/debugger-test.js"></script> |
| <script src="../../../http/tests/inspector/elements-test.js"></script> |
| <script> |
| -function testFunction() |
| -{ |
| - var x = Math.sqrt(10); |
| - return x; |
| -} |
| var test = function() |
| { |
| InspectorTest.setQuiet(true); |
| + //our callback called twice per each experession |
| + var updateCount = 6; |
| + |
| InspectorTest.startDebuggerTest(step1); |
| - var currentSourceFrame; |
| - var watchExpressionsSection; |
| + var watchExpressionsPane; |
| function step1() |
| { |
| - var watchExpressionsPane = WebInspector.panels.sources.sidebarPanes.watchExpressions; |
| + watchExpressionsPane = WebInspector.panels.sources.sidebarPanes.watchExpressions; |
| watchExpressionsPane.expand(); |
| - watchExpressionsSection = watchExpressionsPane.section; |
| - watchExpressionsSection.watchExpressions = []; |
| - watchExpressionsSection.watchExpressions.push("Object(true)"); |
| - watchExpressionsSection.watchExpressions.push("(function(a,b) { return a + b; })"); |
| - watchExpressionsSection.watchExpressions.push("(function(a,b) { return a + b; }).bind({}, 2)"); |
| - watchExpressionsSection.update(); |
| - |
| - var testName = InspectorTest.resourceTreeModel.inspectedPageURL(); |
| - testName = testName.substring(testName.lastIndexOf('/') + 1); |
| - InspectorTest.showScriptSource(testName, didShowScriptSource); |
| - } |
| - |
| - function didShowScriptSource(sourceFrame) |
| - { |
| - currentSourceFrame = sourceFrame; |
| - InspectorTest.addResult("Script source was shown."); |
| - InspectorTest.setBreakpoint(currentSourceFrame, 9, "", true); |
| - InspectorTest.addSniffer(WebInspector.WatchExpressionsSection.prototype, "update", watchExpressionsUpdated); |
| - InspectorTest.runTestFunctionAndWaitUntilPaused(didPause); |
| - } |
| - |
| - function didPause(callFrames) |
| - { |
| + InspectorTest.addSniffer(WebInspector.WatchExpression.prototype, "_createWatchExpression", watchExpressionsUpdated, true); |
|
pfeldman
2015/02/18 20:51:00
You'll have to rebaseline this.
|
| + watchExpressionsPane.addExpression("Object(true)"); |
| + watchExpressionsPane.addExpression("(function(a,b) { return a + b; })"); |
| + watchExpressionsPane.addExpression("(function(a,b) { return a + b; }).bind({}, 2)"); |
| } |
| function watchExpressionsUpdated() |
| { |
| + updateCount--; |
| + if (updateCount) |
| + return; |
| + |
| InspectorTest.addResult("Watch expressions updated."); |
| - var treeNodes = watchExpressionsSection.propertiesTreeOutline.children; |
| - for (var i = 0; i < treeNodes.length; i++) { |
| - treeNodes[i].expand(); |
| + |
| + for (var i = 0; i < watchExpressionsPane._watchExpressions.length; i++) { |
| + var watch = watchExpressionsPane._watchExpressions[i]; |
| + watch._objectPresentationElement._section.expand(); |
| } |
| InspectorTest.runAfterPendingDispatches(nodesExpanded); |
| } |
| @@ -61,12 +44,16 @@ var test = function() |
| function nodesExpanded() |
| { |
| InspectorTest.addResult("Nodes are expanded."); |
| - InspectorTest.dumpObjectPropertySectionDeep(watchExpressionsSection); |
| + for (var i = 0; i < watchExpressionsPane._watchExpressions.length; i++) { |
| + var watch = watchExpressionsPane._watchExpressions[i]; |
| + var nameElement = watch._objectPresentationElement.querySelector(".name"); |
| + var valueElement = watch._objectPresentationElement.querySelector(".value"); |
| + InspectorTest.addResult("'" + nameElement.textContent + "'" + " => " + "'" + valueElement.textContent + "'"); |
| + InspectorTest.dumpObjectPropertySectionDeep(watch._objectPresentationElement._section) |
| + } |
| // Clear watch expressions after execution. |
| - watchExpressionsSection.watchExpressions = []; |
| - watchExpressionsSection.update(); |
| - |
| + watchExpressionsPane._deleteAllButtonClicked(); |
| InspectorTest.completeDebuggerTest(); |
| } |
| } |