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

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

Issue 2166913002: bluetooth: Generate random service uuid and generate random fake adapter. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bluetooth-fuzzer-basics
Patch Set: Address scheib's comments Created 4 years, 4 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
« no previous file with comments | « no previous file | testing/clusterfuzz/OWNERS » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 if (fake_adapter_name == "FailingConnectionsAdapter") 169 if (fake_adapter_name == "FailingConnectionsAdapter")
170 return GetFailingConnectionsAdapter(); 170 return GetFailingConnectionsAdapter();
171 if (fake_adapter_name == "FailingGATTOperationsAdapter") 171 if (fake_adapter_name == "FailingGATTOperationsAdapter")
172 return GetFailingGATTOperationsAdapter(); 172 return GetFailingGATTOperationsAdapter();
173 if (fake_adapter_name == "SecondDiscoveryFindsHeartRateAdapter") 173 if (fake_adapter_name == "SecondDiscoveryFindsHeartRateAdapter")
174 return GetSecondDiscoveryFindsHeartRateAdapter(); 174 return GetSecondDiscoveryFindsHeartRateAdapter();
175 if (fake_adapter_name == "DelayedServicesDiscoveryAdapter") 175 if (fake_adapter_name == "DelayedServicesDiscoveryAdapter")
176 return GetDelayedServicesDiscoveryAdapter(); 176 return GetDelayedServicesDiscoveryAdapter();
177 if (fake_adapter_name.empty()) 177 if (fake_adapter_name.empty())
178 return nullptr; 178 return nullptr;
179 // New adapters that can be used when fuzzing the Web Bluetooth API
180 // should also be added to
181 // src/third_party/WebKit/Source/modules/
182 // bluetooth/testing/clusterfuzz/constraints.py.
179 183
180 NOTREACHED() << fake_adapter_name; 184 NOTREACHED() << fake_adapter_name;
181 return nullptr; 185 return nullptr;
182 } 186 }
183 187
184 // Adapters 188 // Adapters
185 189
186 // static 190 // static
187 scoped_refptr<NiceMockBluetoothAdapter> 191 scoped_refptr<NiceMockBluetoothAdapter>
188 LayoutTestBluetoothAdapterProvider::GetBaseAdapter() { 192 LayoutTestBluetoothAdapterProvider::GetBaseAdapter() {
(...skipping 885 matching lines...) Expand 10 before | Expand all | Expand 10 after
1074 return BluetoothUUID(); 1078 return BluetoothUUID();
1075 } 1079 }
1076 1080
1077 // static 1081 // static
1078 std::string LayoutTestBluetoothAdapterProvider::makeMACAddress(uint64_t addr) { 1082 std::string LayoutTestBluetoothAdapterProvider::makeMACAddress(uint64_t addr) {
1079 return BluetoothDevice::CanonicalizeAddress( 1083 return BluetoothDevice::CanonicalizeAddress(
1080 base::StringPrintf("%012" PRIx64, addr)); 1084 base::StringPrintf("%012" PRIx64, addr));
1081 } 1085 }
1082 1086
1083 } // namespace content 1087 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | testing/clusterfuzz/OWNERS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698