| OLD | NEW |
| 1 <html> | 1 <html> |
| 2 <head> | 2 <head> |
| 3 <script src="../../../http/tests/inspector/inspector-test.js"></script> | 3 <script src="../../../http/tests/inspector/inspector-test.js"></script> |
| 4 <script src="../../../http/tests/inspector/elements-test.js"></script> | 4 <script src="../../../http/tests/inspector/elements-test.js"></script> |
| 5 <script> | 5 <script> |
| 6 | 6 |
| 7 function testSetNewValue() | 7 function testSetNewValue() |
| 8 { | 8 { |
| 9 document.getElementById("node-set-new-value").style.setProperty("color", "bl
ue"); | 9 document.getElementById("node-set-new-value").style.setProperty("color", "bl
ue"); |
| 10 } | 10 } |
| 11 | 11 |
| 12 function testSetSameValue() | 12 function testSetSameValue() |
| 13 { | 13 { |
| 14 document.getElementById("node-set-same-value").style.setProperty("color", "r
ed"); | 14 document.getElementById("node-set-same-value").style.setProperty("color", "r
ed"); |
| 15 } | 15 } |
| 16 | 16 |
| 17 function test() | 17 function test() |
| 18 { | 18 { |
| 19 // Save time on style updates. | 19 // Save time on style updates. |
| 20 WebInspector.StylesSidebarPane.prototype.update = function() {}; | 20 Elements.StylesSidebarPane.prototype.update = function() {}; |
| 21 WebInspector.MetricsSidebarPane.prototype.update = function() {}; | 21 Elements.MetricsSidebarPane.prototype.update = function() {}; |
| 22 | 22 |
| 23 InspectorTest.runTestSuite([ | 23 InspectorTest.runTestSuite([ |
| 24 function testSetUp(next) | 24 function testSetUp(next) |
| 25 { | 25 { |
| 26 InspectorTest.expandElementsTree(next); | 26 InspectorTest.expandElementsTree(next); |
| 27 }, | 27 }, |
| 28 | 28 |
| 29 function testSetNewValue(next) | 29 function testSetNewValue(next) |
| 30 { | 30 { |
| 31 InspectorTest.evaluateInPage("testSetNewValue()"); | 31 InspectorTest.evaluateInPage("testSetNewValue()"); |
| 32 | 32 |
| 33 InspectorTest.domModel.addEventListener(WebInspector.DOMModel.Events
.AttrModified, listener); | 33 InspectorTest.domModel.addEventListener(SDK.DOMModel.Events.AttrModi
fied, listener); |
| 34 function listener(event) | 34 function listener(event) |
| 35 { | 35 { |
| 36 InspectorTest.addResult("WebInspector.DOMModel.Events.AttrModifi
ed should be issued"); | 36 InspectorTest.addResult("SDK.DOMModel.Events.AttrModified should
be issued"); |
| 37 InspectorTest.domModel.removeEventListener(WebInspector.DOMModel
.Events.AttrModified, listener); | 37 InspectorTest.domModel.removeEventListener(SDK.DOMModel.Events.A
ttrModified, listener); |
| 38 next(); | 38 next(); |
| 39 } | 39 } |
| 40 }, | 40 }, |
| 41 | 41 |
| 42 function testSetSameValue(next) | 42 function testSetSameValue(next) |
| 43 { | 43 { |
| 44 InspectorTest.evaluateInPage("testSetSameValue()", next); | 44 InspectorTest.evaluateInPage("testSetSameValue()", next); |
| 45 | 45 |
| 46 InspectorTest.domModel.addEventListener(WebInspector.DOMModel.Events
.AttrModified, listener); | 46 InspectorTest.domModel.addEventListener(SDK.DOMModel.Events.AttrModi
fied, listener); |
| 47 function listener(event) | 47 function listener(event) |
| 48 { | 48 { |
| 49 InspectorTest.addResult("WebInspector.DOMModel.Events.AttrModifi
ed should not be issued"); | 49 InspectorTest.addResult("SDK.DOMModel.Events.AttrModified should
not be issued"); |
| 50 InspectorTest.domModel.removeEventListener(WebInspector.DOMModel
.Events.AttrModified, listener); | 50 InspectorTest.domModel.removeEventListener(SDK.DOMModel.Events.A
ttrModified, listener); |
| 51 } | 51 } |
| 52 } | 52 } |
| 53 ]); | 53 ]); |
| 54 } | 54 } |
| 55 | 55 |
| 56 </script> | 56 </script> |
| 57 </head> | 57 </head> |
| 58 | 58 |
| 59 <body onload="runTest()"> | 59 <body onload="runTest()"> |
| 60 <p> | 60 <p> |
| 61 Tests that style modification generates attribute updated event only when attrib
ute is actually changed. | 61 Tests that style modification generates attribute updated event only when attrib
ute is actually changed. |
| 62 </p> | 62 </p> |
| 63 | 63 |
| 64 <div id="container"> | 64 <div id="container"> |
| 65 <div id="node-set-new-value" style="color:red"></div> | 65 <div id="node-set-new-value" style="color:red"></div> |
| 66 <div id="node-set-same-value" style="color:red"></div> | 66 <div id="node-set-same-value" style="color:red"></div> |
| 67 </div> | 67 </div> |
| 68 </body> | 68 </body> |
| 69 </html> | 69 </html> |
| OLD | NEW |