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

Side by Side Diff: extensions/browser/api/bluetooth/bluetooth_apitest.cc

Issue 2244693002: bluetooth: Refactor how we update based on Advertising Data (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 3 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
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 <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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698