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

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

Issue 2166463002: bluetooth: Basic Web Bluetooth Fuzzer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@my-origin
Patch Set: Move to testing/clusterfuzz directory Created 4 years, 5 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
(Empty)
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
3 # found in the LICENSE file.
4
5 """Module that includes classes and functions used by fuzzers."""
6
7
8 def FillInParameter(parameter, func, template):
9 """Replaces occurrences of a parameter by calling a provided generator.
10
11 Args:
12 parameter: A string representing the parameter that should be replaced.
13 func: A function that returns a string representing the value used to
14 replace an instance of the parameter.
15 template: A string that contains the parameter to be replaced.
16
17 Returns:
18 A string containing the value of |template| in which instances of
19 |pameter| have been replaced by results of calling |func|.
20
21 """
22 result = template
23 while parameter in result:
24 result = result.replace(parameter, func(), 1)
25
26 return result
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698