Upstream version 5.34.98.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / LayoutTests / inspector / debugger / dom-breakpoints-editing-dom-from-inspector.html
1 <html>
2 <head>
3 <script src="../../http/tests/inspector/inspector-test.js"></script>
4 <script src="../../http/tests/inspector/elements-test.js"></script>
5 <script src="../../http/tests/inspector/debugger-test.js"></script>
6 <script>
7
8 function test()
9 {
10     WebInspector.showPanel("elements");
11
12     var pane = WebInspector.domBreakpointsSidebarPane;
13     InspectorTest.runDebuggerTestSuite([
14         function testRemoveNode(next)
15         {
16             InspectorTest.addResult("Testing NodeRemoved DOM breakpoint.");
17             InspectorTest.nodeWithId("elementToRemove", step2);
18
19             function step2(node)
20             {
21                 pane._setBreakpoint(node, pane._breakpointTypes.NodeRemoved, true);
22                 InspectorTest.addResult("Set NodeRemoved DOM breakpoint.");
23                 node.removeNode(next);
24             }
25         },
26
27         function testModifyAttribute(next)
28         {
29             InspectorTest.addResult("Testing AttributeModified DOM breakpoint.");
30             InspectorTest.nodeWithId("rootElement", step2);
31
32             function step2(node)
33             {
34                 pane._setBreakpoint(node, pane._breakpointTypes.AttributeModified, true);
35                 InspectorTest.addResult("Set AttributeModified DOM breakpoint.");
36                 node.setAttribute("title", "a title", next);
37             }
38         }
39     ]);
40 }
41
42 </script>
43 </head>
44
45 <body onload="runTest()">
46 <p>
47 Tests that DOM debugger will not crash when editing DOM nodes from the Web Inspector. <a href="https://code.google.com/p/chromium/issues/detail?id=249655">Chromium bug 249655</a>
48 </p>
49
50 <div id="rootElement" style="color: red">
51 <div id="elementToRemove"></div>
52 </div>
53
54 </body>
55 </html>