michael@0: /* Any copyright is dedicated to the Public Domain. michael@0: * http://creativecommons.org/publicdomain/zero/1.0/ michael@0: */ michael@0: michael@0: // Test setting .responseType and .withCredentials is allowed michael@0: // in non-window non-Worker context michael@0: michael@0: function run_test() michael@0: { michael@0: var xhr = Components.classes['@mozilla.org/xmlextras/xmlhttprequest;1']. michael@0: createInstance(Components.interfaces.nsIXMLHttpRequest); michael@0: xhr.open('GET', 'data:,', false); michael@0: var exceptionThrown = false; michael@0: try { michael@0: xhr.responseType = ''; michael@0: xhr.withCredentials = false; michael@0: } catch (e) { michael@0: exceptionThrown = true; michael@0: } michael@0: do_check_eq(false, exceptionThrown); michael@0: }