3 <script src=
"../resources/testharness.js"></script>
4 <script src=
"../resources/testharnessreport.js"></script>
7 var test
= async_test("Test setting the JSON object to undefined doesn't break XMLHttpRequest for responseType='json'.");
9 assert_equals("hello", window
.JSON
.parse('"hello"'));
10 window
.JSON
= undefined;
12 var xhr
= new XMLHttpRequest
;
13 xhr
.responseType
= 'json';
14 xhr
.open('GET', 'resources/test.json', true);
15 xhr
.onreadystatechange
= test
.step_func(function() {
16 if (xhr
.readyState
!= 4)
19 assert_equals(xhr
.status
, 200, 'xhr.status');
21 assert_equals(xhr
.response
.length
, 4, 'xhr.response.length')
22 assert_equals(xhr
.response
[0], 'a', 'xhr.response[0]');