| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright (c) 2013 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 | 5 |
| 6 import json | 6 import json |
| 7 import os | 7 import os |
| 8 import shutil | 8 import shutil |
| 9 import sys | 9 import sys |
| 10 import tempfile | 10 import tempfile |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 | 31 |
| 32 def test_arguments(self): | 32 def test_arguments(self): |
| 33 actual = [] | 33 actual = [] |
| 34 runisolatedtest.run_command = lambda x: actual.append(x) or 0 | 34 runisolatedtest.run_command = lambda x: actual.append(x) or 0 |
| 35 exe = os.path.join(self.tempdir, 'foo') | 35 exe = os.path.join(self.tempdir, 'foo') |
| 36 isolated = exe + '.isolated' | 36 isolated = exe + '.isolated' |
| 37 | 37 |
| 38 data = { | 38 data = { |
| 39 'version': '1.0', | 39 'version': '1.0', |
| 40 'command': [ '../testing/test_env.py', | 40 'command': [ '../testing/test_env.py', |
| 41 r'..\build\Release/browser_test.exe'], | 41 r'..\out\Release/browser_test.exe'], |
| 42 'files': { r'build\Release\testdata': {} }, | 42 'files': { r'out\Release\testdata': {} }, |
| 43 | 43 |
| 44 'variables' : { | 44 'variables' : { |
| 45 'EXECUTABLE_SUFFIX' : '.exe', | 45 'EXECUTABLE_SUFFIX' : '.exe', |
| 46 'OS' : 'win', | 46 'OS' : 'win', |
| 47 'PRODUCT_DIR' : '../build/Release' | 47 'PRODUCT_DIR' : '../out/Release' |
| 48 }, | 48 }, |
| 49 } | 49 } |
| 50 with open(isolated, 'w') as f: | 50 with open(isolated, 'w') as f: |
| 51 json.dump(data, f) | 51 json.dump(data, f) |
| 52 | 52 |
| 53 sample_line = [ | 53 sample_line = [ |
| 54 '--test_name', 'base_unittests', | 54 '--test_name', 'base_unittests', |
| 55 '--builder_name', "Linux Tests", | 55 '--builder_name', "Linux Tests", |
| 56 '--checkout_dir', | 56 '--checkout_dir', |
| 57 'build/', | 57 'build/', |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 converted_data = json.load(f) | 101 converted_data = json.load(f) |
| 102 | 102 |
| 103 self.assertEqual(expected_data, converted_data) | 103 self.assertEqual(expected_data, converted_data) |
| 104 | 104 |
| 105 self.assertEqual(0, res) | 105 self.assertEqual(0, res) |
| 106 self.assertEqual(expected, actual) | 106 self.assertEqual(expected, actual) |
| 107 | 107 |
| 108 | 108 |
| 109 if __name__ == '__main__': | 109 if __name__ == '__main__': |
| 110 unittest.main() | 110 unittest.main() |
| OLD | NEW |