OLD | NEW |
1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2014 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 <sstream> | 5 #include <sstream> |
6 | 6 |
7 #include "device/hid/hid_report_descriptor.h" | 7 #include "device/hid/hid_report_descriptor.h" |
8 #include "testing/gmock/include/gmock/gmock.h" | 8 #include "testing/gmock/include/gmock/gmock.h" |
9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
10 | 10 |
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
291 virtual void TearDown() OVERRIDE { | 291 virtual void TearDown() OVERRIDE { |
292 if (descriptor_) { | 292 if (descriptor_) { |
293 delete descriptor_; | 293 delete descriptor_; |
294 } | 294 } |
295 } | 295 } |
296 | 296 |
297 public: | 297 public: |
298 void ValidateDetails( | 298 void ValidateDetails( |
299 const std::vector<HidCollectionInfo>& expected_collections, | 299 const std::vector<HidCollectionInfo>& expected_collections, |
300 const bool expected_has_report_id, | 300 const bool expected_has_report_id, |
301 const int expected_max_input_report_size, | 301 const uint16_t expected_max_input_report_size, |
302 const int expected_max_output_report_size, | 302 const uint16_t expected_max_output_report_size, |
303 const int expected_max_feature_report_size, | 303 const uint16_t expected_max_feature_report_size, |
304 const uint8_t* bytes, | 304 const uint8_t* bytes, |
305 size_t size) { | 305 size_t size) { |
306 descriptor_ = new HidReportDescriptor(bytes, size); | 306 descriptor_ = new HidReportDescriptor(bytes, size); |
307 | 307 |
308 std::vector<HidCollectionInfo> actual_collections; | 308 std::vector<HidCollectionInfo> actual_collections; |
309 bool actual_has_report_id; | 309 bool actual_has_report_id; |
310 int actual_max_input_report_size; | 310 uint16_t actual_max_input_report_size; |
311 int actual_max_output_report_size; | 311 uint16_t actual_max_output_report_size; |
312 int actual_max_feature_report_size; | 312 uint16_t actual_max_feature_report_size; |
313 descriptor_->GetDetails(&actual_collections, | 313 descriptor_->GetDetails(&actual_collections, |
314 &actual_has_report_id, | 314 &actual_has_report_id, |
315 &actual_max_input_report_size, | 315 &actual_max_input_report_size, |
316 &actual_max_output_report_size, | 316 &actual_max_output_report_size, |
317 &actual_max_feature_report_size); | 317 &actual_max_feature_report_size); |
318 | 318 |
319 ASSERT_EQ(expected_collections.size(), actual_collections.size()); | 319 ASSERT_EQ(expected_collections.size(), actual_collections.size()); |
320 | 320 |
321 std::vector<HidCollectionInfo>::const_iterator actual_collections_iter = | 321 std::vector<HidCollectionInfo>::const_iterator actual_collections_iter = |
322 actual_collections.begin(); | 322 actual_collections.begin(); |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
429 expected, expected + ARRAYSIZE_UNSAFE(expected)), | 429 expected, expected + ARRAYSIZE_UNSAFE(expected)), |
430 true, | 430 true, |
431 31, | 431 31, |
432 31, | 432 31, |
433 0, | 433 0, |
434 kLogitechUnifyingReceiver, | 434 kLogitechUnifyingReceiver, |
435 sizeof(kLogitechUnifyingReceiver)); | 435 sizeof(kLogitechUnifyingReceiver)); |
436 } | 436 } |
437 | 437 |
438 } // namespace device | 438 } // namespace device |
OLD | NEW |