1
    2
    3
    4
    5
    6
    7
    8
    9
   10
   11
   12
   13
   14
   15
   16
   17
   18
   19
   20
   21
   22
   23
   24
   25
   26
   27
   28
   29
   30
   31
   32
   33
   34
   35
   36
   37
   38
   39
   40
   41
   42
   43
   44
   45
   46
   47
   48
   49
   50
   51
   52
   53
   54
   55
   56
   57
   58
   59
   60
   61
   62

ash / webui / media_app_ui / test / driver_api.ts [blame]

// Copyright 2023 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

/**
 * Reply to test messages. Contents depend on the test message sent.
 */
export interface TestMessageResponseData {
  testQueryResult: string;
  testQueryResultData?: any;
}

/**
 * Object sent over postMessage to run a command or extract data.
 */
export interface TestMessageQueryData {
  deleteLastFile?: boolean;
  getFileErrors?: boolean;
  navigate?: {direction?: string, token?: number};
  openFile?: boolean;
  overwriteLastFile?: string;
  rethrow?: boolean;
  pathToRoot?: string[];
  property?: string;
  renameLastFile?: string;
  requestFullscreen?: boolean;
  requestSaveFile?: boolean;
  saveAs?: string;
  simple?: string;
  simpleArgs?: any;
  suppressCrashReports?: boolean;
  testQuery: string;
}

export interface TestMessageRunTestCase {
  testCase: string;
}

/**
 * Subset of mediaApp.AbstractFile that can be serialized. The fields
 * `hasDelete` and `hasRename` indicate whether the methods are defined.
 */
export interface FileSnapshot {
  blob: Blob;
  name: string;
  size: number;
  mimeType: string;
  fromClipboard?: boolean;
  error?: string;
  token?: number;
  lastModified: number;
  hasDelete: boolean;
  hasRename: boolean;
}

/**
 * Return type of `get-last-loaded-files` used to spy on the files sent to the
 * guest app using `loadFiles()`.
 */
export interface LastLoadedFilesResponse {
  fileList: FileSnapshot[];
}