Skip to content

Commit 65344fc

Browse files
committed
chore(build): add IE9 to CI
Closes angular#3747
1 parent ebb3236 commit 65344fc

File tree

6 files changed

+56
-43
lines changed

6 files changed

+56
-43
lines changed

modules/angular2/src/test_lib/shims_for_IE.js

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,4 +84,17 @@ if (!Object.hasOwnProperty('name')) {
8484
this.hash = hash;
8585
}
8686
global.URLPolyfill = URLPolyfill;
87-
})(typeof self != 'undefined' ? self : global);
87+
})(typeof self != 'undefined' ? self : global);
88+
89+
//classList (IE9)
90+
/*! @license please refer to http://unlicense.org/ */
91+
/*! @author Eli Grey */
92+
/*! @source https://github.com/eligrey/classList.js */
93+
;if("document" in self&&!("classList" in document.createElement("_"))){(function(j){"use strict";if(!("Element" in j)){return}var a="classList",f="prototype",m=j.Element[f],b=Object,k=String[f].trim||function(){return this.replace(/^\s+|\s+$/g,"")},c=Array[f].indexOf||function(q){var p=0,o=this.length;for(;p<o;p++){if(p in this&&this[p]===q){return p}}return -1},n=function(o,p){this.name=o;this.code=DOMException[o];this.message=p},g=function(p,o){if(o===""){throw new n("SYNTAX_ERR","An invalid or illegal string was specified")}if(/\s/.test(o)){throw new n("INVALID_CHARACTER_ERR","String contains an invalid character")}return c.call(p,o)},d=function(s){var r=k.call(s.getAttribute("class")||""),q=r?r.split(/\s+/):[],p=0,o=q.length;for(;p<o;p++){this.push(q[p])}this._updateClassName=function(){s.setAttribute("class",this.toString())}},e=d[f]=[],i=function(){return new d(this)};n[f]=Error[f];e.item=function(o){return this[o]||null};e.contains=function(o){o+="";return g(this,o)!==-1};e.add=function(){var s=arguments,r=0,p=s.length,q,o=false;do{q=s[r]+"";if(g(this,q)===-1){this.push(q);o=true}}while(++r<p);if(o){this._updateClassName()}};e.remove=function(){var t=arguments,s=0,p=t.length,r,o=false;do{r=t[s]+"";var q=g(this,r);if(q!==-1){this.splice(q,1);o=true}}while(++s<p);if(o){this._updateClassName()}};e.toggle=function(p,q){p+="";var o=this.contains(p),r=o?q!==true&&"remove":q!==false&&"add";if(r){this[r](p)}return !o};e.toString=function(){return this.join(" ")};if(b.defineProperty){var l={get:i,enumerable:true,configurable:true};try{b.defineProperty(m,a,l)}catch(h){if(h.number===-2146823252){l.enumerable=false;b.defineProperty(m,a,l)}}}else{if(b[f].__defineGetter__){m.__defineGetter__(a,i)}}}(self))};
94+
95+
//console mock (IE9)
96+
if (!window.console) window.console = {};
97+
if (!window.console.log) window.console.log = function () { };
98+
if (!window.console.error) window.console.error = function () { };
99+
if (!window.console.warn) window.console.warn = function () { };
100+
if (!window.console.assert) window.console.assert = function () { };

modules/angular2/test/core/zone/ng_zone_spec.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -269,8 +269,8 @@ function commonTests() {
269269
.toEqual(
270270
'onTurnStart; start run; nested run; end run; nested run microtask; onTurnDone');
271271
async.done();
272-
}, 80);
273-
}));
272+
}, 150);
273+
}), 200);
274274

