blob: 55caa0cc46529d7bcf9dff90b2a4c075bb5f6cfd [file] [log] [blame]
<html>
<head>
<script src="../http/tests/inspector/inspector-test.js"></script>
<script src="../http/tests/inspector/timeline-test.js"></script>
<script src="profiler/profiler-test.js"></script>
<script src="audits/audits-test.js"></script>
<script>
function test()
{
InspectorFrontendHost.recordEnumeratedHistogram = function(name, code)
{
if (name === "DevTools.ActionTaken")
InspectorTest.addResult("Action taken: " + nameOf(WebInspector.UserMetrics.Action, code));
else if (name === "DevTools.PanelShown")
InspectorTest.addResult("Panel shown: " + nameOf(WebInspector.UserMetrics._PanelCodes, code));
}
function nameOf(object, code)
{
for (var name in object) {
if (object[name] === code)
return name;
}
return null;
}
InspectorTest.addResult("recordActionTaken:");
InspectorTest.dump(WebInspector.UserMetrics.Action);
WebInspector.userMetrics.actionTaken(WebInspector.UserMetrics.Action.WindowDocked);
WebInspector.userMetrics.actionTaken(WebInspector.UserMetrics.Action.WindowUndocked);
InspectorTest.addResult("\nrecordPanelShown:");
InspectorTest.dump(WebInspector.UserMetrics._PanelCodes);
WebInspector.viewManager.showView("profiles");
WebInspector.viewManager.showView("timeline");
WebInspector.viewManager.showView("audits");
InspectorTest.completeTest();
}
</script>
</head>
<body onload="runTest()">
<p>Tests list of user metrics codes and invocations.</p>
</body>
</html>