| 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..bb86f99d8e973d139162b96b7709d5faa769060f 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
|
| @@ -83,6 +83,7 @@ function test()
|
| {
|
|
|
| var pane = WebInspector.domBreakpointsSidebarPane;
|
| + var domDebuggerModel = WebInspector.domBreakpointsSidebarPane.domDebuggerModel();
|
| var rootElement;
|
| var outerElement;
|
| var authorShadowRoot;
|
| @@ -95,7 +96,7 @@ function test()
|
| function step2(node)
|
| {
|
| rootElement = node;
|
| - pane._setBreakpoint(node, pane._breakpointTypes.SubtreeModified, true);
|
| + domDebuggerModel.setBreakpoint(node, pane._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 +104,38 @@ 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.");
|
| + domDebuggerModel.setBreakpoint(node, pane._breakpointTypes.AttributeModified, true);
|
| + var elementId = domDebuggerModel.createBreakpointId(node.id, pane._breakpointTypes.AttributeModified);
|
| + element = pane._breakpointElements[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 +169,7 @@ function test()
|
| function step3(frames)
|
| {
|
| InspectorTest.captureStackTrace(frames);
|
| - pane._removeBreakpoint(rootElement, pane._breakpointTypes.SubtreeModified);
|
| + domDebuggerModel.removeBreakpoint(rootElement, pane._breakpointTypes.SubtreeModified);
|
| InspectorTest.resumeExecution(next);
|
| }
|
| },
|
| @@ -144,7 +177,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);
|
| + domDebuggerModel.setBreakpoint(rootElement, pane._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 +185,22 @@ function test()
|
|
|
| function step2(callFrames)
|
| {
|
| - pane._removeBreakpoint(rootElement, pane._breakpointTypes.AttributeModified);
|
| - next();
|
| + domDebuggerModel.removeBreakpoint(rootElement, pane._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);
|
| + domDebuggerModel.setBreakpoint(rootElement, pane._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 +208,7 @@ function test()
|
|
|
| function step2(callFrames)
|
| {
|
| - pane._removeBreakpoint(rootElement, pane._breakpointTypes.AttributeModified);
|
| + domDebuggerModel.removeBreakpoint(rootElement, pane._breakpointTypes.AttributeModified);
|
| next();
|
| }
|
| },
|
| @@ -176,7 +216,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);
|
| + domDebuggerModel.setBreakpoint(rootElement, pane._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 +224,7 @@ function test()
|
|
|
| function step2(callFrames)
|
| {
|
| - pane._removeBreakpoint(rootElement, pane._breakpointTypes.AttributeModified);
|
| + domDebuggerModel.removeBreakpoint(rootElement, pane._breakpointTypes.AttributeModified);
|
| next();
|
| }
|
| },
|
| @@ -192,7 +232,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);
|
| + domDebuggerModel.setBreakpoint(rootElement, pane._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 +240,7 @@ function test()
|
|
|
| function step2(callFrames)
|
| {
|
| - pane._removeBreakpoint(rootElement, pane._breakpointTypes.AttributeModified);
|
| + domDebuggerModel.removeBreakpoint(rootElement, pane._breakpointTypes.AttributeModified);
|
| next();
|
| }
|
| },
|
| @@ -212,7 +252,7 @@ function test()
|
|
|
| function step2(node)
|
| {
|
| - pane._setBreakpoint(node, pane._breakpointTypes.NodeRemoved, true);
|
| + domDebuggerModel.setBreakpoint(node, pane._breakpointTypes.NodeRemoved, true);
|
| InspectorTest.addResult("Set 'Node Removed' DOM breakpoint on elementToRemove.");
|
| InspectorTest.evaluateInPageWithTimeout("removeElement('elementToRemove')");
|
| InspectorTest.addResult("Remove elementToRemove.");
|
| @@ -227,8 +267,7 @@ function test()
|
|
|
| function step2(node)
|
| {
|
| - pane._setBreakpoint(node, pane._breakpointTypes.SubtreeModified, true);
|
| - pane._saveBreakpoints();
|
| + domDebuggerModel.setBreakpoint(node, pane._breakpointTypes.SubtreeModified, true);
|
| InspectorTest.addResult("Set 'Subtree Modified' DOM breakpoint on rootElement.");
|
| InspectorTest.reloadPage(step3);
|
| }
|
| @@ -254,7 +293,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);
|
| + domDebuggerModel.setBreakpoint(authorShadowRoot, pane._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 +310,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();
|
| + domDebuggerModel.setBreakpoint(outerElement, pane._breakpointTypes.SubtreeModified, true);
|
| InspectorTest.addResult("Set 'Subtree Modified' DOM breakpoint on outerElement.");
|
| InspectorTest.reloadPage(step2);
|
| }
|
|
|