| 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/timeline-test.js"></script> | 4 <script src="../http/tests/inspector/timeline-test.js"></script> |
| 5 <script src="profiler/profiler-test.js"></script> | 5 <script src="profiler/profiler-test.js"></script> |
| 6 <script src="audits/audits-test.js"></script> | 6 <script src="audits/audits-test.js"></script> |
| 7 <script> | 7 <script> |
| 8 | 8 |
| 9 function test() | 9 function test() |
| 10 { | 10 { |
| 11 InspectorFrontendHost.recordEnumeratedHistogram = function(name, code) | 11 InspectorFrontendHost.recordEnumeratedHistogram = function(name, code) |
| 12 { | 12 { |
| 13 if (name === "DevTools.ActionTaken") | 13 if (name === "DevTools.ActionTaken") |
| 14 InspectorTest.addResult("Action taken: " + nameOf(WebInspector.UserM
etrics.Action, code)); | 14 InspectorTest.addResult("Action taken: " + nameOf(Host.UserMetrics.A
ction, code)); |
| 15 else if (name === "DevTools.PanelShown") | 15 else if (name === "DevTools.PanelShown") |
| 16 InspectorTest.addResult("Panel shown: " + nameOf(WebInspector.UserMe
trics._PanelCodes, code)); | 16 InspectorTest.addResult("Panel shown: " + nameOf(Host.UserMetrics._P
anelCodes, code)); |
| 17 } | 17 } |
| 18 | 18 |
| 19 function nameOf(object, code) | 19 function nameOf(object, code) |
| 20 { | 20 { |
| 21 for (var name in object) { | 21 for (var name in object) { |
| 22 if (object[name] === code) | 22 if (object[name] === code) |
| 23 return name; | 23 return name; |
| 24 } | 24 } |
| 25 return null; | 25 return null; |
| 26 } | 26 } |
| 27 | 27 |
| 28 InspectorTest.addResult("recordActionTaken:"); | 28 InspectorTest.addResult("recordActionTaken:"); |
| 29 InspectorTest.dump(WebInspector.UserMetrics.Action); | 29 InspectorTest.dump(Host.UserMetrics.Action); |
| 30 WebInspector.userMetrics.actionTaken(WebInspector.UserMetrics.Action.WindowD
ocked); | 30 Host.userMetrics.actionTaken(Host.UserMetrics.Action.WindowDocked); |
| 31 WebInspector.userMetrics.actionTaken(WebInspector.UserMetrics.Action.WindowU
ndocked); | 31 Host.userMetrics.actionTaken(Host.UserMetrics.Action.WindowUndocked); |
| 32 | 32 |
| 33 InspectorTest.addResult("\nrecordPanelShown:"); | 33 InspectorTest.addResult("\nrecordPanelShown:"); |
| 34 InspectorTest.dump(WebInspector.UserMetrics._PanelCodes); | 34 InspectorTest.dump(Host.UserMetrics._PanelCodes); |
| 35 WebInspector.viewManager.showView("profiles"); | 35 UI.viewManager.showView("profiles"); |
| 36 WebInspector.viewManager.showView("timeline"); | 36 UI.viewManager.showView("timeline"); |
| 37 WebInspector.viewManager.showView("audits"); | 37 UI.viewManager.showView("audits"); |
| 38 | 38 |
| 39 InspectorTest.completeTest(); | 39 InspectorTest.completeTest(); |
| 40 } | 40 } |
| 41 | 41 |
| 42 </script> | 42 </script> |
| 43 </head> | 43 </head> |
| 44 | 44 |
| 45 <body onload="runTest()"> | 45 <body onload="runTest()"> |
| 46 <p>Tests list of user metrics codes and invocations.</p> | 46 <p>Tests list of user metrics codes and invocations.</p> |
| 47 | 47 |
| 48 </body> | 48 </body> |
| 49 </html> | 49 </html> |
| OLD | NEW |