Skip to content

Commit 24b25cc

Browse files
Lightning00BladeDevtools-frontend LUCI CQ
authored andcommitted
[cleanup] Use import in test code
This should not be needed as I don't see anyone modifying the puppeteer properties. Bug: none Change-Id: Iac871d0070b7d2c7100d422fe530f7c15f413b6e Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/6298972 Auto-Submit: Nikolay Vitkov <[email protected]> Reviewed-by: Simon Zünd <[email protected]> Commit-Queue: Simon Zünd <[email protected]>
1 parent 99fcbd8 commit 24b25cc

File tree

5 files changed

+7
-25
lines changed

5 files changed

+7
-25
lines changed

test/conductor/events.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,8 @@
99

1010
/* eslint-disable no-console */
1111

12-
// use require here due to
13-
// https://github.com/evanw/esbuild/issues/587#issuecomment-901397213
14-
import puppeteer = require('puppeteer-core');
15-
16-
const path = require('path');
12+
import * as path from 'path';
13+
import type * as puppeteer from 'puppeteer-core';
1714

1815
const ALLOWED_ASSERTION_FAILURES = [
1916
// Failure during shutdown. crbug.com/1145969

test/conductor/frontend_tab.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@
44

55
import * as fs from 'fs';
66
import * as path from 'path';
7-
// use require here due to
8-
// https://github.com/evanw/esbuild/issues/587#issuecomment-901397213
9-
import puppeteer = require('puppeteer-core');
7+
import type * as puppeteer from 'puppeteer-core';
108

119
import {installPageErrorHandlers} from './events.js';
1210
import {BUILD_ROOT} from './paths.js';

test/conductor/hooks.ts

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,17 @@
44

55
/* eslint-disable no-console */
66

7-
// use require here due to
8-
// https://github.com/evanw/esbuild/issues/587#issuecomment-901397213
9-
import puppeteer = require('puppeteer-core');
7+
import * as puppeteer from 'puppeteer-core';
108

119
import {
1210
dumpCollectedErrors,
1311
installPageErrorHandlers,
1412
setupBrowserProcessIO,
1513
} from './events.js';
1614
import {
15+
type DevToolsFrontendReloadOptions,
1716
DevToolsFrontendTab,
1817
loadEmptyPageAndWaitForContent,
19-
type DevToolsFrontendReloadOptions,
2018
} from './frontend_tab.js';
2119
import {
2220
clearPuppeteerState,
@@ -28,13 +26,6 @@ import {
2826
import {TargetTab} from './target_tab.js';
2927
import {TestConfig} from './test_config.js';
3028

31-
// Workaround for mismatching versions of puppeteer types and puppeteer library.
32-
declare module 'puppeteer-core' {
33-
interface ConsoleMessage {
34-
stackTrace(): ConsoleMessageLocation[];
35-
}
36-
}
37-
3829
const viewportWidth = 1280;
3930
const viewportHeight = 720;
4031
// Adding some offset to the window size used in the headful mode

test/conductor/pool.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
44

5-
// use require here due to
6-
// https://github.com/evanw/esbuild/issues/587#issuecomment-901397213
7-
import puppeteer = require('puppeteer-core');
5+
import type * as puppeteer from 'puppeteer-core';
86

97
import {DevToolsFrontendTab} from './frontend_tab.js';
108
import {TargetTab} from './target_tab.js';

test/conductor/target_tab.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
44

5-
// use require here due to
6-
// https://github.com/evanw/esbuild/issues/587#issuecomment-901397213
7-
import puppeteer = require('puppeteer-core');
5+
import type * as puppeteer from 'puppeteer-core';
86

97
import {loadEmptyPageAndWaitForContent} from './frontend_tab.js';
108

0 commit comments

Comments
 (0)