function run() {
  utils.logDataStorageToConsole();
  window.uiState = new UIState();
  window.dataState = new DataState();

  // Initialize persistent states.
  const collator = new Intl.Collator(undefined, {
    numeric: true,  // Such that "1" < "2" < "10", "" < "1", "a:a" < "a1:a".
  });
  window.dataState.testIds =
      Array.from(dataStorage.testData.keys()).sort(collator.compare);
  if (window.sessionStorage.getItem('random_error')) {  // Demo error effects.
    console.warn(
        'some test results are set to error for demo with P=0.5; to undo: ' +
        'window.sessionStorage.removeItem(\'random_error\') and refresh.');
    window.dataState.testIds.forEach((testId) => {
      const testInfo = dataStorage.testData.get(testId);
      if (testInfo.ok && Math.random() <= 0.5) {
        // @ts-expect-error: testInfo.ok is read-only.
        testInfo.ok = false;
        // @ts-expect-error: testInfo.taskErrorCount is read-only.
        testInfo.taskErrorCount += 1;
        // @ts-expect-error: dataStorage.testErrorCount is read-only.
        dataStorage.testErrorCount += 1;
      }
    });
  }
  window.uiState.allOk = dataStorage.testErrorCount === 0;

  // Page header, status bar, sub status bar.
  configureColorModeControlButtonEvent();
  configureAlternativeSortingButtonEvent(window.uiState);
  configureExplorerViewControlEvents(window.uiState, window.dataState);

  // Build initial page.
  setTrivialTextSlots(dataStorage);
  setStatusBar(
      window.uiState.allOk, dataStorage.masterLogModificationTime,
      dataStorage.wholeTime);
  setTestExecBreadcrumbsAndCopyButton(
      dataStorage.testExecPathComponents, dataStorage.testExecPath,
      /*breadcrumbViewPathSeparator=*/ '〉');
  buildExplorerAndIconsView(window.uiState, window.dataState);
}
/**
 * The starting point, called in an index.html script tag.
 */
The starting point, called in an index.html script tag.
The starting point called in an index . html script tag .
function run() {
  utils.logDataStorageToConsole();
  window.uiState = new UIState();
  window.dataState = new DataState();
  const collator = new Intl.Collator(undefined, {
    numeric: true,  
  });
  window.dataState.testIds =
      Array.from(dataStorage.testData.keys()).sort(collator.compare);
  if (window.sessionStorage.getItem('random_error')) {  
    console.warn(
        'some test results are set to error for demo with P=0.5; to undo: ' +
        'window.sessionStorage.removeItem(\'random_error\') and refresh.');
    window.dataState.testIds.forEach((testId) => {
      const testInfo = dataStorage.testData.get(testId);
      if (testInfo.ok && Math.random() <= 0.5) {
        testInfo.ok = false;
        testInfo.taskErrorCount += 1;
        dataStorage.testErrorCount += 1;
      }
    });
  }
  window.uiState.allOk = dataStorage.testErrorCount === 0;
  configureColorModeControlButtonEvent();
  configureAlternativeSortingButtonEvent(window.uiState);
  configureExplorerViewControlEvents(window.uiState, window.dataState);
  setTrivialTextSlots(dataStorage);
  setStatusBar(
      window.uiState.allOk, dataStorage.masterLogModificationTime,
      dataStorage.wholeTime);
  setTestExecBreadcrumbsAndCopyButton(
      dataStorage.testExecPathComponents, dataStorage.testExecPath,
       '〉');
  buildExplorerAndIconsView(window.uiState, window.dataState);
}
function run ( ) { utils . logDataStorageToConsole ( ) ; window . uiState = new UIState ( ) ; window . dataState = new DataState ( ) ; const collator = new Intl . Collator ( undefined , { numeric : true , } ) ; window . dataState . testIds = Array . from ( dataStorage . testData . keys ( ) ) . sort ( collator . compare ) ; if ( window . sessionStorage . getItem ( 'random_error' ) ) { console . warn ( 'some test results are set to error for demo with P=0.5; to undo: ' + 'window.sessionStorage.removeItem(\'random_error\') and refresh.' ) ; window . dataState . testIds . forEach ( ( testId ) => { const testInfo = dataStorage . testData . get ( testId ) ; if ( testInfo . ok && Math . random ( ) <= 0.5 ) { testInfo . ok = false ; testInfo . taskErrorCount += 1 ; dataStorage . testErrorCount += 1 ; } } ) ; } window . uiState . allOk = dataStorage . testErrorCount === 0 ; configureColorModeControlButtonEvent ( ) ; configureAlternativeSortingButtonEvent ( window . uiState ) ; configureExplorerViewControlEvents ( window . uiState , window . dataState ) ; setTrivialTextSlots ( dataStorage ) ; setStatusBar ( window . uiState . allOk , dataStorage . masterLogModificationTime , dataStorage . wholeTime ) ; setTestExecBreadcrumbsAndCopyButton ( dataStorage . testExecPathComponents , dataStorage . testExecPath , '〉'); buildExplorerAndIconsView ( window . uiState , window . dataState ) ; }
The starting point, called in an index.html script tag.
The starting point called in an index . html script tag .
// Initialize persistent states. // Such that "1" < "2" < "10", "" < "1", "a:a" < "a1:a". // Demo error effects. // @ts-expect-error: testInfo.ok is read-only. // @ts-expect-error: testInfo.taskErrorCount is read-only. // @ts-expect-error: dataStorage.testErrorCount is read-only. // Page header, status bar, sub status bar. // Build initial page. /*breadcrumbViewPathSeparator=*/