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

Side by Side Diff: third_party/WebKit/Source/modules/bluetooth/testing/clusterfuzz/fuzz_integration_test.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 """Test that the fuzzer works the way ClusterFuzz invokes it."""
6
7 import glob
8 import os
9 import shutil
10 import sys
11 import tempfile
12 import unittest
13
14 import fuzz_main_run
15 import setup
16
17
18 class WebBluetoothFuzzerTest(unittest.TestCase):
19
20 def setUp(self):
21 self._output_dir = tempfile.mkdtemp()
22 self._resources_path = setup.RetrieveResources()
23
24 def tearDown(self):
25 shutil.rmtree(self._output_dir)
26 shutil.rmtree(self._resources_path)
27
28 def testCanGenerate100Files(self):
29 sys.argv = ['fuzz_main_run.py', '--no_of_files=100',
30 '--input_dir={}'.format(self._output_dir),
31 '--output_dir={}'.format(self._output_dir)]
32
33 fuzz_main_run.main()
34
35 written_files = glob.glob(os.path.join(self._output_dir, '*.html'))
36
37 self.assertEquals(100, len(written_files), 'Should have written 100 '
38 'test files.')
39
40 if __name__ == '__main__':
41 unittest.main()
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698