Index: third_party/WebKit/LayoutTests/inspector/sources/debugger-breakpoints/dom-breakpoints.html |
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger-breakpoints/dom-breakpoints.html b/third_party/WebKit/LayoutTests/inspector/sources/debugger-breakpoints/dom-breakpoints.html |
index 40de3d5174624c8c5f9d4203adc44b1de4e53806..b43ddff52c6b0de04597a71f245c683aaa33366e 100644 |
--- a/third_party/WebKit/LayoutTests/inspector/sources/debugger-breakpoints/dom-breakpoints.html |
+++ b/third_party/WebKit/LayoutTests/inspector/sources/debugger-breakpoints/dom-breakpoints.html |
@@ -81,8 +81,6 @@ function appendElementToOpenShadowRoot(childId) |
function test() |
{ |
- |
- var pane = WebInspector.domBreakpointsSidebarPane; |
var rootElement; |
var outerElement; |
var authorShadowRoot; |
@@ -95,7 +93,7 @@ function test() |
function step2(node) |
{ |
rootElement = node; |
- pane._setBreakpoint(node, pane._breakpointTypes.SubtreeModified, true); |
+ WebInspector.domBreakpointManager.setBreakpoint(node, WebInspector.DOMBreakpointsSidebarPane.BreakpointTypes.SubtreeModified, true); |
InspectorTest.addResult("Set 'Subtree Modified' DOM breakpoint on rootElement."); |
InspectorTest.evaluateInPageWithTimeout("appendElement('rootElement', 'childElement')"); |
InspectorTest.addResult("Append childElement to rootElement."); |
@@ -103,6 +101,39 @@ function test() |
} |
}, |
+ function testBreakpointToggle(next) |
+ { |
+ InspectorTest.addResult("Test that 'Attribute Modified' breakpoint toggles properly"); |
+ InspectorTest.nodeWithId("rootElement", step2); |
+ var element; |
+ |
+ function step2(node) |
+ { |
+ rootElement = node; |
+ InspectorTest.addResult("Set 'Attribute Modified' DOM breakpoint on rootElement."); |
+ WebInspector.domBreakpointManager.setBreakpoint(node, WebInspector.DOMBreakpointsSidebarPane.BreakpointTypes.AttributeModified, true); |
+ var pane = InspectorTest.domBreakpointsSidebarPane(); |
+ var elementId = pane._createBreakpointId(node.id, WebInspector.DOMBreakpointsSidebarPane.BreakpointTypes.AttributeModified); |
+ element = pane._breakpointElements.get(elementId); |
+ InspectorTest.addResult("Uncheck 'Attribute Modified' DOM breakpoint on rootElement."); |
+ element._checkboxElement.click(); |
+ InspectorTest.evaluateInPagePromise("modifyAttribute('rootElement', 'data-test-breakpoint-disabled', 'foo')").then(step3); |
+ InspectorTest.addResult("Modify attribute for rootElement."); |
+ } |
+ |
+ function step3() |
+ { |
+ InspectorTest.addResult("Test that 'Attribute Modified' breakpoint is not hit when disabled"); |
+ InspectorTest.assertNotPaused(); |
+ InspectorTest.addResult("Check 'Attribute Modified' DOM breakpoint on rootElement."); |
+ element._checkboxElement.click(); |
+ InspectorTest.evaluateInPageWithTimeout("modifyAttribute('rootElement', 'data-test-breakpoint-disabled', 'bar')"); |
+ InspectorTest.addResult("Modify attribute for rootElement."); |
+ InspectorTest.addResult("Test that 'Attribute Modified' breakpoint is hit when re-enabled"); |
+ InspectorTest.waitUntilPausedAndDumpStackAndResume(next); |
+ } |
+ }, |
+ |
function testInsertGrandchild(next) |
{ |
InspectorTest.addResult("Test that 'Subtree Modified' breakpoint is hit when appending a grandchild."); |
@@ -136,7 +167,7 @@ function test() |
function step3(frames) |
{ |
InspectorTest.captureStackTrace(frames); |
- pane._removeBreakpoint(rootElement, pane._breakpointTypes.SubtreeModified); |
+ WebInspector.domBreakpointManager.removeBreakpoint(rootElement, WebInspector.DOMBreakpointsSidebarPane.BreakpointTypes.SubtreeModified); |
InspectorTest.resumeExecution(next); |
} |
}, |
@@ -144,7 +175,7 @@ function test() |
function testModifyAttribute(next) |
{ |
InspectorTest.addResult("Test that 'Attribute Modified' breakpoint is hit when modifying attribute."); |
- pane._setBreakpoint(rootElement, pane._breakpointTypes.AttributeModified, true); |
+ WebInspector.domBreakpointManager.setBreakpoint(rootElement, WebInspector.DOMBreakpointsSidebarPane.BreakpointTypes.AttributeModified, true); |
InspectorTest.addResult("Set 'Attribute Modified' DOM breakpoint on rootElement."); |
InspectorTest.evaluateInPageWithTimeout("modifyAttribute('rootElement', 'data-test', 'foo')"); |
InspectorTest.addResult("Modify rootElement data-test attribute."); |
@@ -152,15 +183,22 @@ function test() |
function step2(callFrames) |
{ |
- pane._removeBreakpoint(rootElement, pane._breakpointTypes.AttributeModified); |
- next(); |
+ WebInspector.domBreakpointManager.removeBreakpoint(rootElement, WebInspector.DOMBreakpointsSidebarPane.BreakpointTypes.AttributeModified); |
+ InspectorTest.addResult("Ensure the breakpoint is actually removed."); |
+ InspectorTest.evaluateInPagePromise("modifyAttribute('rootElement', 'data-test', 'foo')").then(step3); |
+ InspectorTest.addResult("Modify rootElement data-test attribute."); |
+ } |
+ |
+ function step3() |
+ { |
+ InspectorTest.waitUntilResumed(next); |
} |
}, |
function testModifyAttrNode(next) |
{ |
InspectorTest.addResult("Test that 'Attribute Modified' breakpoint is hit when modifying Attr node."); |
- pane._setBreakpoint(rootElement, pane._breakpointTypes.AttributeModified, true); |
+ WebInspector.domBreakpointManager.setBreakpoint(rootElement, WebInspector.DOMBreakpointsSidebarPane.BreakpointTypes.AttributeModified, true); |
InspectorTest.addResult("Set 'Attribute Modified' DOM breakpoint on rootElement."); |
InspectorTest.evaluateInPageWithTimeout("modifyAttrNode('rootElement', 'data-test', 'bar')"); |
InspectorTest.addResult("Modify rootElement data-test attribute."); |
@@ -168,7 +206,7 @@ function test() |
function step2(callFrames) |
{ |
- pane._removeBreakpoint(rootElement, pane._breakpointTypes.AttributeModified); |
+ WebInspector.domBreakpointManager.removeBreakpoint(rootElement, WebInspector.DOMBreakpointsSidebarPane.BreakpointTypes.AttributeModified); |
next(); |
} |
}, |
@@ -176,7 +214,7 @@ function test() |
function testSetAttrNode(next) |
{ |
InspectorTest.addResult("Test that 'Attribute Modified' breakpoint is hit when adding a new Attr node."); |
- pane._setBreakpoint(rootElement, pane._breakpointTypes.AttributeModified, true); |
+ WebInspector.domBreakpointManager.setBreakpoint(rootElement, WebInspector.DOMBreakpointsSidebarPane.BreakpointTypes.AttributeModified, true); |
InspectorTest.addResult("Set 'Attribute Modified' DOM breakpoint on rootElement."); |
InspectorTest.evaluateInPageWithTimeout("setAttrNode('rootElement', 'data-foo', 'bar')"); |
InspectorTest.addResult("Modify rootElement data-foo attribute."); |
@@ -184,7 +222,7 @@ function test() |
function step2(callFrames) |
{ |
- pane._removeBreakpoint(rootElement, pane._breakpointTypes.AttributeModified); |
+ WebInspector.domBreakpointManager.removeBreakpoint(rootElement, WebInspector.DOMBreakpointsSidebarPane.BreakpointTypes.AttributeModified); |
next(); |
} |
}, |
@@ -192,7 +230,7 @@ function test() |
function testModifyStyleAttribute(next) |
{ |
InspectorTest.addResult("Test that 'Attribute Modified' breakpoint is hit when modifying style attribute."); |
- pane._setBreakpoint(rootElement, pane._breakpointTypes.AttributeModified, true); |
+ WebInspector.domBreakpointManager.setBreakpoint(rootElement, WebInspector.DOMBreakpointsSidebarPane.BreakpointTypes.AttributeModified, true); |
InspectorTest.addResult("Set 'Attribute Modified' DOM breakpoint on rootElement."); |
InspectorTest.evaluateInPageWithTimeout("modifyStyleAttribute('rootElement', 'color', 'green')"); |
InspectorTest.addResult("Modify rootElement style.color attribute."); |
@@ -200,7 +238,7 @@ function test() |
function step2(callFrames) |
{ |
- pane._removeBreakpoint(rootElement, pane._breakpointTypes.AttributeModified); |
+ WebInspector.domBreakpointManager.removeBreakpoint(rootElement, WebInspector.DOMBreakpointsSidebarPane.BreakpointTypes.AttributeModified); |
next(); |
} |
}, |
@@ -212,7 +250,7 @@ function test() |
function step2(node) |
{ |
- pane._setBreakpoint(node, pane._breakpointTypes.NodeRemoved, true); |
+ WebInspector.domBreakpointManager.setBreakpoint(node, WebInspector.DOMBreakpointsSidebarPane.BreakpointTypes.NodeRemoved, true); |
InspectorTest.addResult("Set 'Node Removed' DOM breakpoint on elementToRemove."); |
InspectorTest.evaluateInPageWithTimeout("removeElement('elementToRemove')"); |
InspectorTest.addResult("Remove elementToRemove."); |
@@ -227,8 +265,7 @@ function test() |
function step2(node) |
{ |
- pane._setBreakpoint(node, pane._breakpointTypes.SubtreeModified, true); |
- pane._saveBreakpoints(); |
+ WebInspector.domBreakpointManager.setBreakpoint(node, WebInspector.DOMBreakpointsSidebarPane.BreakpointTypes.SubtreeModified, true); |
InspectorTest.addResult("Set 'Subtree Modified' DOM breakpoint on rootElement."); |
InspectorTest.reloadPage(step3); |
} |
@@ -254,7 +291,7 @@ function test() |
{ |
authorShadowRoot = node; |
InspectorTest.addResult("Test that 'Subtree Modified' breakpoint on author shadow root is hit when appending a child."); |
- pane._setBreakpoint(authorShadowRoot, pane._breakpointTypes.SubtreeModified, true); |
+ WebInspector.domBreakpointManager.setBreakpoint(authorShadowRoot, WebInspector.DOMBreakpointsSidebarPane.BreakpointTypes.SubtreeModified, true); |
InspectorTest.addResult("Set 'Subtree Modified' DOM breakpoint on author shadow root."); |
InspectorTest.evaluateInPageWithTimeout("appendElementToOpenShadowRoot('childElement')"); |
InspectorTest.addResult("Append childElement to author shadow root."); |
@@ -271,8 +308,7 @@ function test() |
outerElement = node; |
InspectorTest.addResult("Test that shadow DOM breakpoints are persisted between page reloads."); |
- pane._setBreakpoint(outerElement, pane._breakpointTypes.SubtreeModified, true); |
- pane._saveBreakpoints(); |
+ WebInspector.domBreakpointManager.setBreakpoint(outerElement, WebInspector.DOMBreakpointsSidebarPane.BreakpointTypes.SubtreeModified, true); |
InspectorTest.addResult("Set 'Subtree Modified' DOM breakpoint on outerElement."); |
InspectorTest.reloadPage(step2); |
} |