275275
it('should not run onTurnStart and onTurnDone for nested Zone.run invoked from onTurnDone',
276276
inject([AsyncTestCompleter], (async) => {
@@ -512,7 +512,7 @@ function commonTests() {
512512
macroTask(() => { _zone.run(() => { completerA.resolve(null); }); }, 20);
513513

514514

515-
macroTask(() => { _zone.run(() => { completerB.resolve(null); }); }, 60);
515+
macroTask(() => { _zone.run(() => { completerB.resolve(null); }); }, 100);
516516

517517
macroTask(() => {
518518
expect(_log.result())
@@ -524,8 +524,8 @@ function commonTests() {
524524
// Third VM turn
525525
'onTurnStart; b then; onTurnDone');
526526
async.done();
527-
}, 90);
528-
}));
527+
}, 180);
528+
}), 200);
529529

530530
it('should call onTurnStart and onTurnDone before and after (respectively) all turns in a chain',
531531
inject([AsyncTestCompleter], (async) => {
@@ -597,8 +597,8 @@ function commonTests() {
597597
expect(_errors.length).toBe(1);
598598
expect(_errors[0]).toEqual(exception);
599599
async.done();
600-
}, 80);
601-
}));
600+
}, 150);
601+
}), 200);
602602

603603
it('should call onError when onTurnDone throws and the zone is sync',
604604
inject([AsyncTestCompleter], (async) => {

modules/angular2/test/router/location_spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ export function main() {
6363
expect(ev['url']).toEqual('/user/btford');
6464
async.done();
6565
})
66-
}));
66+
}), 1000);
6767

6868
it('should normalize location path', () => {
6969
locationStrategy.internalPath = '/my/app/user/btford';

modules/angular2/test/router/outlet_spec.ts

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ export function main() {
102102
expect(rootTC.nativeElement).toHaveText('hello');
103103
async.done();
104104
});
105-
}));
105+
}), 1000);
106106

107107

108108
it('should navigate between components with different parameters',
@@ -120,7 +120,7 @@ export function main() {
120120
expect(rootTC.nativeElement).toHaveText('hello igor');
121121
async.done();
122122
});
123-
}));
123+
}), 1000);
124124

125125

126126
it('should work with child routers', inject([AsyncTestCompleter], (async) => {
@@ -132,7 +132,7 @@ export function main() {
132132
expect(rootTC.nativeElement).toHaveText('outer { inner { hello } }');
133133
async.done();
134134
});
135-
}));
135+
}), 1000);
136136

137137

138138
it('should work with redirects', inject([AsyncTestCompleter, Location], (async, location) => {
@@ -148,7 +148,7 @@ export function main() {
148148
expect(location.urlChanges).toEqual(['/redirected']);
149149
async.done();
150150
});
151-
}));
151+
}), 1000);
152152

153153
function getHref(tc) {
154154
return DOM.getAttribute(tc.componentViewChildren[0].nativeElement, 'href');
@@ -165,7 +165,7 @@ export function main() {
165165
expect(getHref(rootTC)).toEqual('/my/base/user');
166166
async.done();
167167
});
168-
}));
168+
}), 1000);
169169

170170

171171
it('should generate link hrefs without params', inject([AsyncTestCompleter], (async) => {
@@ -177,7 +177,7 @@ export function main() {
177177
expect(getHref(rootTC)).toEqual('/user');
178178
async.done();
179179
});
180-
}));
180+
}), 1000);
181181

182182

183183
it('should reuse common parent components', inject([AsyncTestCompleter], (async) => {
@@ -196,7 +196,7 @@ export function main() {
196196
expect(rootTC.nativeElement).toHaveText('team angular { hello victor }');
197197
async.done();
198198
});
199-
}));
199+
}), 1000);
200200

201201

202202
it('should generate link hrefs with params', inject([AsyncTestCompleter], (async) => {
@@ -212,7 +212,7 @@ export function main() {
212212
.toEqual('/user/brian');
213213
async.done();
214214
});
215-
}));
215+
}), 1000);
216216

217217
it('should generate link hrefs from a child to its sibling',
218218
inject([AsyncTestCompleter], (async) => {
@@ -228,7 +228,7 @@ export function main() {
228228
.toEqual('/page/2');
229229
async.done();
230230
});
231-
}));
231+
}), 1000);
232232

