OLD | NEW |
(Empty) | |
| 1 <html> |
| 2 <head> |
| 3 <script src="../../http/tests/inspector/inspector-test.js"></script> |
| 4 <script src="resources/jquery-2.1.4.min.js"></script> |
| 5 <script> |
| 6 function test() |
| 7 { |
| 8 var divWithJQueryHandlers; |
| 9 |
| 10 InspectorTest.runTestSuite([ |
| 11 function testSetUp(next) |
| 12 { |
| 13 InspectorTest.RuntimeAgent.evaluate("document.getElementById(\"jquer
y-handlers\")", "get-event-listeners-test", step1); |
| 14 function step1(error, result, wasThrown) |
| 15 { |
| 16 divWithJQueryHandlers = InspectorTest.runtimeModel.createRemoteO
bject(result); |
| 17 next(); |
| 18 } |
| 19 }, |
| 20 |
| 21 function testDivJQueryNotResolvedEventListeners(next) |
| 22 { |
| 23 divWithJQueryHandlers.eventListeners(false).then(InspectorTest.dumpE
ventListeners.bind(this, next)); |
| 24 }, |
| 25 |
| 26 function testDivJQueryResolvedEventListeners(next) |
| 27 { |
| 28 divWithJQueryHandlers.eventListeners(true).then(InspectorTest.dumpEv
entListeners.bind(this, next)); |
| 29 } |
| 30 ]); |
| 31 } |
| 32 </script> |
| 33 </head> |
| 34 <body> |
| 35 <p> |
| 36 Tests RemoteObject.eventListeners resolving for jQuery 2.x. |
| 37 </p> |
| 38 <div id="jquery-handlers"></div> |
| 39 <script> |
| 40 var node = $("#jquery-handlers")[0]; |
| 41 $("#jquery-handlers").click(function(){ console.log("first jquery"); }); |
| 42 $("#jquery-handlers").click(function(){ console.log("second jquery"); }); |
| 43 node.addEventListener("click", function() { console.log("addEventListener");
}); |
| 44 node.onclick = function() { console.log("onclick"); }; |
| 45 runTest(); |
| 46 </script> |
| 47 </body> |
| 48 </html> |
OLD | NEW |