| Index: third_party/WebKit/Source/modules/bluetooth/testing/clusterfuzz/fuzz_integration_test.py
|
| diff --git a/third_party/WebKit/Source/modules/bluetooth/testing/clusterfuzz/fuzz_integration_test.py b/third_party/WebKit/Source/modules/bluetooth/testing/clusterfuzz/fuzz_integration_test.py
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..3be8cf70f91c71190a6cb745f72195c1f48f1901
|
| --- /dev/null
|
| +++ b/third_party/WebKit/Source/modules/bluetooth/testing/clusterfuzz/fuzz_integration_test.py
|
| @@ -0,0 +1,41 @@
|
| +# Copyright 2016 The Chromium Authors. All rights reserved.
|
| +# Use of this source code is governed by a BSD-style license that can be
|
| +# found in the LICENSE file.
|
| +
|
| +"""Test that the fuzzer works the way ClusterFuzz invokes it."""
|
| +
|
| +import glob
|
| +import os
|
| +import shutil
|
| +import sys
|
| +import tempfile
|
| +import unittest
|
| +
|
| +import fuzz_main_run
|
| +import setup
|
| +
|
| +
|
| +class WebBluetoothFuzzerTest(unittest.TestCase):
|
| +
|
| + def setUp(self):
|
| + self._output_dir = tempfile.mkdtemp()
|
| + self._resources_path = setup.RetrieveResources()
|
| +
|
| + def tearDown(self):
|
| + shutil.rmtree(self._output_dir)
|
| + shutil.rmtree(self._resources_path)
|
| +
|
| + def testCanGenerate100Files(self):
|
| + sys.argv = ['fuzz_main_run.py', '--no_of_files=100',
|
| + '--input_dir={}'.format(self._output_dir),
|
| + '--output_dir={}'.format(self._output_dir)]
|
| +
|
| + fuzz_main_run.main()
|
| +
|
| + written_files = glob.glob(os.path.join(self._output_dir, '*.html'))
|
| +
|
| + self.assertEquals(100, len(written_files), 'Should have written 100 '
|
| + 'test files.')
|
| +
|
| +if __name__ == '__main__':
|
| + unittest.main()
|
|
|