233233
it('should generate relative links preserving the existing parent route',
234234
inject([AsyncTestCompleter], (async) => {
@@ -251,7 +251,7 @@ export function main() {
251251
.toEqual('/book/1984/page/2');
252252
async.done();
253253
});
254-
}));
254+
}), 1000);
255255

256256
it('should inject RouteData into component', inject([AsyncTestCompleter], (async) => {
257257
compile()
@@ -264,7 +264,7 @@ export function main() {
264264
expect(rootTC.nativeElement).toHaveText(Json.stringify({'isAdmin': true}));
265265
async.done();
266266
});
267-
}));
267+
}), 1000);
268268

269269
it('should inject RouteData into component with AsyncRoute',
270270
inject([AsyncTestCompleter], (async) => {
@@ -279,7 +279,7 @@ export function main() {
279279
expect(rootTC.nativeElement).toHaveText(Json.stringify({'isAdmin': true}));
280280
async.done();
281281
});
282-
}));
282+
}), 1000);
283283

284284
it('should inject nested RouteData into component', inject([AsyncTestCompleter], (async) => {
285285
compile()
@@ -297,7 +297,7 @@ export function main() {
297297
.toHaveText(Json.stringify({'isAdmin': true, 'test': {'moreData': 'testing'}}));
298298
async.done();
299299
});
300-
}));
300+
}), 1000);
301301

302302
it('should inject null if the route has no data property',
303303
inject([AsyncTestCompleter], (async) => {
@@ -310,7 +310,7 @@ export function main() {
310310
expect(rootTC.nativeElement).toHaveText('null');
311311
async.done();
312312
});
313-
}));
313+
}), 1000);
314314

315315
it('should allow an array as the route data', inject([AsyncTestCompleter], (async) => {
316316
compile()
@@ -323,7 +323,7 @@ export function main() {
323323
expect(rootTC.nativeElement).toHaveText(Json.stringify([1, 2, 3]));
324324
async.done();
325325
});
326-
}));
326+
}), 1000);
327327

328328
it('should allow a string as the route data', inject([AsyncTestCompleter], (async) => {
329329
compile()
@@ -337,7 +337,7 @@ export function main() {
337337
expect(rootTC.nativeElement).toHaveText(Json.stringify('hello world'));
338338
async.done();
339339
});
340-
}));
340+
}), 1000);
341341

342342
describe('lifecycle hooks', () => {
343343
it('should call the onActivate hook', inject([AsyncTestCompleter], (async) => {
@@ -350,7 +350,7 @@ export function main() {
350350
expect(log).toEqual(['activate: null -> /on-activate']);
351351
async.done();
352352
});
353-
}));
353+
}), 1000);
354354

355355
it('should wait for a parent component\'s onActivate hook to resolve before calling its child\'s',
356356
inject([AsyncTestCompleter], (async) => {
@@ -373,7 +373,7 @@ export function main() {
373373
async.done();
374374
});
375375
});
376-
}));
376+
}), 1000);
377377

378378
it('should call the onDeactivate hook', inject([AsyncTestCompleter], (async) => {
379379
compile()
@@ -386,7 +386,7 @@ export function main() {
386386
expect(log).toEqual(['deactivate: /on-deactivate -> /a']);
387387
async.done();
388388
});
389-
}));
389+
}), 1000);
390390

391391
it('should wait for a child component\'s onDeactivate hook to resolve before calling its parent\'s',
392392
inject([AsyncTestCompleter], (async) => {
@@ -411,7 +411,7 @@ export function main() {
411411
async.done();
412412
});
413413
});
414-
}));
414+
}), 1000);
415415

416416
it('should reuse a component when the canReuse hook returns true',
417417
inject([AsyncTestCompleter], (async) => {
@@ -432,7 +432,7 @@ export function main() {
432432
expect(cmpInstanceCount).toBe(1);
433433
async.done();
434434
});
435-
}));
435+
}), 1000);
436436

