Changeset 91214 in webkit
- Timestamp:
- Jul 18, 2011 3:27:54 PM (13 years ago)
- Location:
- trunk/Tools
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r91212 r91214 1 2011-07-18 Adam Barth <abarth@webkit.org> 2 3 simplejson has trouble on chromium-linux 4 https://bugs.webkit.org/show_bug.cgi?id=64757 5 6 Reviewed by Eric Seidel. 7 8 Use the native JSON, if available. 9 10 * Scripts/webkitpy/layout_tests/layout_package/json_results_generator.py: 11 1 12 2011-07-18 Ojan Vafai <ojan@chromium.org> 2 13 -
trunk/Tools/Scripts/webkitpy/layout_tests/layout_package/json_layout_results_generator.py
r90789 r91214 32 32 from webkitpy.layout_tests.models import test_expectations 33 33 from webkitpy.layout_tests.models import test_failures 34 import webkitpy.thirdparty.simplejson as simplejson35 36 34 37 35 class JSONLayoutResultsGenerator(json_results_generator.JSONResultsGeneratorBase): -
trunk/Tools/Scripts/webkitpy/layout_tests/layout_package/json_results_generator.py
r90789 r91214 36 36 37 37 from webkitpy.layout_tests.layout_package import test_results_uploader 38 import webkitpy.thirdparty.simplejson as simplejson 38 39 try: 40 import json 41 except ImportError: 42 # python 2.5 compatibility 43 import webkitpy.thirdparty.simplejson as json 39 44 40 45 # A JSON results generator for generic tests. … … 58 63 content = filesystem.read_text_file(file_path) 59 64 content = strip_json_wrapper(content) 60 return simplejson.loads(content)65 return json.loads(content) 61 66 62 67 63 68 def write_json(filesystem, json_object, file_path): 64 69 # Specify separators in order to get compact encoding. 65 json_data = simplejson.dumps(json_object, separators=(',', ':'))70 json_data = json.dumps(json_object, separators=(',', ':')) 66 71 json_string = _JSON_PREFIX + json_data + _JSON_SUFFIX 67 72 filesystem.write_text_file(file_path, json_string) … … 238 243 239 244 def generate_json_output(self): 240 json = self.get_json()241 if json :245 json_object = self.get_json() 246 if json_object: 242 247 file_path = self._fs.join(self._results_directory, self.INCREMENTAL_RESULTS_FILENAME) 243 write_json(self._fs, json , file_path)248 write_json(self._fs, json_object, file_path) 244 249 245 250 def generate_times_ms_file(self): … … 430 435 431 436 try: 432 results_json = simplejson.loads(old_results)437 results_json = json.loads(old_results) 433 438 except: 434 439 _log.debug("results.json was not valid JSON. Clobbering.") -
trunk/Tools/Scripts/webkitpy/layout_tests/models/test_expectations.py
r91166 r91214 36 36 import re 37 37 38 import webkitpy.thirdparty.simplejson as simplejson 38 try: 39 import json 40 except ImportError: 41 # python 2.5 compatibility 42 import webkitpy.thirdparty.simplejson as json 39 43 40 44 … … 127 131 128 132 129 class ExpectationsJsonEncoder( simplejson.JSONEncoder):133 class ExpectationsJsonEncoder(json.JSONEncoder): 130 134 """JSON encoder that can handle ModifiersAndExpectations objects.""" 131 135 def default(self, obj): -
trunk/Tools/Scripts/webkitpy/tool/servers/rebaselineserver_unittest.py
r91210 r91214 29 29 import unittest 30 30 31 try: 32 import json 33 except ImportError: 34 # python 2.5 compatibility 35 import webkitpy.thirdparty.simplejson as json 36 31 37 from webkitpy.common.net import resultsjsonparser_unittest 32 38 from webkitpy.common.system import filesystem_mock 33 39 from webkitpy.layout_tests.layout_package.json_results_generator import strip_json_wrapper 34 40 from webkitpy.layout_tests.port.webkit import WebKitPort 35 import webkitpy.thirdparty.simplejson as simplejson36 41 from webkitpy.tool.commands.rebaselineserver import TestConfig, RebaselineServer 37 42 from webkitpy.tool.mocktool import MockSCM … … 208 213 def test_gather_baselines(self): 209 214 example_json = resultsjsonparser_unittest.ResultsJSONParserTest._example_full_results_json 210 results_json = simplejson.loads(strip_json_wrapper(example_json))215 results_json = json.loads(strip_json_wrapper(example_json)) 211 216 server = RebaselineServer() 212 217 server._test_config = get_test_config()
Note: See TracChangeset
for help on using the changeset viewer.