blob: 28c6f82e36d2719a36eaf67658f2131c6764f7c6 [file] [log] [blame]
<html>
<head>
<script src="../http/tests/inspector/inspector-test.js"></script>
<script>
function test()
{
InspectorFrontendHost.recordActionTaken = function(actionCode)
{
InspectorTest.addResult("Action taken: " + nameOf(WebInspector.UserMetrics._ActionCodes, actionCode));
}
InspectorFrontendHost.recordPanelShown = function(panelCode)
{
InspectorTest.addResult("Panel shown: " + nameOf(WebInspector.UserMetrics._PanelCodes, panelCode));
}
function nameOf(object, code)
{
for (var name in object) {
if (object[name] === code)
return name;
}
return null;
}
InspectorTest.addResult("recordActionTaken:");
InspectorTest.dump(WebInspector.UserMetrics._ActionCodes);
WebInspector.userMetrics.WindowDocked.record();
WebInspector.userMetrics.WindowUndocked.record();
InspectorTest.addResult("\nrecordPanelShown:");
InspectorTest.dump(WebInspector.UserMetrics._PanelCodes);
WebInspector.inspectorView.showPanel("profiles");
WebInspector.inspectorView.showPanel("timeline");
WebInspector.inspectorView.showPanel("audits");
InspectorTest.completeTest();
}
</script>
</head>
<body onload="runTest()">
<p>Tests list of user metrics codes and invocations.</p>
</body>
</html>