Commit 135a0399 authored by ojan@chromium.org's avatar ojan@chromium.org

Allow json NRWT downloads to be pure json and not jsonp

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

Reviewed by Adam Barth.

I'm moving the server to storing and serving up raw json instead of jsonp.
You can still get the jsonp by passing a "callback" parameter, but there's no
need for run-webkit-tests to get jsonp when all it wants is the raw json.

* Scripts/webkitpy/layout_tests/layout_package/json_results_generator.py:
Make the wrapper stripping only happen if the json is actually wrapped.
* Scripts/webkitpy/layout_tests/layout_package/json_results_generator_unittest.py:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@100861 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 963ac560
2011-11-19 Ojan Vafai <ojan@chromium.org>
Allow json NRWT downloads to be pure json and not jsonp
https://bugs.webkit.org/show_bug.cgi?id=72809
Reviewed by Adam Barth.
I'm moving the server to storing and serving up raw json instead of jsonp.
You can still get the jsonp by passing a "callback" parameter, but there's no
need for run-webkit-tests to get jsonp when all it wants is the raw json.
* Scripts/webkitpy/layout_tests/layout_package/json_results_generator.py:
Make the wrapper stripping only happen if the json is actually wrapped.
* Scripts/webkitpy/layout_tests/layout_package/json_results_generator_unittest.py:
2011-11-18 Daniel Bates <dbates@rim.com>
Add CMake build infrastructure for the BlackBerry port
......@@ -56,7 +56,9 @@ def has_json_wrapper(string):
def strip_json_wrapper(json_content):
return json_content[len(_JSON_PREFIX):len(json_content) - len(_JSON_SUFFIX)]
if has_json_wrapper(json_content):
return json_content[len(_JSON_PREFIX):len(json_content) - len(_JSON_SUFFIX)]
return json_content
def load_json(filesystem, file_path):
......
......@@ -58,6 +58,11 @@ class JSONGeneratorTest(unittest.TestCase):
self._FAILS_count = 0
self._fixable_count = 0
def test_strip_json_wrapper(self):
json = "['contents']"
self.assertEqual(json_results_generator.strip_json_wrapper(json_results_generator._JSON_PREFIX + json + json_results_generator._JSON_SUFFIX), json)
self.assertEqual(json_results_generator.strip_json_wrapper(json), json)
def _test_json_generation(self, passed_tests_list, failed_tests_list):
tests_set = set(passed_tests_list) | set(failed_tests_list)
......
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