chore(build): add Firefox to CI

This commit is contained in:
Marc Laval 2015-08-19 16:47:18 +02:00
parent 49997ca932
commit 1c9be9b5aa
3 changed files with 15 additions and 2 deletions

View File

@ -92,3 +92,8 @@ export function stringifyElement(el): string {
export function supportsIntlApi(): boolean {
return DOM.getUserAgent().indexOf('Chrome') > -1 && DOM.getUserAgent().indexOf('Edge') == -1;
}
// TODO(mlaval): extract all browser detection checks from all tests
export function isFirefox(): boolean {
return DOM.getUserAgent().indexOf("Firefox") > -1;
}

View File

@ -14,7 +14,8 @@ import {
it,
inject,
iit,
xit
xit,
isFirefox
} from 'angular2/test_lib';
import {DOM} from 'angular2/src/dom/dom_adapter';
@ -737,6 +738,13 @@ export function main() {
rootTC.componentInstance.form = form;
rootTC.detectChanges();
// In Firefox, effective text selection in the real DOM requires an actual focus
// of the field. This is not an issue in a new HTML document.
if (isFirefox()) {
var fakeDoc = DOM.createHtmlDocument();
DOM.appendChild(fakeDoc.body, rootTC.nativeElement);
}
var input = rootTC.query(By.css("input")).nativeElement;
input.value = "aa";
input.selectionStart = 1;

View File

@ -125,7 +125,7 @@ var aliases = {
'SAFARI': ['SL_SAFARI7', 'SL_SAFARI8'],
'BETA': ['SL_CHROMEBETA', 'SL_FIREFOXBETA'],
'DEV': ['SL_CHROMEDEV', 'SL_FIREFOXDEV'],
'CI': ['SL_CHROME', 'SL_ANDROID5.1', 'SL_SAFARI8', 'SL_IOS8']
'CI': ['SL_CHROME', 'SL_ANDROID5.1', 'SL_SAFARI8', 'SL_IOS8', 'SL_FIREFOX']
};
module.exports = {