Commit a225a655 authored by Paul Lewis's avatar Paul Lewis Committed by Commit Bot

Removes user-metrics-perf.js layout test

This removes the user-metrics-perf.js layout test in preference to the
end-to-end test in the DevTools repo, created in this CL:
https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2084582

Bug: 1032561, 1046784
Change-Id: Iebe9baf872302579af89cea3542e343c9681a185
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2084557Reviewed-by: default avatarTim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
Cr-Commit-Position: refs/heads/master@{#746416}
parent 6bbab812
Tests list of user metrics performance codes and invocations.
recordPanelLoaded:
Performance mark: DevTools.Launch.Console
Performance histogram: DevTools.Launch.Console - positive duration?: true
Performance mark: DevTools.Launch.Elements
Performance histogram: DevTools.Launch.Elements - positive duration?: true
Performance mark: DevTools.Launch.Network
Performance histogram: DevTools.Launch.Network - positive duration?: true
Performance mark: DevTools.Launch.Sources
Performance histogram: DevTools.Launch.Sources - positive duration?: true
Test that loading the tool only triggers the marker:
Performance mark: DevTools.Launch.Console
Performance mark: DevTools.Launch.Elements
Performance mark: DevTools.Launch.Network
Performance mark: DevTools.Launch.Sources
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
(async function() {
TestRunner.addResult(`Tests list of user metrics performance codes and invocations.\n`);
const testHistogramRecording = (panel, histogram, expectHistogram, testExecutor) => {
let recordHistogramComplete;
performance.mark = function(name) {
TestRunner.addResult(`Performance mark: ${name}`);
if (!expectHistogram)
recordHistogramComplete();
};
InspectorFrontendHost.recordPerformanceHistogram = function(name, duration) {
TestRunner.addResult(`Performance histogram: ${name} - positive duration?: ${duration > 0}`);
recordHistogramComplete();
};
return new Promise((resolve, reject) => {
Host.userMetrics._firedLaunchHistogram = undefined;
Host.userMetrics.setLaunchPanel(panel);
testExecutor(panel, histogram);
recordHistogramComplete = resolve;
});
};
const testPanelLoaded = (panel, histogram) =>
testHistogramRecording(panel, histogram, true, Host.userMetrics.panelLoaded.bind(Host.userMetrics));
const testShowView = (panel, histogram) =>
testHistogramRecording(panel, histogram, false, UI.viewManager.showView.bind(UI.viewManager));
TestRunner.addResult('recordPanelLoaded:');
await testPanelLoaded('console', 'DevTools.Launch.Console');
await testPanelLoaded('elements', 'DevTools.Launch.Elements');
await testPanelLoaded('network', 'DevTools.Launch.Network');
await testPanelLoaded('sources', 'DevTools.Launch.Sources');
TestRunner.addResult('\nTest that loading the tool only triggers the marker:');
await testShowView('console', 'DevTools.Launch.Console');
await testShowView('elements', 'DevTools.Launch.Elements');
await testShowView('network', 'DevTools.Launch.Network');
await testShowView('sources', 'DevTools.Launch.Sources');
TestRunner.completeTest();
})();
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment