OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 <SensorsApi.h> | 5 #include <SensorsApi.h> |
6 #include <Sensors.h> // NOLINT | 6 #include <Sensors.h> // NOLINT |
7 #include <Propvarutil.h> // NOLINT | 7 #include <Propvarutil.h> // NOLINT |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
(...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
364 .WillRepeatedly(WithArgs<0, 1>( | 364 .WillRepeatedly(WithArgs<0, 1>( |
365 Invoke([&values](REFPROPERTYKEY key, PROPVARIANT* variant) { | 365 Invoke([&values](REFPROPERTYKEY key, PROPVARIANT* variant) { |
366 auto it = values.find(key); | 366 auto it = values.find(key); |
367 if (it == values.end()) | 367 if (it == values.end()) |
368 return E_FAIL; | 368 return E_FAIL; |
369 | 369 |
370 PropVariantCopy(variant, it->second); | 370 PropVariantCopy(variant, it->second); |
371 return S_OK; | 371 return S_OK; |
372 }))); | 372 }))); |
373 | 373 |
374 sensor_events_->OnDataUpdated(sensor_.get(), data_report.get()); | 374 sensor_events_->OnDataUpdated(sensor_.get(), data_report.Get()); |
375 } | 375 } |
376 | 376 |
377 scoped_refptr<MockISensorManager> sensor_manager_; | 377 scoped_refptr<MockISensorManager> sensor_manager_; |
378 scoped_refptr<MockISensorCollection> sensor_collection_; | 378 scoped_refptr<MockISensorCollection> sensor_collection_; |
379 scoped_refptr<MockISensor> sensor_; | 379 scoped_refptr<MockISensor> sensor_; |
380 base::win::ScopedComPtr<ISensorEvents> sensor_events_; | 380 base::win::ScopedComPtr<ISensorEvents> sensor_events_; |
381 base::MessageLoop message_loop_; | 381 base::MessageLoop message_loop_; |
382 scoped_refptr<PlatformSensor> platform_sensor_; | 382 scoped_refptr<PlatformSensor> platform_sensor_; |
383 // Inner run loop used to wait for async sensor creation callback. | 383 // Inner run loop used to wait for async sensor creation callback. |
384 std::unique_ptr<base::RunLoop> run_loop_; | 384 std::unique_ptr<base::RunLoop> run_loop_; |
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
715 static_cast<SensorReadingSharedBuffer*>(mapping.get()); | 715 static_cast<SensorReadingSharedBuffer*>(mapping.get()); |
716 | 716 |
717 EXPECT_THAT(buffer->reading.values[0], -x); | 717 EXPECT_THAT(buffer->reading.values[0], -x); |
718 EXPECT_THAT(buffer->reading.values[1], -y); | 718 EXPECT_THAT(buffer->reading.values[1], -y); |
719 EXPECT_THAT(buffer->reading.values[2], -z); | 719 EXPECT_THAT(buffer->reading.values[2], -z); |
720 EXPECT_THAT(buffer->reading.values[3], w); | 720 EXPECT_THAT(buffer->reading.values[3], w); |
721 EXPECT_TRUE(sensor->StopListening(client.get(), configuration)); | 721 EXPECT_TRUE(sensor->StopListening(client.get(), configuration)); |
722 } | 722 } |
723 | 723 |
724 } // namespace device | 724 } // namespace device |
OLD | NEW |