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

Side by Side Diff: third_party/WebKit/Source/modules/bluetooth/testing/clusterfuzz/parameter_fuzzer.py

Issue 2178853006: bluetooth: fuzzer: Add a connect and getPrimaryServices tokens (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bluetooth-fuzzer-fake-adapter-uuid
Patch Set: Format 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
OLDNEW
1 # Copyright 2016 The Chromium Authors. All rights reserved. 1 # Copyright 2016 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 """Module to fuzz parameters of a template.""" 5 """Module to fuzz parameters of a template."""
6 6
7 import constraints 7 import constraints
8 from fuzzer_helpers import FillInParameter 8 from fuzzer_helpers import FillInParameter
9 9
10 10
11 def FuzzParameters(test_file_data): 11 def FuzzParameters(test_file_data):
12 """Fuzzes the data in the string provided. 12 """Fuzzes the data in the string provided.
13 13
14 For now this function only replaces the TRANSFORM_SERVICE_UUID parameter 14 For now this function only replaces the TRANSFORM_SERVICE_UUID parameter
15 with a valid UUID string. 15 with a valid UUID string.
16 16
17 Args: 17 Args:
18 test_file_data: String that contains parameters to be replaced. 18 test_file_data: String that contains parameters to be replaced.
19 19
20 Returns: 20 Returns:
21 A string containing the value of test_file_data but with all its 21 A string containing the value of test_file_data but with all its
22 parameters replaced. 22 parameters replaced.
23 """ 23 """
24 24
25 test_file_data = FillInParameter('TRANSFORM_BASIC_BASE',
26 constraints.GetBasicBase,
27 test_file_data)
28
29 test_file_data = FillInParameter('TRANSFORM_DEVICE_DISCOVERY_BASE',
30 constraints.GetDeviceDiscoveryBase,
31 test_file_data)
32
33 test_file_data = FillInParameter('TRANSFORM_CONNECTABLE_BASE',
34 constraints.GetConnectableBase,
35 test_file_data)
36
37 test_file_data = FillInParameter('TRANSFORM_SERVICE_RETRIEVED_BASE',
38 constraints.GetServiceRetrievedBase,
39 test_file_data)
40
25 test_file_data = FillInParameter('TRANSFORM_REQUEST_DEVICE_OPTIONS', 41 test_file_data = FillInParameter('TRANSFORM_REQUEST_DEVICE_OPTIONS',
26 constraints.GetRequestDeviceOptions, 42 constraints.GetRequestDeviceOptions,
27 test_file_data) 43 test_file_data)
28 44
29 test_file_data = FillInParameter('TRANSFORM_FAKE_ADAPTER',
30 constraints.GetFakeAdapter,
31 test_file_data)
32
33 return test_file_data 45 return test_file_data
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698