| 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.h> | 5 #include <string.h> |
| 6 | 6 |
| 7 #include "base/strings/stringprintf.h" | 7 #include "base/strings/stringprintf.h" |
| 8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
| 9 #include "chrome/browser/extensions/extension_apitest.h" | 9 #include "chrome/browser/extensions/extension_apitest.h" |
| 10 #include "chrome/browser/extensions/extension_function_test_utils.h" | 10 #include "chrome/browser/extensions/extension_function_test_utils.h" |
| (...skipping 411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 422 .WillRepeatedly(testing::Return(0x080104)); | 422 .WillRepeatedly(testing::Return(0x080104)); |
| 423 EXPECT_CALL(*device1_, GetDeviceType()) | 423 EXPECT_CALL(*device1_, GetDeviceType()) |
| 424 .WillRepeatedly(testing::Return(BluetoothDevice::DEVICE_COMPUTER)); | 424 .WillRepeatedly(testing::Return(BluetoothDevice::DEVICE_COMPUTER)); |
| 425 EXPECT_CALL(*device1_, GetVendorIDSource()) | 425 EXPECT_CALL(*device1_, GetVendorIDSource()) |
| 426 .WillRepeatedly(testing::Return(BluetoothDevice::VENDOR_ID_BLUETOOTH)); | 426 .WillRepeatedly(testing::Return(BluetoothDevice::VENDOR_ID_BLUETOOTH)); |
| 427 EXPECT_CALL(*device1_, GetVendorID()).WillRepeatedly(testing::Return(0x00E0)); | 427 EXPECT_CALL(*device1_, GetVendorID()).WillRepeatedly(testing::Return(0x00E0)); |
| 428 EXPECT_CALL(*device1_, GetProductID()) | 428 EXPECT_CALL(*device1_, GetProductID()) |
| 429 .WillRepeatedly(testing::Return(0x240A)); | 429 .WillRepeatedly(testing::Return(0x240A)); |
| 430 EXPECT_CALL(*device1_, GetDeviceID()).WillRepeatedly(testing::Return(0x0400)); | 430 EXPECT_CALL(*device1_, GetDeviceID()).WillRepeatedly(testing::Return(0x0400)); |
| 431 | 431 |
| 432 BluetoothDevice::UUIDList uuids; | 432 BluetoothDevice::UUIDSet uuids; |
| 433 uuids.push_back(BluetoothUUID("1105")); | 433 uuids.insert(BluetoothUUID("1105")); |
| 434 uuids.push_back(BluetoothUUID("1106")); | 434 uuids.insert(BluetoothUUID("1106")); |
| 435 | 435 |
| 436 EXPECT_CALL(*device1_, GetUUIDs()).WillOnce(testing::Return(uuids)); | 436 EXPECT_CALL(*device1_, GetUUIDs()).WillOnce(testing::Return(uuids)); |
| 437 | 437 |
| 438 devices.push_back(device1_.get()); | 438 devices.push_back(device1_.get()); |
| 439 | 439 |
| 440 // Leave the second largely empty so we can check a device without | 440 // Leave the second largely empty so we can check a device without |
| 441 // available information. | 441 // available information. |
| 442 devices.push_back(device2_.get()); | 442 devices.push_back(device2_.get()); |
| 443 | 443 |
| 444 EXPECT_CALL(*mock_adapter_, GetDevices()) | 444 EXPECT_CALL(*mock_adapter_, GetDevices()) |
| 445 .Times(1) | 445 .Times(1) |
| 446 .WillRepeatedly(testing::Return(devices)); | 446 .WillRepeatedly(testing::Return(devices)); |
| 447 | 447 |
| 448 // Load and wait for setup | 448 // Load and wait for setup |
| 449 ExtensionTestMessageListener listener("ready", true); | 449 ExtensionTestMessageListener listener("ready", true); |
| 450 ASSERT_TRUE( | 450 ASSERT_TRUE( |
| 451 LoadExtension(test_data_dir_.AppendASCII("bluetooth/device_info"))); | 451 LoadExtension(test_data_dir_.AppendASCII("bluetooth/device_info"))); |
| 452 EXPECT_TRUE(listener.WaitUntilSatisfied()); | 452 EXPECT_TRUE(listener.WaitUntilSatisfied()); |
| 453 | 453 |
| 454 listener.Reply("go"); | 454 listener.Reply("go"); |
| 455 | 455 |
| 456 EXPECT_TRUE(catcher.GetNextResult()) << catcher.message(); | 456 EXPECT_TRUE(catcher.GetNextResult()) << catcher.message(); |
| 457 } | 457 } |
| OLD | NEW |