blob: f58bcd373591f49f93e0137d3e1c4f6b16404fc1 [file] [log] [blame]
// 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(`Verifies that text editor has focus after panel re-selecting.\n`);
await TestRunner.loadModule('sources_test_runner');
await TestRunner.showPanel('sources');
await TestRunner.addScriptTag('resources/script.js');
SourcesTestRunner.showScriptSource('script.js', onSourceFrame);
function onSourceFrame(sourceFrame) {
TestRunner.addResult('initial: focused = ' + sourceFrame.hasFocus());
UI.inspectorView.showPanel('elements')
.then(() => UI.inspectorView.showPanel('sources'))
.then(onPanelReselected.bind(null, sourceFrame));
}
function onPanelReselected(sourceFrame) {
TestRunner.addResult('after panel reselected: focused = ' + sourceFrame.hasFocus());
TestRunner.completeTest();
}
})();