build: reformat repo to new clang@1.4.0 (#36613)

PR Close #36613
This commit is contained in:
Joey Perrott
2020-04-13 16:40:21 -07:00
committed by atscott
parent 5e80e7e216
commit 698b0288be
1160 changed files with 31667 additions and 24000 deletions

View File

@ -13,7 +13,9 @@ const wtfMock = global.wtfMock;
describe('XMLHttpRequest', function() {
let testZone: Zone;
beforeEach(() => { testZone = Zone.current.fork({name: 'test'}); });
beforeEach(() => {
testZone = Zone.current.fork({name: 'test'});
});
it('should intercept XHRs and treat them as MacroTasks', function(done) {
let req: XMLHttpRequest;
@ -30,7 +32,9 @@ describe('XMLHttpRequest', function() {
testZoneWithWtf.run(() => {
req = new XMLHttpRequest();
const logs: string[] = [];
req.onload = () => { logs.push('onload'); };
req.onload = () => {
logs.push('onload');
};
onStable = function() {
expect(wtfMock.log[wtfMock.log.length - 2])
.toEqual('> Zone:invokeTask:XMLHttpRequest.send("<root>::ProxyZone::WTF::TestZone")');
@ -96,7 +100,7 @@ describe('XMLHttpRequest', function() {
req.open('get', '/', true);
});
req !.send();
req!.send();
});
it('should return null when access ontimeout first time without error', function() {
@ -104,7 +108,9 @@ describe('XMLHttpRequest', function() {
expect(req.ontimeout).toBe(null);
});
const supportsOnProgress = function() { return 'onprogress' in (new XMLHttpRequest()); };
const supportsOnProgress = function() {
return 'onprogress' in (new XMLHttpRequest());
};
(<any>supportsOnProgress).message = 'XMLHttpRequest.onprogress';
@ -122,7 +128,7 @@ describe('XMLHttpRequest', function() {
req.open('get', '/', true);
});
req !.send();
req!.send();
});
it('should allow canceling of an XMLHttpRequest', function(done) {
@ -132,13 +138,14 @@ describe('XMLHttpRequest', function() {
const trackingTestZone = Zone.current.fork({
name: 'tracking test zone',
onHasTask: (delegate: ZoneDelegate, current: Zone, target: Zone,
hasTaskState: HasTaskState) => {
if (hasTaskState.change == 'macroTask') {
pending = hasTaskState.macroTask;
}
delegate.hasTask(target, hasTaskState);
}
onHasTask:
(delegate: ZoneDelegate, current: Zone, target: Zone,
hasTaskState: HasTaskState) => {
if (hasTaskState.change == 'macroTask') {
pending = hasTaskState.macroTask;
}
delegate.hasTask(target, hasTaskState);
}
});
trackingTestZone.run(function() {
@ -234,8 +241,12 @@ describe('XMLHttpRequest', function() {
req.onload = function() {
req.onload = null as any;
req.open('get', '/', true);
req.onload = function() { done(); };
expect(() => { req.send(); }).not.toThrow();
req.onload = function() {
done();
};
expect(() => {
req.send();
}).not.toThrow();
};
});
});
@ -248,7 +259,9 @@ describe('XMLHttpRequest', function() {
req.send();
req.addEventListener('readystatechange', function(ev) {
if (req.readyState >= 2) {
expect(() => { req.abort(); }).not.toThrow();
expect(() => {
req.abort();
}).not.toThrow();
done();
}
});
@ -374,7 +387,9 @@ describe('XMLHttpRequest', function() {
}
};
expect(req.onreadystatechange).toBe(listener);
req.onreadystatechange = function() { return listener.call(this); };
req.onreadystatechange = function() {
return listener.call(this);
};
req.send();
});
}));