| OLD | NEW |
| 1 # Copyright (C) 2012 Google Inc. All rights reserved. | 1 # Copyright (C) 2012 Google Inc. All rights reserved. |
| 2 # | 2 # |
| 3 # Redistribution and use in source and binary forms, with or without | 3 # Redistribution and use in source and binary forms, with or without |
| 4 # modification, are permitted provided that the following conditions are | 4 # modification, are permitted provided that the following conditions are |
| 5 # met: | 5 # met: |
| 6 # | 6 # |
| 7 # * Redistributions of source code must retain the above copyright | 7 # * Redistributions of source code must retain the above copyright |
| 8 # notice, this list of conditions and the following disclaimer. | 8 # notice, this list of conditions and the following disclaimer. |
| 9 # * Redistributions in binary form must reproduce the above | 9 # * Redistributions in binary form must reproduce the above |
| 10 # copyright notice, this list of conditions and the following disclaimer | 10 # copyright notice, this list of conditions and the following disclaimer |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 '--build-directory=folder42', | 132 '--build-directory=folder42', |
| 133 '--platform=platform42', | 133 '--platform=platform42', |
| 134 '--builder-name', 'webkit-mac-1', | 134 '--builder-name', 'webkit-mac-1', |
| 135 '--build-number=56', | 135 '--build-number=56', |
| 136 '--time-out-ms=42', | 136 '--time-out-ms=42', |
| 137 '--no-show-results', | 137 '--no-show-results', |
| 138 '--reset-results', | 138 '--reset-results', |
| 139 '--output-json-path=a/output.json', | 139 '--output-json-path=a/output.json', |
| 140 '--slave-config-json-path=a/source.json', | 140 '--slave-config-json-path=a/source.json', |
| 141 '--test-results-server=somehost', | 141 '--test-results-server=somehost', |
| 142 '--additional-drt-flag=--enable-threaded-parser', | |
| 143 '--additional-drt-flag=--awesomesauce', | |
| 144 '--repeat=5', | 142 '--repeat=5', |
| 145 '--test-runner-count=5', | 143 '--test-runner-count=5', |
| 146 '--debug']) | 144 '--debug']) |
| 147 self.assertTrue(options.build) | 145 self.assertTrue(options.build) |
| 148 self.assertEqual(options.build_directory, 'folder42') | 146 self.assertEqual(options.build_directory, 'folder42') |
| 149 self.assertEqual(options.platform, 'platform42') | 147 self.assertEqual(options.platform, 'platform42') |
| 150 self.assertEqual(options.builder_name, 'webkit-mac-1') | 148 self.assertEqual(options.builder_name, 'webkit-mac-1') |
| 151 self.assertEqual(options.build_number, '56') | 149 self.assertEqual(options.build_number, '56') |
| 152 self.assertEqual(options.time_out_ms, '42') | 150 self.assertEqual(options.time_out_ms, '42') |
| 153 self.assertEqual(options.configuration, 'Debug') | 151 self.assertEqual(options.configuration, 'Debug') |
| 154 self.assertFalse(options.show_results) | 152 self.assertFalse(options.show_results) |
| 155 self.assertTrue(options.reset_results) | 153 self.assertTrue(options.reset_results) |
| 156 self.assertEqual(options.output_json_path, 'a/output.json') | 154 self.assertEqual(options.output_json_path, 'a/output.json') |
| 157 self.assertEqual(options.slave_config_json_path, 'a/source.json') | 155 self.assertEqual(options.slave_config_json_path, 'a/source.json') |
| 158 self.assertEqual(options.test_results_server, 'somehost') | 156 self.assertEqual(options.test_results_server, 'somehost') |
| 159 self.assertEqual(options.additional_drt_flag, ['--enable-threaded-parser
', '--awesomesauce']) | |
| 160 self.assertEqual(options.repeat, 5) | 157 self.assertEqual(options.repeat, 5) |
| 161 self.assertEqual(options.test_runner_count, 5) | 158 self.assertEqual(options.test_runner_count, 5) |
| 162 | 159 |
| 163 def test_upload_json(self): | 160 def test_upload_json(self): |
| 164 runner, port = self.create_runner() | 161 runner, port = self.create_runner() |
| 165 port.host.filesystem.files['/mock-checkout/some.json'] = 'some content' | 162 port.host.filesystem.files['/mock-checkout/some.json'] = 'some content' |
| 166 | 163 |
| 167 class MockFileUploader: | 164 class MockFileUploader: |
| 168 called = [] | 165 called = [] |
| 169 upload_single_text_file_throws = False | 166 upload_single_text_file_throws = False |
| (...skipping 584 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 754 self._test_run_with_json_output(runner, port.host.filesystem, compare_lo
gs=False) | 751 self._test_run_with_json_output(runner, port.host.filesystem, compare_lo
gs=False) |
| 755 generated_json = json.loads(port.host.filesystem.files['/mock-checkout/o
utput.json']) | 752 generated_json = json.loads(port.host.filesystem.files['/mock-checkout/o
utput.json']) |
| 756 self.assertTrue(isinstance(generated_json, list)) | 753 self.assertTrue(isinstance(generated_json, list)) |
| 757 self.assertEqual(len(generated_json), 1) | 754 self.assertEqual(len(generated_json), 1) |
| 758 | 755 |
| 759 output = generated_json[0]['tests']['Bindings']['tests']['event-target-w
rapper']['metrics']['Time']['current'] | 756 output = generated_json[0]['tests']['Bindings']['tests']['event-target-w
rapper']['metrics']['Time']['current'] |
| 760 self.assertEqual(len(output), 3) | 757 self.assertEqual(len(output), 3) |
| 761 expectedMetrics = EventTargetWrapperTestData.results['metrics']['Time'][
'current'][0] | 758 expectedMetrics = EventTargetWrapperTestData.results['metrics']['Time'][
'current'][0] |
| 762 for metrics in output: | 759 for metrics in output: |
| 763 self.assertEqual(metrics, expectedMetrics) | 760 self.assertEqual(metrics, expectedMetrics) |
| OLD | NEW |