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

Unified Diff: content/browser/gamepad/gamepad_test_helpers.cc

Issue 362123002: Gamepad: don't notify about connected pads twice (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: more build fix (kNumberOfGamepads) Created 6 years, 6 months 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
Index: content/browser/gamepad/gamepad_test_helpers.cc
diff --git a/content/browser/gamepad/gamepad_test_helpers.cc b/content/browser/gamepad/gamepad_test_helpers.cc
index 8837c8e59c34c20f49b0cd6486732abdd7abe2c3..fc79dcb5ee67ebf1648ad5620122d00d9e34bc00 100644
--- a/content/browser/gamepad/gamepad_test_helpers.cc
+++ b/content/browser/gamepad/gamepad_test_helpers.cc
@@ -30,6 +30,15 @@ void MockGamepadDataFetcher::WaitForDataRead() {
return read_data_.Wait();
}
+void MockGamepadDataFetcher::WaitForDataReadAndCallbacksIssued() {
+ // The provider will read the data on the background thread (setting the
+ // event) and *then* will issue the callback on the client thread. Waiting for
+ // it to read twice is a simple way to ensure that it was able to issue
+ // callbacks for the first read (if it issued one).
+ WaitForDataRead();
+ WaitForDataRead();
+}
+
void MockGamepadDataFetcher::SetTestData(const blink::WebGamepads& new_data) {
base::AutoLock lock(lock_);
test_data_ = new_data;
« no previous file with comments | « content/browser/gamepad/gamepad_test_helpers.h ('k') | content/browser/renderer_host/pepper/pepper_gamepad_host_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698