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

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

Issue 165983005: Updating Gamepad API to match latest spec (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed typo in GamepadProviderTest Created 6 years, 10 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_provider_unittest.cc
diff --git a/content/browser/gamepad/gamepad_provider_unittest.cc b/content/browser/gamepad/gamepad_provider_unittest.cc
index 398edca98e48bacc4936413b40eaaf23e48aca12..adfef0c5bf3d2ed749050f155b0c1655c4059661 100644
--- a/content/browser/gamepad/gamepad_provider_unittest.cc
+++ b/content/browser/gamepad/gamepad_provider_unittest.cc
@@ -71,7 +71,8 @@ TEST_F(GamepadProviderTest, PollingAccess) {
test_data.items[0].timestamp = 0;
test_data.items[0].buttonsLength = 1;
test_data.items[0].axesLength = 2;
- test_data.items[0].buttons[0] = 1.f;
+ test_data.items[0].buttons[0].value = 1.f;
+ test_data.items[0].buttons[0].pressed = true;
test_data.items[0].axes[0] = -1.f;
test_data.items[0].axes[1] = .5f;
@@ -102,7 +103,8 @@ TEST_F(GamepadProviderTest, PollingAccess) {
EXPECT_EQ(1u, output.length);
EXPECT_EQ(1u, output.items[0].buttonsLength);
- EXPECT_EQ(1.f, output.items[0].buttons[0]);
+ EXPECT_EQ(1.f, output.items[0].buttons[0].value);
+ EXPECT_EQ(true, output.items[0].buttons[0].pressed);
EXPECT_EQ(2u, output.items[0].axesLength);
EXPECT_EQ(-1.f, output.items[0].axes[0]);
EXPECT_EQ(0.5f, output.items[0].axes[1]);
@@ -116,12 +118,14 @@ TEST_F(GamepadProviderTest, UserGesture) {
no_button_data.items[0].timestamp = 0;
no_button_data.items[0].buttonsLength = 1;
no_button_data.items[0].axesLength = 2;
- no_button_data.items[0].buttons[0] = 0.f;
+ no_button_data.items[0].buttons[0].value = 0.f;
+ no_button_data.items[0].buttons[0].pressed = false;
no_button_data.items[0].axes[0] = -1.f;
no_button_data.items[0].axes[1] = .5f;
WebGamepads button_down_data = no_button_data;
- button_down_data.items[0].buttons[0] = 1.f;
+ button_down_data.items[0].buttons[0].value = 1.f;
+ button_down_data.items[0].buttons[0].pressed = true;
UserGestureListener listener;
GamepadProvider* provider = CreateProvider(no_button_data);
« no previous file with comments | « content/browser/gamepad/gamepad_platform_data_fetcher_win.cc ('k') | content/browser/gamepad/gamepad_standard_mappings.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698