refactor(test_lib): BrowserDetection util

Closes #3805
This commit is contained in:
Marc Laval
2015-08-24 15:41:36 +02:00
parent 551d9a1688
commit be07390859
8 changed files with 223 additions and 38 deletions

View File

@ -7,7 +7,8 @@ import {
iit,
SpyObject,
el,
normalizeCSS
normalizeCSS,
browserDetection
} from 'angular2/test_lib';
import {ShadowCss} from 'angular2/src/core/render/dom/compiler/shadow_css';
@ -66,8 +67,7 @@ export function main() {
});
}
if (DOM.getUserAgent().indexOf('AppleWebKit') > -1 &&
DOM.getUserAgent().indexOf('Edge') == -1) {
if (browserDetection.isWebkit) {
it('should handle -webkit-keyframes rules', () => {
var css = '@-webkit-keyframes foo {0% {-webkit-transform: translate(-50%) scaleX(0);}}';
var passRe =

View File

@ -11,9 +11,7 @@ import {
xit,
Log,
isInInnerZone,
isAndroid,
isEdge,
isIE
browserDetection
} from 'angular2/test_lib';
import {PromiseCompleter, PromiseWrapper, TimerWrapper} from 'angular2/src/core/facade/async';
@ -21,7 +19,8 @@ import {BaseException} from 'angular2/src/core/facade/lang';
import {NgZone} from 'angular2/src/core/zone/ng_zone';
var needsLongerTimers = isAndroid() || isEdge() || isIE();
var needsLongerTimers =
browserDetection.isAndroid || browserDetection.isEdge || browserDetection.isIE;
// Schedules a macrotask (using a timer)
function macroTask(fn: Function, timer = 1): void {
// adds longer timers for passing tests in IE and Edge