blob: 7b2a7aa58b224a2a865214f02f4e6cded606f97b [file] [log] [blame]
// Copyright 2018 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 the Timeline events for GPUTask\n`);
await TestRunner.loadModule('performance_test_runner');
await TestRunner.showPanel('timeline');
await TestRunner.evaluateInPagePromise(`
async function performActions() {
const gl = document.createElement('canvas').getContext('webgl');
return gl.getParameter(gl.MAX_VIEWPORT_DIMS);
}
`);
await PerformanceTestRunner.invokeAsyncWithTimeline('performActions');
const tracingModel = PerformanceTestRunner.tracingModel();
const hasGPUTasks = tracingModel.sortedProcesses().some(p => p.sortedThreads().some(t => t.events().some(
event => event.name === TimelineModel.TimelineModel.RecordType.GPUTask)));
TestRunner.addResult(`Found GPUTask events: ${hasGPUTasks}`);
TestRunner.completeTest();
})();