Skip to content

Commit 8647b46

Browse files
committed
types
Change-Id: I8aacc3dd26acedfd27053802413ab806c6f05bf7
1 parent bbbb453 commit 8647b46

File tree

3 files changed

+10
-9
lines changed

3 files changed

+10
-9
lines changed

docs/tool-reference.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -301,16 +301,15 @@ so returned values have to JSON-serializable.
301301

302302
- **args** (array) _(optional)_: An optional list of arguments to pass to the function.
303303
- **function** (string) **(required)**: A JavaScript function declaration to be executed by the tool in the currently selected page.
304-
Example without arguments: `() => {
304+
Example without arguments: `() => {
305305
return document.title
306306
}` or `async () => {
307307
return await fetch("example.com")
308308
}`.
309-
Example with arguments: `(el) => {
309+
Example with arguments: `(el) => {
310310
return el.innerText;
311311
}`
312312

313-
314313
---
315314

316315
### `get_console_message`

src/tools/performance.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,8 @@ async function stopTracingAndAppendOutput(
186186
}
187187
}
188188

189+
// This key is expected to be visible.
190+
// b/349721878
189191
const CRUX_API_KEY = 'AIzaSyCCSOx25vrb5z0tbedCB3_JRzzbVW6Uwgw';
190192
const CRUX_ENDPOINT = `https://chromeuxreport.googleapis.com/v1/records:queryRecord?key=${CRUX_API_KEY}`;
191193

tests/tools/performance.test.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ import {describe, it, afterEach} from 'node:test';
88

99
import sinon from 'sinon';
1010

11-
import type {Context} from '../../src/tools/ToolDefinition.js';
1211
import {
1312
analyzeInsight,
1413
queryChromeUXReport,
1514
startTrace,
1615
stopTrace,
1716
} from '../../src/tools/performance.js';
17+
import type {Context} from '../../src/tools/ToolDefinition.js';
1818
import type {TraceResult} from '../../src/trace-processing/parse.js';
1919
import {
2020
parseRawTraceBuffer,
@@ -289,7 +289,7 @@ describe('performance', () => {
289289
await queryChromeUXReport.handler(
290290
{params: {origin: 'https://example.com'}},
291291
response,
292-
{} as any,
292+
{} as Context,
293293
);
294294

295295
assert.ok(fetchStub.calledOnce);
@@ -313,7 +313,7 @@ describe('performance', () => {
313313
await queryChromeUXReport.handler(
314314
{params: {url: 'https://example.com'}},
315315
response,
316-
{} as any,
316+
{} as Context,
317317
);
318318

319319
assert.ok(fetchStub.calledOnce);
@@ -334,7 +334,7 @@ describe('performance', () => {
334334
},
335335
},
336336
response,
337-
{} as any,
337+
{} as Context,
338338
);
339339

340340
assert.ok(
@@ -350,7 +350,7 @@ describe('performance', () => {
350350
await queryChromeUXReport.handler(
351351
{params: {}},
352352
response,
353-
{} as any,
353+
{} as Context,
354354
);
355355

356356
assert.ok(
@@ -370,7 +370,7 @@ describe('performance', () => {
370370
await queryChromeUXReport.handler(
371371
{params: {origin: 'https://example.com'}},
372372
response,
373-
{} as any,
373+
{} as Context,
374374
);
375375

376376
assert.ok(fetchStub.calledOnce);

0 commit comments

Comments
 (0)