1 |
- {"version":3,"file":"testing.js","sources":["../../../packages/platform-browser/esm5/testing/src/browser_util.js","../../../packages/platform-browser/esm5/testing/src/browser.js","../../../packages/platform-browser/esm5/testing/src/testing.js","../../../packages/platform-browser/esm5/testing/public_api.js","../../../packages/platform-browser/esm5/testing/testing.js"],"sourcesContent":["/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport { NgZone, ɵglobal as global } from '@angular/core';\nimport { ɵgetDOM as getDOM } from '@angular/platform-browser';\nexport var /** @type {?} */ browserDetection;\nvar BrowserDetection = /** @class */ (function () {\n function BrowserDetection(ua) {\n this._overrideUa = ua;\n }\n Object.defineProperty(BrowserDetection.prototype, \"_ua\", {\n get: /**\n * @return {?}\n */\n function () {\n if (typeof this._overrideUa === 'string') {\n return this._overrideUa;\n }\n return getDOM() ? getDOM().getUserAgent() : '';\n },\n enumerable: true,\n configurable: true\n });\n /**\n * @return {?}\n */\n BrowserDetection.setup = /**\n * @return {?}\n */\n function () { browserDetection = new BrowserDetection(null); };\n Object.defineProperty(BrowserDetection.prototype, \"isFirefox\", {\n get: /**\n * @return {?}\n */\n function () { return this._ua.indexOf('Firefox') > -1; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(BrowserDetection.prototype, \"isAndroid\", {\n get: /**\n * @return {?}\n */\n function () {\n return this._ua.indexOf('Mozilla/5.0') > -1 && this._ua.indexOf('Android') > -1 &&\n this._ua.indexOf('AppleWebKit') > -1 && this._ua.indexOf('Chrome') == -1 &&\n this._ua.indexOf('IEMobile') == -1;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(BrowserDetection.prototype, \"isEdge\", {\n get: /**\n * @return {?}\n */\n function () { return this._ua.indexOf('Edge') > -1; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(BrowserDetection.prototype, \"isIE\", {\n get: /**\n * @return {?}\n */\n function () { return this._ua.indexOf('Trident') > -1; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(BrowserDetection.prototype, \"isWebkit\", {\n get: /**\n * @return {?}\n */\n function () {\n return this._ua.indexOf('AppleWebKit') > -1 && this._ua.indexOf('Edge') == -1 &&\n this._ua.indexOf('IEMobile') == -1;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(BrowserDetection.prototype, \"isIOS7\", {\n get: /**\n * @return {?}\n */\n function () {\n return (this._ua.indexOf('iPhone OS 7') > -1 || this._ua.indexOf('iPad OS 7') > -1) &&\n this._ua.indexOf('IEMobile') == -1;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(BrowserDetection.prototype, \"isSlow\", {\n get: /**\n * @return {?}\n */\n function () { return this.isAndroid || this.isIE || this.isIOS7; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(BrowserDetection.prototype, \"supportsNativeIntlApi\", {\n // The Intl API is only natively supported in Chrome, Firefox, IE11 and Edge.\n // This detector is needed in tests to make the difference between:\n // 1) IE11/Edge: they have a native Intl API, but with some discrepancies\n // 2) IE9/IE10: they use the polyfill, and so no discrepancies\n get: /**\n * @return {?}\n */\n function () {\n return !!(/** @type {?} */ (global)).Intl && (/** @type {?} */ (global)).Intl !== (/** @type {?} */ (global)).IntlPolyfill;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(BrowserDetection.prototype, \"isChromeDesktop\", {\n get: /**\n * @return {?}\n */\n function () {\n return this._ua.indexOf('Chrome') > -1 && this._ua.indexOf('Mobile Safari') == -1 &&\n this._ua.indexOf('Edge') == -1;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(BrowserDetection.prototype, \"isOldChrome\", {\n // \"Old Chrome\" means Chrome 3X, where there are some discrepancies in the Intl API.\n // Android 4.4 and 5.X have such browsers by default (respectively 30 and 39).\n get: /**\n * @return {?}\n */\n function () {\n return this._ua.indexOf('Chrome') > -1 && this._ua.indexOf('Chrome/3') > -1 &&\n this._ua.indexOf('Edge') == -1;\n },\n enumerable: true,\n configurable: true\n });\n return BrowserDetection;\n}());\nexport { BrowserDetection };\nfunction BrowserDetection_tsickle_Closure_declarations() {\n /** @type {?} */\n BrowserDetection.prototype._overrideUa;\n}\nBrowserDetection.setup();\n/**\n * @param {?} element\n * @param {?} eventType\n * @return {?}\n */\nexport function dispatchEvent(element, eventType) {\n getDOM().dispatchEvent(element, getDOM().createEvent(eventType));\n}\n/**\n * @param {?} html\n * @return {?}\n */\nexport function el(html) {\n return /** @type {?} */ (getDOM().firstChild(getDOM().content(getDOM().createTemplate(html))));\n}\n/**\n * @param {?} css\n * @return {?}\n */\nexport function normalizeCSS(css) {\n return css.replace(/\\s+/g, ' ')\n .replace(/:\\s/g, ':')\n .replace(/'/g, '\"')\n .replace(/ }/g, '}')\n .replace(/url\\((\\\"|\\s)(.+)(\\\"|\\s)\\)(\\s*)/g, function () {\n var match = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n match[_i] = arguments[_i];\n }\n return \"url(\\\"\" + match[2] + \"\\\")\";\n })\n .replace(/\\[(.+)=([^\"\\]]+)\\]/g, function () {\n var match = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n match[_i] = arguments[_i];\n }\n return \"[\" + match[1] + \"=\\\"\" + match[2] + \"\\\"]\";\n });\n}\nvar /** @type {?} */ _singleTagWhitelist = ['br', 'hr', 'input'];\n/**\n * @param {?} el\n * @return {?}\n */\nexport function stringifyElement(el /** TODO #9100 */) {\n var /** @type {?} */ result = '';\n if (getDOM().isElementNode(el)) {\n var /** @type {?} */ tagName = getDOM().tagName(el).toLowerCase();\n // Opening tag\n result += \"<\" + tagName;\n // Attributes in an ordered way\n var /** @type {?} */ attributeMap = getDOM().attributeMap(el);\n var /** @type {?} */ keys = Array.from(attributeMap.keys()).sort();\n for (var /** @type {?} */ i = 0; i < keys.length; i++) {\n var /** @type {?} */ key = keys[i];\n var /** @type {?} */ attValue = attributeMap.get(key);\n var /** @type {?} */ lowerCaseKey = key.toLowerCase();\n if (typeof attValue !== 'string') {\n result += \" \" + lowerCaseKey;\n }\n else {\n result += \" \" + lowerCaseKey + \"=\\\"\" + attValue + \"\\\"\";\n }\n }\n result += '>';\n // Children\n var /** @type {?} */ childrenRoot = getDOM().templateAwareRoot(el);\n var /** @type {?} */ children = childrenRoot ? getDOM().childNodes(childrenRoot) : [];\n for (var /** @type {?} */ j = 0; j < children.length; j++) {\n result += stringifyElement(children[j]);\n }\n // Closing tag\n if (_singleTagWhitelist.indexOf(tagName) == -1) {\n result += \"</\" + tagName + \">\";\n }\n }\n else if (getDOM().isCommentNode(el)) {\n result += \"<!--\" + getDOM().nodeValue(el) + \"-->\";\n }\n else {\n result += getDOM().getText(el);\n }\n return result;\n}\n/**\n * @return {?}\n */\nexport function createNgZone() {\n return new NgZone({ enableLongStackTrace: true });\n}\n//# sourceMappingURL=browser_util.js.map","/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\nimport { APP_ID, NgModule, NgZone, PLATFORM_INITIALIZER, createPlatformFactory, platformCore } from '@angular/core';\nimport { BrowserModule, ɵBrowserDomAdapter as BrowserDomAdapter, ɵELEMENT_PROBE_PROVIDERS as ELEMENT_PROBE_PROVIDERS } from '@angular/platform-browser';\nimport { BrowserDetection, createNgZone } from './browser_util';\n/**\n * @return {?}\n */\nfunction initBrowserTests() {\n BrowserDomAdapter.makeCurrent();\n BrowserDetection.setup();\n}\nvar /** @type {?} */ _TEST_BROWSER_PLATFORM_PROVIDERS = [{ provide: PLATFORM_INITIALIZER, useValue: initBrowserTests, multi: true }];\n/**\n * Platform for testing\n *\n * \\@stable\n */\nexport var /** @type {?} */ platformBrowserTesting = createPlatformFactory(platformCore, 'browserTesting', _TEST_BROWSER_PLATFORM_PROVIDERS);\nvar ɵ0 = createNgZone;\n/**\n * NgModule for testing.\n *\n * \\@stable\n */\nvar BrowserTestingModule = /** @class */ (function () {\n function BrowserTestingModule() {\n }\n BrowserTestingModule.decorators = [\n { type: NgModule, args: [{\n exports: [BrowserModule],\n providers: [\n { provide: APP_ID, useValue: 'a' },\n ELEMENT_PROBE_PROVIDERS,\n { provide: NgZone, useFactory: ɵ0 },\n ]\n },] },\n ];\n /** @nocollapse */\n BrowserTestingModule.ctorParameters = function () { return []; };\n return BrowserTestingModule;\n}());\nexport { BrowserTestingModule };\nfunction BrowserTestingModule_tsickle_Closure_declarations() {\n /** @type {!Array<{type: !Function, args: (undefined|!Array<?>)}>} */\n BrowserTestingModule.decorators;\n /**\n * @nocollapse\n * @type {function(): !Array<(null|{type: ?, decorators: (undefined|!Array<{type: !Function, args: (undefined|!Array<?>)}>)})>}\n */\n BrowserTestingModule.ctorParameters;\n}\nexport { ɵ0 };\n//# sourceMappingURL=browser.js.map","/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * @module\n * @description\n * Entry point for all public APIs of the platform-browser/testing package.\n */\nexport { platformBrowserTesting, BrowserTestingModule } from './browser';\n//# sourceMappingURL=testing.js.map","/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * @module\n * @description\n * Entry point for all public APIs of this package.\n */\nexport { platformBrowserTesting, BrowserTestingModule } from './src/testing';\n//# sourceMappingURL=public_api.js.map","/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * Generated bundle index. Do not edit.\n */\nexport { platformBrowserTesting, BrowserTestingModule } from './public_api';\nexport { createNgZone as ɵa } from './src/browser_util';\n//# sourceMappingURL=testing.js.map"],"names":["getDOM","global","BrowserDomAdapter","ELEMENT_PROBE_PROVIDERS"],"mappings":";;;;;;;;AAAA;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