Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 <string> | 5 #include <string> |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
| 9 #include "base/strings/string_number_conversions.h" | 9 #include "base/strings/string_number_conversions.h" |
| 10 #include "base/test/test_simple_task_runner.h" | 10 #include "base/test/test_simple_task_runner.h" |
| (...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 436 TEST_F(BluetoothAdapterWinTest, DevicesPolled) { | 436 TEST_F(BluetoothAdapterWinTest, DevicesPolled) { |
| 437 BluetoothTaskManagerWin::DeviceState* android_phone_state = | 437 BluetoothTaskManagerWin::DeviceState* android_phone_state = |
| 438 new BluetoothTaskManagerWin::DeviceState(); | 438 new BluetoothTaskManagerWin::DeviceState(); |
| 439 MakeDeviceState("phone", "A1:B2:C3:D4:E5:E0", android_phone_state); | 439 MakeDeviceState("phone", "A1:B2:C3:D4:E5:E0", android_phone_state); |
| 440 BluetoothTaskManagerWin::DeviceState* laptop_state = | 440 BluetoothTaskManagerWin::DeviceState* laptop_state = |
| 441 new BluetoothTaskManagerWin::DeviceState(); | 441 new BluetoothTaskManagerWin::DeviceState(); |
| 442 MakeDeviceState("laptop", "A1:B2:C3:D4:E5:E1", laptop_state); | 442 MakeDeviceState("laptop", "A1:B2:C3:D4:E5:E1", laptop_state); |
| 443 BluetoothTaskManagerWin::DeviceState* iphone_state = | 443 BluetoothTaskManagerWin::DeviceState* iphone_state = |
| 444 new BluetoothTaskManagerWin::DeviceState(); | 444 new BluetoothTaskManagerWin::DeviceState(); |
| 445 MakeDeviceState("phone", "A1:B2:C3:D4:E5:E2", iphone_state); | 445 MakeDeviceState("phone", "A1:B2:C3:D4:E5:E2", iphone_state); |
| 446 ScopedVector<BluetoothTaskManagerWin::DeviceState> devices; | 446 std::vector<std::unique_ptr << BluetoothTaskManagerWin::DeviceState>> devices; |
|
scheib
2016/12/13 00:51:06
<< ?
| |
| 447 devices.push_back(android_phone_state); | 447 devices.push_back(android_phone_state); |
| 448 devices.push_back(laptop_state); | 448 devices.push_back(laptop_state); |
| 449 devices.push_back(iphone_state); | 449 devices.push_back(iphone_state); |
| 450 | 450 |
| 451 // Add 3 devices | 451 // Add 3 devices |
| 452 observer_.Reset(); | 452 observer_.Reset(); |
| 453 adapter_win_->DevicesPolled(devices); | 453 adapter_win_->DevicesPolled(devices); |
| 454 EXPECT_EQ(3, observer_.device_added_count()); | 454 EXPECT_EQ(3, observer_.device_added_count()); |
| 455 EXPECT_EQ(0, observer_.device_removed_count()); | 455 EXPECT_EQ(0, observer_.device_removed_count()); |
| 456 EXPECT_EQ(0, observer_.device_changed_count()); | 456 EXPECT_EQ(0, observer_.device_changed_count()); |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 502 // Remove a service | 502 // Remove a service |
| 503 laptop_state->service_record_states.clear(); | 503 laptop_state->service_record_states.clear(); |
| 504 observer_.Reset(); | 504 observer_.Reset(); |
| 505 adapter_win_->DevicesPolled(devices); | 505 adapter_win_->DevicesPolled(devices); |
| 506 EXPECT_EQ(0, observer_.device_added_count()); | 506 EXPECT_EQ(0, observer_.device_added_count()); |
| 507 EXPECT_EQ(0, observer_.device_removed_count()); | 507 EXPECT_EQ(0, observer_.device_removed_count()); |
| 508 EXPECT_EQ(1, observer_.device_changed_count()); | 508 EXPECT_EQ(1, observer_.device_changed_count()); |
| 509 } | 509 } |
| 510 | 510 |
| 511 } // namespace device | 511 } // namespace device |
| OLD | NEW |