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

Side by Side Diff: content/browser/renderer_host/pepper/pepper_gamepad_host_unittest.cc

Issue 2329463004: ABANDONED CL: Changes needed to make things compile after running rewrite_to_chrome_style tool. (Closed)
Patch Set: Rebasing the fixes... Created 3 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 unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/renderer_host/pepper/pepper_gamepad_host.h" 5 #include "content/browser/renderer_host/pepper/pepper_gamepad_host.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <string.h> 8 #include <string.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 static_assert(sizeof(ppapi::WebKitGamepads) == sizeof(blink::WebGamepads), 75 static_assert(sizeof(ppapi::WebKitGamepads) == sizeof(blink::WebGamepads),
76 "gamepads data must match"); 76 "gamepads data must match");
77 ppapi::WebKitGamepads ppapi_gamepads; 77 ppapi::WebKitGamepads ppapi_gamepads;
78 blink::WebGamepads web_gamepads; 78 blink::WebGamepads web_gamepads;
79 79
80 // See comment below on storage & the EXPECT macro. 80 // See comment below on storage & the EXPECT macro.
81 size_t webkit_items_length_cap = blink::WebGamepads::itemsLengthCap; 81 size_t webkit_items_length_cap = blink::WebGamepads::itemsLengthCap;
82 size_t ppapi_items_length_cap = ppapi::WebKitGamepads::kItemsLengthCap; 82 size_t ppapi_items_length_cap = ppapi::WebKitGamepads::kItemsLengthCap;
83 EXPECT_EQ(webkit_items_length_cap, ppapi_items_length_cap); 83 EXPECT_EQ(webkit_items_length_cap, ppapi_items_length_cap);
84 84
85 for (size_t i = 0; i < web_gamepads.itemsLengthCap; i++) { 85 for (size_t i = 0; i < webkit_items_length_cap; i++) {
86 EXPECT_EQ(AddressDiff(&web_gamepads.items[0], &web_gamepads), 86 EXPECT_EQ(AddressDiff(&web_gamepads.items[0], &web_gamepads),
87 AddressDiff(&ppapi_gamepads.items[0], &ppapi_gamepads)); 87 AddressDiff(&ppapi_gamepads.items[0], &ppapi_gamepads));
88 } 88 }
89 } 89 }
90 90
91 TEST_F(PepperGamepadHostTest, ValidateGamepadMatch) { 91 TEST_F(PepperGamepadHostTest, ValidateGamepadMatch) {
92 // Gamepad. 92 // Gamepad.
93 static_assert(sizeof(ppapi::WebKitGamepad) == sizeof(blink::WebGamepad), 93 static_assert(sizeof(ppapi::WebKitGamepad) == sizeof(blink::WebGamepad),
94 "gamepad data must match"); 94 "gamepad data must match");
95 ppapi::WebKitGamepad ppapi_gamepad; 95 ppapi::WebKitGamepad ppapi_gamepad;
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 buffer->buffer.items[0].buttons[i].pressed); 185 buffer->buffer.items[0].buttons[i].pressed);
186 } 186 }
187 187
188 // Duplicate requests should be denied. 188 // Duplicate requests should be denied.
189 EXPECT_EQ(PP_ERROR_FAILED, 189 EXPECT_EQ(PP_ERROR_FAILED,
190 gamepad_host.OnResourceMessageReceived( 190 gamepad_host.OnResourceMessageReceived(
191 PpapiHostMsg_Gamepad_RequestMemory(), &context)); 191 PpapiHostMsg_Gamepad_RequestMemory(), &context));
192 } 192 }
193 193
194 } // namespace content 194 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698