Commit 73f67fdb authored by ojan@chromium.org's avatar ojan@chromium.org

Stop storing results files as jsonp in the test results server

https://bugs.webkit.org/show_bug.cgi?id=72814

Reviewed by Adam Barth.

* TestResultServer/model/jsonresults.py:
* TestResultServer/model/jsonresults_unittest.py:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@100863 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 025a9d22
2011-11-19 Ojan Vafai <ojan@chromium.org>
Stop storing results files as jsonp in the test results server
https://bugs.webkit.org/show_bug.cgi?id=72814
Reviewed by Adam Barth.
* TestResultServer/model/jsonresults.py:
* TestResultServer/model/jsonresults_unittest.py:
2011-11-19 Ojan Vafai <ojan@chromium.org>
Remove the dependence on jsonp from more of new-run-webkit-tests and the test results server
......@@ -60,8 +60,7 @@ class JsonResults(object):
@classmethod
def _generate_file_data(cls, json, sort_keys=False):
data = simplejson.dumps(json, separators=(',', ':'), sort_keys=sort_keys)
return JSON_RESULTS_PREFIX + data + JSON_RESULTS_SUFFIX
return simplejson.dumps(json, separators=(',', ':'), sort_keys=sort_keys)
@classmethod
def _load_json(cls, file_data):
......
......@@ -70,9 +70,6 @@ JSON_RESULTS_TESTS_TEMPLATE = (
'"results":[[TESTDATA_TEST_RESULTS]],'
'"times":[[TESTDATA_TEST_TIMES]]}')
JSON_RESULTS_PREFIX = "ADD_RESULTS("
JSON_RESULTS_SUFFIX = ");"
JSON_RESULTS_TEST_LIST_TEMPLATE = (
'{"Webkit":{"tests":{[TESTDATA_TESTS]}}}')
......@@ -83,17 +80,17 @@ class JsonResultsTest(unittest.TestCase):
def test_strip_prefix_suffix(self):
json = "['contents']"
self.assertEqual(JsonResults._strip_prefix_suffix(JSON_RESULTS_PREFIX + json + JSON_RESULTS_SUFFIX), json)
self.assertEqual(JsonResults._strip_prefix_suffix("ADD_RESULTS(" + json + ");"), json)
self.assertEqual(JsonResults._strip_prefix_suffix(json), json)
def _make_test_json(self, test_data):
if not test_data:
return JSON_RESULTS_PREFIX + JSON_RESULTS_SUFFIX
return ""
builds = test_data["builds"]
tests = test_data["tests"]
if not builds or not tests:
return JSON_RESULTS_PREFIX + JSON_RESULTS_SUFFIX
return ""
json = JSON_RESULTS_TEMPLATE
......@@ -127,7 +124,7 @@ class JsonResultsTest(unittest.TestCase):
json = json.replace("[TESTDATA_TESTS]", ",".join(json_tests))
return JSON_RESULTS_PREFIX + json + JSON_RESULTS_SUFFIX
return json
def _parse_tests_dict(self, name, test):
if "results" in test:
......@@ -161,10 +158,7 @@ class JsonResultsTest(unittest.TestCase):
for test in expected_data:
json_tests.append("\"" + test + "\":{}")
expected_results = (JSON_RESULTS_PREFIX +
JSON_RESULTS_TEST_LIST_TEMPLATE.replace("[TESTDATA_TESTS]", ",".join(json_tests)) +
JSON_RESULTS_SUFFIX)
expected_results = JSON_RESULTS_TEST_LIST_TEMPLATE.replace("[TESTDATA_TESTS]", ",".join(json_tests))
actual_results = JsonResults.get_test_list(self._builder, input_results)
self.assertEquals(actual_results, expected_results)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment