/
githubmirror
/
angular
Обзор
Документация
Войти
/
githubmirror
/
angular
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
packages/zone.js/test/performance/xhr.js
51 строка
2 KB
Joey Perrott
refactor: update license text to point to angular.dev (#57901)
24 сен 2024, 16:33
24 сен 2024, 16:33
9dbe6fc
Код
Авторство
О чём код?
/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.dev/license */ (function (_global) { var mark = _global['__zone_symbol__mark']; var measure = _global['__zone_symbol__measure']; var testRunner = _global['__zone_symbol__testRunner']; var zone = _global['__zone_symbol__callbackZone']; var testTarget = { title: 'xhr', times: 3, count: 1000, before: function () { _global['__zone_symbol__callbackContext'].measureName = 'xhr_callback'; _global['__zone_symbol__callbackContext'].type = 'macroTask'; _global['__zone_symbol__callbackContext'].source = 'send'; }, apis: [ { supportClear: true, method: 'XHR.send', nativeMethod: 'native.XHR.send', clearMethod: 'XHR.abort', nativeClearMethod: 'native.XHR.abort', run: function () { var xhr = new XMLHttpRequest(); xhr.open('get', 'http://localhost:8080', true); xhr.send(); return xhr; }, runClear: function (xhr) { xhr.abort(); }, nativeRun: function () { var xhr = new XMLHttpRequest(); xhr['__zone_symbol__open']('get', 'http://localhost:8080', true); xhr['__zone_symbol__send'](); return xhr; }, nativeRunClear: function (xhr) { xhr['__zone_symbol__abort'](); }, }, ], }; return testRunner(testTarget); })(typeof window === 'undefined' ? global : window);