Joey Perrott d1ea1f4c7f build: update license headers to reference Google LLC ()
Update the license headers throughout the repository to reference Google LLC
rather than Google Inc, for the required license headers.

PR Close 
2020-05-26 14:26:58 -04:00

51 lines
1.3 KiB
TypeScript

/**
* @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.io/license
*/
export function forceReflow() {
(document.body as any)['_reflow'] = document.body.clientWidth;
}
export function makeAnimationEvent(
startOrEnd: 'start'|'end', animationName: string, elapsedTime: number, timestamp?: number) {
const e = new AnimationEvent('animation' + startOrEnd, {animationName, elapsedTime});
if (timestamp) {
(e as any)._ngTestManualTimestamp = timestamp;
}
return e;
}
export function supportsAnimationEventCreation() {
let supported = false;
try {
makeAnimationEvent('end', 'test', 0);
supported = true;
} catch {
}
return supported;
}
export function findKeyframeDefinition(sheet: any): any|null {
return sheet.cssRules[0] || null;
}
export function createElement() {
return document.createElement('div');
}
export function assertStyle(element: any, prop: string, value: string) {
expect(element.style[prop] || '').toEqual(value);
}
export function assertElementExistsInDom(element: any, yes?: boolean) {
const exp = expect(element.parentNode);
if (yes) {
exp.toBeTruthy();
} else {
exp.toBeFalsy();
}
}