blob: 44bbe71bffb3eb098fae8056903e601a40fd122e [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));
}
InspectorFrontendHost.recordSettingChanged = function(settingCode)
{
InspectorTest.addResult("Setting changed: " + nameOf(WebInspector.UserMetrics._SettingCodes, settingCode));
}
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.showPanel("profiles");
WebInspector.showPanel("timeline");
WebInspector.showPanel("audits");
InspectorTest.addResult("\nrecordSettingChanged:");
InspectorTest.dump(WebInspector.UserMetrics._SettingCodes);
WebInspector.settings.monitoringXHREnabled.set(true);
WebInspector.settings.monitoringXHREnabled.set(false);
WebInspector.settings.preserveConsoleLog.set(true);
WebInspector.settings.preserveConsoleLog.set(false);
WebInspector.settings.resourcesLargeRows.set(false);
WebInspector.settings.resourcesLargeRows.set(true);
InspectorTest.completeTest();
}
</script>
</head>
<body onload="runTest()">
<p>Tests list of user metrics codes and invocations.</p>
</body>
</html>