Changeset 100861 in webkit


Ignore:
Timestamp:
Nov 19, 2011 4:04:53 PM (12 years ago)
Author:
ojan@chromium.org
Message:

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:
Location:
trunk/Tools
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r100844 r100861  
     12011-11-19  Ojan Vafai  <ojan@chromium.org>
     2
     3        Allow json NRWT downloads to be pure json and not jsonp
     4        https://bugs.webkit.org/show_bug.cgi?id=72809
     5
     6        Reviewed by Adam Barth.
     7
     8        I'm moving the server to storing and serving up raw json instead of jsonp.
     9        You can still get the jsonp by passing a "callback" parameter, but there's no
     10        need for run-webkit-tests to get jsonp when all it wants is the raw json.
     11
     12        * Scripts/webkitpy/layout_tests/layout_package/json_results_generator.py:
     13        Make the wrapper stripping only happen if the json is actually wrapped.
     14        * Scripts/webkitpy/layout_tests/layout_package/json_results_generator_unittest.py:
     15
    1162011-11-18  Daniel Bates  <dbates@rim.com>
    217
  • trunk/Tools/Scripts/webkitpy/layout_tests/layout_package/json_results_generator.py

    r100592 r100861  
    5757
    5858def strip_json_wrapper(json_content):
    59     return json_content[len(_JSON_PREFIX):len(json_content) - len(_JSON_SUFFIX)]
     59    if has_json_wrapper(json_content):
     60        return json_content[len(_JSON_PREFIX):len(json_content) - len(_JSON_SUFFIX)]
     61    return json_content
    6062
    6163
  • trunk/Tools/Scripts/webkitpy/layout_tests/layout_package/json_results_generator_unittest.py

    r90789 r100861  
    5959        self._fixable_count = 0
    6060
     61    def test_strip_json_wrapper(self):
     62        json = "['contents']"
     63        self.assertEqual(json_results_generator.strip_json_wrapper(json_results_generator._JSON_PREFIX + json + json_results_generator._JSON_SUFFIX), json)
     64        self.assertEqual(json_results_generator.strip_json_wrapper(json), json)
     65
    6166    def _test_json_generation(self, passed_tests_list, failed_tests_list):
    6267        tests_set = set(passed_tests_list) | set(failed_tests_list)
Note: See TracChangeset for help on using the changeset viewer.