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

Side by Side Diff: content/shell/browser/layout_test/layout_test_bluetooth_adapter_provider.cc

Issue 2642123003: Bluetooth: Make maximum possible name filter 248 bytes, not 240 (Closed)
Patch Set: Change all NotFoundErrors to TypeErrors Created 3 years, 10 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "content/shell/browser/layout_test/layout_test_bluetooth_adapter_provid er.h" 5 #include "content/shell/browser/layout_test/layout_test_bluetooth_adapter_provid er.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after
415 415
416 return adapter; 416 return adapter;
417 } 417 }
418 418
419 // static 419 // static
420 scoped_refptr<NiceMockBluetoothAdapter> 420 scoped_refptr<NiceMockBluetoothAdapter>
421 LayoutTestBluetoothAdapterProvider::GetDeviceNameLongerThan29BytesAdapter() { 421 LayoutTestBluetoothAdapterProvider::GetDeviceNameLongerThan29BytesAdapter() {
422 scoped_refptr<NiceMockBluetoothAdapter> adapter(GetEmptyAdapter()); 422 scoped_refptr<NiceMockBluetoothAdapter> adapter(GetEmptyAdapter());
423 423
424 adapter->AddMockDevice(GetBaseDevice(adapter.get(), 424 adapter->AddMockDevice(GetBaseDevice(adapter.get(),
425 "a_device_name_that_is_longer_than_29_bytes_but_shorter _than_240_bytes")); 425 "a_device_name_that_is_longer_than_29_bytes_but_shorter _than_248_bytes"));
426 426
427 return adapter; 427 return adapter;
428 } 428 }
429 429
430 // Adds a device to |adapter| and notifies all observers about that new device. 430 // Adds a device to |adapter| and notifies all observers about that new device.
431 // Mocks can call this asynchronously to cause changes in the middle of a test. 431 // Mocks can call this asynchronously to cause changes in the middle of a test.
432 static void AddDevice(scoped_refptr<NiceMockBluetoothAdapter> adapter, 432 static void AddDevice(scoped_refptr<NiceMockBluetoothAdapter> adapter,
433 std::unique_ptr<NiceMockBluetoothDevice> new_device) { 433 std::unique_ptr<NiceMockBluetoothDevice> new_device) {
434 NiceMockBluetoothDevice* new_device_ptr = new_device.get(); 434 NiceMockBluetoothDevice* new_device_ptr = new_device.get();
435 adapter->AddMockDevice(std::move(new_device)); 435 adapter->AddMockDevice(std::move(new_device));
(...skipping 1277 matching lines...) Expand 10 before | Expand all | Expand 10 after
1713 return BluetoothUUID(); 1713 return BluetoothUUID();
1714 } 1714 }
1715 1715
1716 // static 1716 // static
1717 std::string LayoutTestBluetoothAdapterProvider::makeMACAddress(uint64_t addr) { 1717 std::string LayoutTestBluetoothAdapterProvider::makeMACAddress(uint64_t addr) {
1718 return BluetoothDevice::CanonicalizeAddress( 1718 return BluetoothDevice::CanonicalizeAddress(
1719 base::StringPrintf("%012" PRIx64, addr)); 1719 base::StringPrintf("%012" PRIx64, addr));
1720 } 1720 }
1721 1721
1722 } // namespace content 1722 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698