Skip to content

Commit 8baf957

Browse files
danilsomsikovDevtools-frontend LUCI CQ
authored andcommitted
[test] Fix ve keydown test flakines
There was some state leaking through the keyboardLogThrottler Bug: 370020711 Change-Id: Icf0e23d51e1a88e699e67836ae2b604916e0607f Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/5938387 Reviewed-by: Alex Rudenko <[email protected]> Auto-Submit: Danil Somsikov <[email protected]> Commit-Queue: Alex Rudenko <[email protected]>
1 parent b98124f commit 8baf957

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

front_end/ui/visual_logging/LoggingDriver.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ export async function addDocument(document: Document): Promise<void> {
8383
}
8484

8585
export async function stopLogging(): Promise<void> {
86-
await keyboardLogThrottler.process?.();
86+
await keyboardLogThrottler.schedule(async () => {}, Common.Throttler.Scheduling.AS_SOON_AS_POSSIBLE);
8787
logging = false;
8888
unregisterAllLoggables();
8989
for (const document of documents) {

front_end/ui/visual_logging/LoggingEvents.test.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ describe('LoggingEvents', () => {
2424
throttler = new Common.Throttler.Throttler(1000000);
2525
});
2626

27+
afterEach(async () => {
28+
await throttler.schedule(async () => {}, Common.Throttler.Scheduling.AS_SOON_AS_POSSIBLE);
29+
});
30+
2731
async function assertThrottled(stub: sinon.SinonStub) {
2832
await new Promise(resolve => setTimeout(resolve, 0));
2933
assert.isFalse(stub.called);

0 commit comments

Comments
 (0)