Skip to content

Commit

Permalink
[CrOS Network] Fix flaky tether dialog test.
Browse files Browse the repository at this point in the history
Fix flaky "Create tether network, first connection attempt shows tether
dialog" test by making test wait for dialog to be opened first. This fix
is speculative as the test flakiness could not be reproduced locally.

(cherry picked from commit d4c210d)

Fixed: b/263411073
Test: *InternetDetailPage*
Change-Id: I796f1e6af00701f850c147e5b1a5c2754b81a5a5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4128025
Auto-Submit: Gordon Seto <gordonseto@google.com>
Reviewed-by: Theo Johnson-kanu <tjohnsonkanu@google.com>
Commit-Queue: Gordon Seto <gordonseto@google.com>
Cr-Original-Commit-Position: refs/heads/main@{#1087453}
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4204949
Commit-Queue: Theo Johnson-kanu <tjohnsonkanu@google.com>
Cr-Commit-Position: refs/branch-heads/5481@{#809}
Cr-Branched-From: 130f3e4-refs/heads/main@{#1084008}
  • Loading branch information
Gordon Seto authored and Chromium LUCI CQ committed Jan 30, 2023
1 parent c260741 commit 67bc10c
Showing 1 changed file with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1525,8 +1525,18 @@ suite('InternetDetailPage', function() {
assertTrue(!!tetherDialog);
assertFalse(tetherDialog.$.dialog.open);

let showTetherDialogFinished;
const showTetherDialogPromise = new Promise((resolve) => {
showTetherDialogFinished = resolve;
});
const showTetherDialog = internetDetailPage.showTetherDialog_;
internetDetailPage.showTetherDialog_ = () => {
showTetherDialog.call(internetDetailPage);
showTetherDialogFinished();
};

connect.click();
await flushAsync();
await showTetherDialogPromise;
assertTrue(tetherDialog.$.dialog.open);
});

Expand Down

0 comments on commit 67bc10c

Please sign in to comment.