Skip to content

Commit 6d6a82e

Browse files
TimvdLippeCommit Bot
authored andcommitted
Typecheck test/{perf,screenshots} with TypeScript
R=aerotwist@chromium.org Bug: 1011811 Change-Id: Id506046ab1c35c753e145c3be6158705a4f55488 Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2112559 Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org> Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
1 parent 18ab47b commit 6d6a82e

8 files changed

Lines changed: 68 additions & 2 deletions

File tree

‎test/BUILD.gn‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
group("test") {
66
deps = [
77
"e2e",
8+
"perf",
9+
"screenshots",
810
"shared",
911
"unittests/front_end",
1012
]

‎test/perf/BUILD.gn‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Copyright 2020 The Chromium Authors. All rights reserved.
2+
# Use of this source code is governed by a BSD-style license that can be
3+
# found in the LICENSE file.
4+
5+
import("../../third_party/typescript/typescript.gni")
6+
7+
ts_library("perf") {
8+
testonly = true
9+
sources = [ "test-list.ts" ]
10+
11+
deps = [
12+
"application",
13+
"helpers",
14+
]
15+
}

‎test/perf/application/BUILD.gn‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Copyright 2020 The Chromium Authors. All rights reserved.
2+
# Use of this source code is governed by a BSD-style license that can be
3+
# found in the LICENSE file.
4+
5+
import("../../../third_party/typescript/typescript.gni")
6+
7+
ts_library("application") {
8+
testonly = true
9+
sources = [ "boot-perf.ts" ]
10+
11+
deps = [
12+
"../../shared",
13+
"../helpers",
14+
]
15+
}

‎test/perf/application/boot-perf.ts‎

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

55
import {performance} from 'perf_hooks';
66
import {resetPages} from '../../shared/helper.js';
7-
import {storeGeneratedResults} from '../perf-helper.js';
7+
import {storeGeneratedResults} from '../helpers/perf-helper.js';
88

99
interface PerfTimings {
1010
[name: string]: number[]

‎test/perf/helpers/BUILD.gn‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Copyright 2020 The Chromium Authors. All rights reserved.
2+
# Use of this source code is governed by a BSD-style license that can be
3+
# found in the LICENSE file.
4+
5+
import("../../../third_party/typescript/typescript.gni")
6+
7+
ts_library("helpers") {
8+
testonly = true
9+
sources = [ "perf-helper.ts" ]
10+
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import * as fs from 'fs';
66
import {join} from 'path';
77

88
export const storeGeneratedResults = (file: string, content: string) => {
9-
const directory = join(__dirname, '../perf/.generated');
9+
const directory = join(__dirname, '..', '..', 'perf', '.generated');
1010
fs.mkdirSync(directory, {recursive: true});
1111

1212
const filePath = join(directory, file);

‎test/screenshots/BUILD.gn‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Copyright 2020 The Chromium Authors. All rights reserved.
2+
# Use of this source code is governed by a BSD-style license that can be
3+
# found in the LICENSE file.
4+
5+
import("../../third_party/typescript/typescript.gni")
6+
7+
ts_library("screenshots") {
8+
testonly = true
9+
sources = [ "test-list.ts" ]
10+
11+
deps = [ "hello-world" ]
12+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Copyright 2020 The Chromium Authors. All rights reserved.
2+
# Use of this source code is governed by a BSD-style license that can be
3+
# found in the LICENSE file.
4+
5+
import("../../../third_party/typescript/typescript.gni")
6+
7+
ts_library("hello-world") {
8+
testonly = true
9+
sources = [ "hello-world.ts" ]
10+
11+
deps = [ "../../shared" ]
12+
}

0 commit comments

Comments
 (0)