Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(58)

Unified Diff: third_party/WebKit/LayoutTests/inspector/sources/debugger-breakpoints/dom-breakpoints.html

Issue 2255983002: DevTools: refactor and fix bugs for DOMBreakpointsSidebarPane (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address CL feedback Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..35ce88ee4b01c0c1658b45d15786d883e10f6086 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
@@ -95,7 +95,7 @@ function test()
function step2(node)
{
rootElement = node;
- pane._setBreakpoint(node, pane._breakpointTypes.SubtreeModified, true);
+ WebInspector.domBreakpointManager.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 +103,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.");
+ WebInspector.domBreakpointManager.setBreakpoint(node, pane._breakpointTypes.AttributeModified, true);
+ var elementId = pane._createBreakpointId(node.id, pane._breakpointTypes.AttributeModified);
+ element = pane._breakpointElements.get(elementId);
+ InspectorTest.addResult("Uncheck 'Attribute Modified' DOM breakpoint on rootElement.");
+ element._checkboxElement.click();
+ InspectorTest.addResult("Modify attribute for rootElement.");
+ InspectorTest.evaluateInPagePromise("modifyAttribute('rootElement', 'data-test-breakpoint-disabled', 'foo')").then(step3);
+ }
+
+ 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 +168,7 @@ function test()
function step3(frames)
{
InspectorTest.captureStackTrace(frames);
- pane._removeBreakpoint(rootElement, pane._breakpointTypes.SubtreeModified);
+ WebInspector.domBreakpointManager.removeBreakpoint(rootElement, pane._breakpointTypes.SubtreeModified);
InspectorTest.resumeExecution(next);
}
},
@@ -144,7 +176,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, 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 +184,22 @@ function test()
function step2(callFrames)
{
- pane._removeBreakpoint(rootElement, pane._breakpointTypes.AttributeModified);
- next();
+ WebInspector.domBreakpointManager.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);
+ WebInspector.domBreakpointManager.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 +207,7 @@ function test()
function step2(callFrames)
{
- pane._removeBreakpoint(rootElement, pane._breakpointTypes.AttributeModified);
+ WebInspector.domBreakpointManager.removeBreakpoint(rootElement, pane._breakpointTypes.AttributeModified);
next();
}
},
@@ -176,7 +215,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, 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 +223,7 @@ function test()
function step2(callFrames)
{
- pane._removeBreakpoint(rootElement, pane._breakpointTypes.AttributeModified);
+ WebInspector.domBreakpointManager.removeBreakpoint(rootElement, pane._breakpointTypes.AttributeModified);
next();
}
},
@@ -192,7 +231,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, 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 +239,7 @@ function test()
function step2(callFrames)
{
- pane._removeBreakpoint(rootElement, pane._breakpointTypes.AttributeModified);
+ WebInspector.domBreakpointManager.removeBreakpoint(rootElement, pane._breakpointTypes.AttributeModified);
next();
}
},
@@ -212,7 +251,7 @@ function test()
function step2(node)
{
- pane._setBreakpoint(node, pane._breakpointTypes.NodeRemoved, true);
+ WebInspector.domBreakpointManager.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 +266,7 @@ function test()
function step2(node)
{
- pane._setBreakpoint(node, pane._breakpointTypes.SubtreeModified, true);
- pane._saveBreakpoints();
+ WebInspector.domBreakpointManager.setBreakpoint(node, pane._breakpointTypes.SubtreeModified, true);
InspectorTest.addResult("Set 'Subtree Modified' DOM breakpoint on rootElement.");
InspectorTest.reloadPage(step3);
}
@@ -254,7 +292,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, 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 +309,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, pane._breakpointTypes.SubtreeModified, true);
InspectorTest.addResult("Set 'Subtree Modified' DOM breakpoint on outerElement.");
InspectorTest.reloadPage(step2);
}

Powered by Google App Engine
This is Rietveld 408576698