437437

438438
it('should not reuse a component when the canReuse hook returns false',
@@ -454,7 +454,7 @@ export function main() {
454454
expect(cmpInstanceCount).toBe(2);
455455
async.done();
456456
});
457-
}));
457+
}), 1000);
458458

459459

460460
it('should navigate when canActivate returns true', inject([AsyncTestCompleter], (async) => {
@@ -474,7 +474,7 @@ export function main() {
474474
async.done();
475475
});
476476
});
477-
}));
477+
}), 1000);
478478

479479
it('should not navigate when canActivate returns false',
480480
inject([AsyncTestCompleter], (async) => {
@@ -494,7 +494,7 @@ export function main() {
494494
async.done();
495495
});
496496
});
497-
}));
497+
}), 1000);
498498

499499
it('should navigate away when canDeactivate returns true',
500500
inject([AsyncTestCompleter], (async) => {
@@ -519,7 +519,7 @@ export function main() {
519519
async.done();
520520
});
521521
});
522-
}));
522+
}), 1000);
523523

524524
it('should not navigate away when canDeactivate returns false',
525525
inject([AsyncTestCompleter], (async) => {
@@ -544,7 +544,7 @@ export function main() {
544544
async.done();
545545
});
546546
});
547-
}));
547+
}), 1000);
548548

549549

550550
it('should run activation and deactivation hooks in the correct order',
@@ -572,7 +572,7 @@ export function main() {
572572
]);
573573
async.done();
574574
});
575-
}));
575+
}), 1000);
576576

577577
it('should only run reuse hooks when reusing', inject([AsyncTestCompleter], (async) => {
578578
compile()
@@ -599,7 +599,7 @@ export function main() {
599599
]);
600600
async.done();
601601
});
602-
}));
602+
}), 1000);
603603

604604
it('should not run reuse hooks when not reusing', inject([AsyncTestCompleter], (async) => {
605605
compile()
@@ -628,7 +628,7 @@ export function main() {
628628
]);
629629
async.done();
630630
});
631-
}));
631+
}), 1000);
632632

633633
});
634634

modules/angular2/test/router/route_config_spec.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ export function main() {
6565
});
6666
router.navigate('/parent/child');
6767
});
68-
}));
68+
}), 1000);
6969

7070

7171
it('should work in an app with redirects', inject([AsyncTestCompleter], (async) => {
@@ -79,7 +79,7 @@ export function main() {
7979
});
8080
router.navigate('/before');
8181
});
82-
}));
82+
}), 1000);
8383

8484

8585
it('should work in an app with async components', inject([AsyncTestCompleter], (async) => {
@@ -93,7 +93,7 @@ export function main() {
9393
});
9494
router.navigate('/hello');
9595
});
96-
}));
96+
}), 1000);
9797

9898

9999
it('should work in an app with a constructor component',
@@ -108,7 +108,7 @@ export function main() {
108108
});
109109
router.navigate('/hello');
110110
});
111-
}));
111+
}), 1000);
112112

113113
it('should throw if a config is missing a target',
114114
inject(

sauce.conf.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ var aliases = {
125125
'SAFARI': ['SL_SAFARI7', 'SL_SAFARI8'],
126126
'BETA': ['SL_CHROMEBETA', 'SL_FIREFOXBETA'],
127127
'DEV': ['SL_CHROMEDEV', 'SL_FIREFOXDEV'],
128-
'CI': ['SL_CHROME', 'SL_ANDROID5.1', 'SL_SAFARI8', 'SL_IOS8', 'SL_FIREFOX', 'SL_IE11', 'SL_IE10']
128+
'CI': ['SL_CHROME', 'SL_ANDROID5.1', 'SL_SAFARI8', 'SL_IOS8', 'SL_FIREFOX', 'SL_IE11', 'SL_IE10', 'SL_IE9']
129129
};
130130

131131
module.exports = {

0 commit comments

Comments
 (0)