Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4773)

Unified Diff: chrome/test/data/extensions/api_test/braille_display_private/write_dots/test.js

Issue 56533004: Fix flaky brailleDisplayPrivateApi tests and reenable them. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/test/data/extensions/api_test/braille_display_private/key_events/test.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/data/extensions/api_test/braille_display_private/write_dots/test.js
diff --git a/chrome/test/data/extensions/api_test/braille_display_private/write_dots/test.js b/chrome/test/data/extensions/api_test/braille_display_private/write_dots/test.js
index 7f0d5a2a3b5676331ec2234ec9e3b85b2a457ad2..7254cf4810c2618a2245f69f30f97736b8a96d89 100644
--- a/chrome/test/data/extensions/api_test/braille_display_private/write_dots/test.js
+++ b/chrome/test/data/extensions/api_test/braille_display_private/write_dots/test.js
@@ -18,12 +18,18 @@ function createBuffer(size, element) {
function waitForDisplay(callback) {
var callbackCompleted = chrome.test.callbackAdded();
var displayStateHandler = function(state) {
+ if (!callbackCompleted) {
+ return;
+ }
chrome.test.assertTrue(state.available, "Display not available");
chrome.test.assertEq(11, state.textCellCount);
callback(state);
callbackCompleted();
chrome.brailleDisplayPrivate.onDisplayStateChanged.removeListener(
displayStateHandler);
+ // Prevent additional runs if the onDisplayStateChanged event
+ // is fired before getDisplayState invokes the callback.
+ callbackCompleted = null;
};
chrome.brailleDisplayPrivate.onDisplayStateChanged.addListener(
displayStateHandler);
« no previous file with comments | « chrome/test/data/extensions/api_test/braille_display_private/key_events/test.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698