| OLD | NEW |
| 1 <html> | 1 <html> |
| 2 <head> | 2 <head> |
| 3 <script type="text/javascript" src="../../http/tests/inspector-protocol/inspecto
r-protocol-test.js"></script> | 3 <script type="text/javascript" src="../../http/tests/inspector-protocol/inspecto
r-protocol-test.js"></script> |
| 4 <script> | 4 <script> |
| 5 | 5 |
| 6 function testFunction() | 6 function testFunction() |
| 7 { | 7 { |
| 8 var div = document.querySelector("#my-div"); | 8 var div = document.querySelector("#my-div"); |
| 9 div.addEventListener("click", function(e) { }, false); | 9 div.addEventListener("click", function(e) { }, false); |
| 10 div.click(); | 10 div.click(); |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 return e.cat === "disabled-by-default-devtools.timeline"; | 39 return e.cat === "disabled-by-default-devtools.timeline"; |
| 40 })); | 40 })); |
| 41 } | 41 } |
| 42 | 42 |
| 43 function tracingComplete(event) | 43 function tracingComplete(event) |
| 44 { | 44 { |
| 45 InspectorTest.log("Tracing complete"); | 45 InspectorTest.log("Tracing complete"); |
| 46 | 46 |
| 47 function windowEventFilter(type, e) | 47 function windowEventFilter(type, e) |
| 48 { | 48 { |
| 49 return e.name === "EventDispatch" && e.args.type === type; | 49 return e.name === "EventDispatch" && e.args.data.type === type; |
| 50 }; | 50 }; |
| 51 | 51 |
| 52 var windowEventNames = [ "click", "beforeunload", "unload", "load" ]; | 52 var windowEventNames = [ "click", "beforeunload", "unload", "load" ]; |
| 53 for (var i = 0; i < windowEventNames.length; i++) { | 53 for (var i = 0; i < windowEventNames.length; i++) { |
| 54 var eventName = windowEventNames[i]; | 54 var eventName = windowEventNames[i]; |
| 55 var events = devtoolsEvents.filter(windowEventFilter.bind(this, even
tName)); | 55 var events = devtoolsEvents.filter(windowEventFilter.bind(this, even
tName)); |
| 56 if (events.length >= 1) { | 56 if (events.length >= 1) { |
| 57 InspectorTest.log("SUCCESS: found " + eventName + " event"); | 57 InspectorTest.log("SUCCESS: found " + eventName + " event"); |
| 58 } else { | 58 } else { |
| 59 fail(eventName + " event is missing"); | 59 fail(eventName + " event is missing"); |
| 60 } | 60 } |
| 61 } | 61 } |
| 62 | 62 |
| 63 InspectorTest.completeTest(); | 63 InspectorTest.completeTest(); |
| 64 } | 64 } |
| 65 | 65 |
| 66 | 66 |
| 67 function fail(message) | 67 function fail(message) |
| 68 { | 68 { |
| 69 var formattedEvents = devtoolsEvents.map(function(e) | 69 var formattedEvents = devtoolsEvents.map(function(e) |
| 70 { | 70 { |
| 71 return e.name + "(" + e.args.type + ")"; | 71 return e.name + "(" + e.args.data.type + ")"; |
| 72 }); | 72 }); |
| 73 InspectorTest.log("FAIL: " + message + " devtools.timeline events: " + J
SON.stringify(formattedEvents, null, 2)); | 73 InspectorTest.log("FAIL: " + message + " devtools.timeline events: " + J
SON.stringify(formattedEvents, null, 2)); |
| 74 } | 74 } |
| 75 | 75 |
| 76 function onStop(response) | 76 function onStop(response) |
| 77 { | 77 { |
| 78 InspectorTest.log("Recording stopped"); | 78 InspectorTest.log("Recording stopped"); |
| 79 } | 79 } |
| 80 } | 80 } |
| 81 </script> | 81 </script> |
| 82 </head> | 82 </head> |
| 83 <body onLoad="runTest();"> | 83 <body onLoad="runTest();"> |
| 84 <div id="my-div"></div> | 84 <div id="my-div"></div> |
| 85 </body> | 85 </body> |
| 86 </html> | 86 </html> |
| OLD | NEW |