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

Unified Diff: content/browser/renderer_host/pepper/pepper_gamepad_host_unittest.cc

Issue 2808093006: [Device Service] Move Gamepad Blink headers to be part of the Gamepad client library (Closed)
Patch Set: rebase and address comments Created 3 years, 8 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
« no previous file with comments | « content/browser/renderer_host/pepper/pepper_gamepad_host.h ('k') | content/common/DEPS » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/pepper/pepper_gamepad_host_unittest.cc
diff --git a/content/browser/renderer_host/pepper/pepper_gamepad_host_unittest.cc b/content/browser/renderer_host/pepper/pepper_gamepad_host_unittest.cc
index 472a1a77176121bcbaf4022f72d89da1cce70944..fa5ef9ee30f63842fb305afd5432d4addd36c219 100644
--- a/content/browser/renderer_host/pepper/pepper_gamepad_host_unittest.cc
+++ b/content/browser/renderer_host/pepper/pepper_gamepad_host_unittest.cc
@@ -34,7 +34,7 @@ class PepperGamepadHostTest : public testing::Test,
PepperGamepadHostTest() {}
~PepperGamepadHostTest() override {}
- void ConstructService(const blink::WebGamepads& test_data) {
+ void ConstructService(const device::Gamepads& test_data) {
service_.reset(new device::GamepadServiceTestConstructor(test_data));
}
@@ -72,13 +72,13 @@ TEST_F(PepperGamepadHostTest, ValidateHardwareBuffersMatch) {
TEST_F(PepperGamepadHostTest, ValidateGamepadsMatch) {
// Gamepads.
- static_assert(sizeof(ppapi::WebKitGamepads) == sizeof(blink::WebGamepads),
+ static_assert(sizeof(ppapi::WebKitGamepads) == sizeof(device::Gamepads),
"gamepads data must match");
ppapi::WebKitGamepads ppapi_gamepads;
- blink::WebGamepads web_gamepads;
+ device::Gamepads web_gamepads;
// See comment below on storage & the EXPECT macro.
- size_t webkit_items_length_cap = blink::WebGamepads::kItemsLengthCap;
+ size_t webkit_items_length_cap = device::Gamepads::kItemsLengthCap;
size_t ppapi_items_length_cap = ppapi::WebKitGamepads::kItemsLengthCap;
EXPECT_EQ(webkit_items_length_cap, ppapi_items_length_cap);
@@ -90,23 +90,23 @@ TEST_F(PepperGamepadHostTest, ValidateGamepadsMatch) {
TEST_F(PepperGamepadHostTest, ValidateGamepadMatch) {
// Gamepad.
- static_assert(sizeof(ppapi::WebKitGamepad) == sizeof(blink::WebGamepad),
+ static_assert(sizeof(ppapi::WebKitGamepad) == sizeof(device::Gamepad),
"gamepad data must match");
ppapi::WebKitGamepad ppapi_gamepad;
- blink::WebGamepad web_gamepad;
+ device::Gamepad web_gamepad;
// Using EXPECT seems to force storage for the parameter, which the constants
// in the WebKit/PPAPI headers don't have. So we have to use temporaries
// before comparing them.
- size_t webkit_id_length_cap = blink::WebGamepad::kIdLengthCap;
+ size_t webkit_id_length_cap = device::Gamepad::kIdLengthCap;
size_t ppapi_id_length_cap = ppapi::WebKitGamepad::kIdLengthCap;
EXPECT_EQ(webkit_id_length_cap, ppapi_id_length_cap);
- size_t webkit_axes_length_cap = blink::WebGamepad::kAxesLengthCap;
+ size_t webkit_axes_length_cap = device::Gamepad::kAxesLengthCap;
size_t ppapi_axes_length_cap = ppapi::WebKitGamepad::kAxesLengthCap;
EXPECT_EQ(webkit_axes_length_cap, ppapi_axes_length_cap);
- size_t webkit_buttons_length_cap = blink::WebGamepad::kButtonsLengthCap;
+ size_t webkit_buttons_length_cap = device::Gamepad::kButtonsLengthCap;
size_t ppapi_buttons_length_cap = ppapi::WebKitGamepad::kButtonsLengthCap;
EXPECT_EQ(webkit_buttons_length_cap, ppapi_buttons_length_cap);
@@ -127,8 +127,8 @@ TEST_F(PepperGamepadHostTest, ValidateGamepadMatch) {
}
TEST_F(PepperGamepadHostTest, WaitForReply) {
- blink::WebGamepads default_data;
- memset(&default_data, 0, sizeof(blink::WebGamepads));
+ device::Gamepads default_data;
+ memset(&default_data, 0, sizeof(device::Gamepads));
default_data.items[0].connected = true;
default_data.items[0].buttons_length = 1;
ConstructService(default_data);
@@ -153,7 +153,7 @@ TEST_F(PepperGamepadHostTest, WaitForReply) {
EXPECT_EQ(0u, sink().message_count());
// Set a button down and wait for it to be read twice.
- blink::WebGamepads button_down_data = default_data;
+ device::Gamepads button_down_data = default_data;
button_down_data.items[0].buttons[0].value = 1.f;
button_down_data.items[0].buttons[0].pressed = true;
fetcher->SetTestData(button_down_data);
« no previous file with comments | « content/browser/renderer_host/pepper/pepper_gamepad_host.h ('k') | content/common/DEPS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698