22// Use of this source code is governed by a BSD-style license that can be
33// found in the LICENSE file.
44
5- import * as Root from '../../core/root/root.js' ;
65import {
76 describeWithEnvironment ,
87 registerNoopActions ,
@@ -21,12 +20,9 @@ describeWithEnvironment('TimelineHistoryManager', function() {
2120
2221 afterEach ( ( ) => {
2322 UI . ActionRegistry . ActionRegistry . reset ( ) ;
24- Root . Runtime . experiments . disableForTest ( Root . Runtime . ExperimentName . TIMELINE_OBSERVATIONS ) ;
25- historyManager . cancelIfShowing ( ) ;
2623 } ) ;
2724
28- it ( 'shows the dropdown including a landing page link if the observations experiment is enabled' , async function ( ) {
29- Root . Runtime . experiments . enableForTest ( Root . Runtime . ExperimentName . TIMELINE_OBSERVATIONS ) ;
25+ it ( 'shows the dropdown including a landing page link' , async function ( ) {
3026 const { parsedTrace, metadata} = await TraceLoader . traceEngine ( this , 'web-dev-with-commit.json.gz' ) ;
3127 historyManager . addRecording (
3228 {
@@ -57,76 +53,6 @@ describeWithEnvironment('TimelineHistoryManager', function() {
5753 await showPromise ;
5854 } ) ;
5955
60- it ( 'does not show if observations experiment is disabled + the user has not imported 2 traces' , async function ( ) {
61- const { parsedTrace, metadata} = await TraceLoader . traceEngine ( this , 'web-dev-with-commit.json.gz' ) ;
62- historyManager . addRecording (
63- {
64- data : {
65- parsedTraceIndex : 1 ,
66- type : 'TRACE_INDEX' ,
67- } ,
68- filmStripForPreview : null ,
69- parsedTrace,
70- metadata,
71- } ,
72- ) ;
73-
74- const promise = historyManager . showHistoryDropDown ( ) ;
75- const glassPane = document . querySelector ( 'div[data-devtools-glass-pane]' ) ;
76- assert . isNull ( glassPane ) ; // check that no DOM for the dropdown got created
77- // check the result of calling showHistoryDropDown which should be `null` if it didn't show
78- const result = await promise ;
79- assert . isNull ( result ) ;
80- } ) ;
81-
82- it ( 'does not show the landing page link if the observations experiment is disabled' , async function ( ) {
83- const { parsedTrace : parsedTrace1 , metadata : metadata1 } =
84- await TraceLoader . traceEngine ( this , 'web-dev-with-commit.json.gz' ) ;
85- historyManager . addRecording (
86- {
87- data : {
88- parsedTraceIndex : 1 ,
89- type : 'TRACE_INDEX' ,
90- } ,
91- filmStripForPreview : null ,
92- parsedTrace : parsedTrace1 ,
93- metadata : metadata1 ,
94- } ,
95- ) ;
96- const { parsedTrace : parsedTrace2 , metadata : metadata2 } =
97- await TraceLoader . traceEngine ( this , 'timings-track.json.gz' ) ;
98- historyManager . addRecording (
99- {
100- data : {
101- parsedTraceIndex : 2 ,
102- type : 'TRACE_INDEX' ,
103- } ,
104- filmStripForPreview : null ,
105- parsedTrace : parsedTrace2 ,
106- metadata : metadata2 ,
107- } ,
108- ) ;
109-
110- const showPromise = historyManager . showHistoryDropDown ( ) ;
111- const glassPane = document . querySelector ( 'div[data-devtools-glass-pane]' ) ;
112- const dropdown =
113- glassPane ?. shadowRoot ?. querySelector ( '.widget' ) ?. shadowRoot ?. querySelector < HTMLElement > ( '.drop-down' ) ;
114- assert . isOk ( dropdown ) ;
115-
116- const menuItemText = Array . from ( dropdown . querySelectorAll < HTMLDivElement > ( '[role="menuitem"]' ) , elem => {
117- return elem . innerText . replaceAll ( '\n' , '' ) ;
118- } ) ;
119- assert . deepEqual ( menuItemText , [
120- 'localhost' ,
121- 'web.dev1× slowdown, No throttling' ,
122- ] ) ;
123-
124- // Cancel the dropdown, which also resolves the show() promise, meaning we
125- // don't leak it into other tests.
126- historyManager . cancelIfShowing ( ) ;
127- await showPromise ;
128- } ) ;
129-
13056 it ( 'can select from multiple parsed data objects' , async function ( ) {
13157 // Add two parsed data objects to the history manager.
13258 const { parsedTrace : trace1Data , metadata : metadata1 } =
0 commit comments