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

Side by Side Diff: third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/generate_results_dashboard.py

Issue 2014063002: Run format-webkit on webkitpy code (without string conversion). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 4 years, 6 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
1 # Copyright (C) 2014 Google Inc. All rights reserved. 1 # Copyright (C) 2014 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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 if result == 'NOTFOUND': 63 if result == 'NOTFOUND':
64 result = self._recurse_json_object(self._old_full_results_list[i ndex]["tests"], key_list) 64 result = self._recurse_json_object(self._old_full_results_list[i ndex]["tests"], key_list)
65 row.append(result) 65 row.append(result)
66 return row 66 return row
67 67
68 def _add_archived_result(self, json_object, result): 68 def _add_archived_result(self, json_object, result):
69 json_object['archived_results'] = result 69 json_object['archived_results'] = result
70 70
71 def _process_json_object(self, json_object, keyList): 71 def _process_json_object(self, json_object, keyList):
72 for key, subdict in json_object.iteritems(): 72 for key, subdict in json_object.iteritems():
73 if type(subdict) == dict: 73 if isinstance(subdict, dict):
74 self._process_json_object(subdict, keyList + [key]) 74 self._process_json_object(subdict, keyList + [key])
75 else: 75 else:
76 row = [self._get_test_result(json_object)] 76 row = [self._get_test_result(json_object)]
77 row += self._process_previous_json_results(keyList) 77 row += self._process_previous_json_results(keyList)
78 json_object.clear() 78 json_object.clear()
79 self._add_archived_result(json_object, row) 79 self._add_archived_result(json_object, row)
80 return 80 return
81 81
82 def generate_archived_result(self): 82 def generate_archived_result(self):
83 for key in self._current_result_json_dict["tests"]: 83 for key in self._current_result_json_dict["tests"]:
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 144
145 # There must be at least one archived result to be processed 145 # There must be at least one archived result to be processed
146 if self._current_result_json_dict: 146 if self._current_result_json_dict:
147 process_json_data = ProcessJsonData(self._current_result_json_dict, 147 process_json_data = ProcessJsonData(self._current_result_json_dict,
148 self._old_failing_results_list, self._old_full_results_list) 148 self._old_failing_results_list, self._old_full_results_list)
149 self._final_result = process_json_data.generate_archived_result() 149 self._final_result = process_json_data.generate_archived_result()
150 final_json = json.dumps(self._final_result) 150 final_json = json.dumps(self._final_result)
151 final_json = 'ADD_RESULTS(' + final_json + ');' 151 final_json = 'ADD_RESULTS(' + final_json + ');'
152 archived_results_file_path = self._filesystem.join(self._results_dir ectory, 'archived_results.json') 152 archived_results_file_path = self._filesystem.join(self._results_dir ectory, 'archived_results.json')
153 self._filesystem.write_text_file(archived_results_file_path, final_j son) 153 self._filesystem.write_text_file(archived_results_file_path, final_j son)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698