-
Notifications
You must be signed in to change notification settings - Fork 176
/
browser.js.map
1 lines (1 loc) · 117 KB
/
browser.js.map
1
{"version":3,"file":"browser.js.map","sources":["browser/environment/helpers.js","browser/config.js","browser/util.js","browser/childrunner.js","browser/clisocket.js","browser/reporters/console.js","browser/reporters/html.js","browser/reporters/multi.js","browser/reporters/title.js","browser/suites.js","browser/reporters.js","browser/environment.js","browser/environment/errors.js","browser/mocha/extend.js","browser/mocha/fixture.js","browser/mocha/stub.js","browser/mocha/replace.js","browser/mocha.js","browser/index.js"],"sourcesContent":["/**\n * @license\n * Copyright (c) 2014 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at\n * http://polymer.github.io/LICENSE.txt The complete set of authors may be found\n * at http://polymer.github.io/AUTHORS.txt The complete set of contributors may\n * be found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by\n * Google as part of the polymer project is also subject to an additional IP\n * rights grant found at http://polymer.github.io/PATENTS.txt\n */\n// Make sure that we use native timers, in case they're being stubbed out.\nvar nativeSetInterval = window.setInterval;\nvar nativeSetTimeout = window.setTimeout;\nvar nativeRequestAnimationFrame = window.requestAnimationFrame;\n/**\n * Runs `stepFn`, catching any error and passing it to `callback` (Node-style).\n * Otherwise, calls `callback` with no arguments on success.\n *\n * @param {function()} callback\n * @param {function()} stepFn\n */\nfunction safeStep(callback, stepFn) {\n var err;\n try {\n stepFn();\n }\n catch (error) {\n err = error;\n }\n callback(err);\n}\n/**\n * Runs your test at declaration time (before Mocha has begun tests). Handy for\n * when you need to test document initialization.\n *\n * Be aware that any errors thrown asynchronously cannot be tied to your test.\n * You may want to catch them and pass them to the done event, instead. See\n * `safeStep`.\n *\n * @param {string} name The name of the test.\n * @param {function(?function())} testFn The test function. If an argument is\n * accepted, the test will be treated as async, just like Mocha tests.\n */\nfunction testImmediate(name, testFn) {\n if (testFn.length > 0) {\n return testImmediateAsync(name, testFn);\n }\n var err;\n try {\n testFn();\n }\n catch (error) {\n err = error;\n }\n test(name, function (done) {\n done(err);\n });\n}\n/**\n * An async-only variant of `testImmediate`.\n *\n * @param {string} name\n * @param {function(?function())} testFn\n */\nfunction testImmediateAsync(name, testFn) {\n var testComplete = false;\n var err;\n test(name, function (done) {\n var intervalId = nativeSetInterval(function () {\n if (!testComplete)\n return;\n clearInterval(intervalId);\n done(err);\n }, 10);\n });\n try {\n testFn(function (error) {\n if (error)\n err = error;\n testComplete = true;\n });\n }\n catch (error) {\n err = error;\n testComplete = true;\n }\n}\n/**\n * Triggers a flush of any pending events, observations, etc and calls you back\n * after they have been processed.\n *\n * @param {function()} callback\n */\nfunction flush(callback) {\n // Ideally, this function would be a call to Polymer.dom.flush, but that\n // doesn't support a callback yet\n // (https://github.com/Polymer/polymer-dev/issues/851),\n // ...and there's cross-browser flakiness to deal with.\n // Make sure that we're invoking the callback with no arguments so that the\n // caller can pass Mocha callbacks, etc.\n var done = function done() {\n callback();\n };\n // Because endOfMicrotask is flaky for IE, we perform microtask checkpoints\n // ourselves (https://github.com/Polymer/polymer-dev/issues/114):\n var isIE = navigator.appName === 'Microsoft Internet Explorer';\n if (isIE && window.Platform && window.Platform.performMicrotaskCheckpoint) {\n var reallyDone_1 = done;\n done = function doneIE() {\n Platform.performMicrotaskCheckpoint();\n nativeSetTimeout(reallyDone_1, 0);\n };\n }\n // Everyone else gets a regular flush.\n var scope;\n if (window.Polymer && window.Polymer.dom && window.Polymer.dom.flush) {\n scope = window.Polymer.dom;\n }\n else if (window.Polymer && window.Polymer.flush) {\n scope = window.Polymer;\n }\n else if (window.WebComponents && window.WebComponents.flush) {\n scope = window.WebComponents;\n }\n if (scope) {\n scope.flush();\n }\n // Ensure that we are creating a new _task_ to allow all active microtasks to\n // finish (the code you're testing may be using endOfMicrotask, too).\n nativeSetTimeout(done, 0);\n}\n/**\n * Advances a single animation frame.\n *\n * Calls `flush`, `requestAnimationFrame`, `flush`, and `callback` sequentially\n * @param {function()} callback\n */\nfunction animationFrameFlush(callback) {\n flush(function () {\n nativeRequestAnimationFrame(function () {\n flush(callback);\n });\n });\n}\n/**\n * DEPRECATED: Use `flush`.\n * @param {function} callback\n */\nfunction asyncPlatformFlush(callback) {\n console.warn('asyncPlatformFlush is deprecated in favor of the more terse flush()');\n return window.flush(callback);\n}\n/**\n *\n */\nfunction waitFor(fn, next, intervalOrMutationEl, timeout, timeoutTime) {\n timeoutTime = timeoutTime || Date.now() + (timeout || 1000);\n intervalOrMutationEl = intervalOrMutationEl || 32;\n try {\n fn();\n }\n catch (e) {\n if (Date.now() > timeoutTime) {\n throw e;\n }\n else {\n if (typeof intervalOrMutationEl !== 'number') {\n intervalOrMutationEl.onMutation(intervalOrMutationEl, function () {\n waitFor(fn, next, intervalOrMutationEl, timeout, timeoutTime);\n });\n }\n else {\n nativeSetTimeout(function () {\n waitFor(fn, next, intervalOrMutationEl, timeout, timeoutTime);\n }, intervalOrMutationEl);\n }\n return;\n }\n }\n next();\n}\nwindow.safeStep = safeStep;\nwindow.testImmediate = testImmediate;\nwindow.testImmediateAsync = testImmediateAsync;\nwindow.flush = flush;\nwindow.animationFrameFlush = animationFrameFlush;\nwindow.asyncPlatformFlush = asyncPlatformFlush;\nwindow.waitFor = waitFor;\n","/**\n * @license\n * Copyright (c) 2014 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at\n * http://polymer.github.io/LICENSE.txt The complete set of authors may be found\n * at http://polymer.github.io/AUTHORS.txt The complete set of contributors may\n * be found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by\n * Google as part of the polymer project is also subject to an additional IP\n * rights grant found at http://polymer.github.io/PATENTS.txt\n */\nimport ChildRunner from './childrunner.js';\nimport * as util from './util.js';\n/**\n * The global configuration state for WCT's browser client.\n */\nexport var _config = {\n environmentScripts: !!window.__wctUseNpm ?\n [\n 'stacky/browser.js', 'async/lib/async.js', 'lodash/index.js',\n 'mocha/mocha.js', 'chai/chai.js', '@polymer/sinonjs/sinon.js',\n 'sinon-chai/lib/sinon-chai.js',\n 'accessibility-developer-tools/dist/js/axs_testing.js',\n '@polymer/test-fixture/test-fixture.js'\n ] :\n [\n 'stacky/browser.js', 'async/lib/async.js', 'lodash/lodash.js',\n 'mocha/mocha.js', 'chai/chai.js', 'sinonjs/sinon.js',\n 'sinon-chai/lib/sinon-chai.js',\n 'accessibility-developer-tools/dist/js/axs_testing.js'\n ],\n environmentImports: !!window.__wctUseNpm ? [] :\n ['test-fixture/test-fixture.html'],\n root: null,\n waitForFrameworks: true,\n waitFor: null,\n numConcurrentSuites: 1,\n trackConsoleError: true,\n mochaOptions: { timeout: 10 * 1000 },\n verbose: false,\n};\n/**\n * Merges initial `options` into WCT's global configuration.\n *\n * @param {Object} options The options to merge. See `browser/config.js` for a\n * reference.\n */\nexport function setup(options) {\n var childRunner = ChildRunner.current();\n if (childRunner) {\n _deepMerge(_config, childRunner.parentScope.WCT._config);\n // But do not force the mocha UI\n delete _config.mochaOptions.ui;\n }\n if (options && typeof options === 'object') {\n _deepMerge(_config, options);\n }\n if (!_config.root) {\n // Sibling dependencies.\n var root = util.scriptPrefix('browser.js');\n _config.root = util.basePath(root.substr(0, root.length - 1));\n if (!_config.root) {\n throw new Error('Unable to detect root URL for WCT sources. Please set WCT.root before including browser.js');\n }\n }\n}\n/**\n * Retrieves a configuration value.\n */\nexport function get(key) {\n return _config[key];\n}\n// Internal\nfunction _deepMerge(target, source) {\n Object.keys(source).forEach(function (key) {\n if (target[key] !== null && typeof target[key] === 'object' &&\n !Array.isArray(target[key])) {\n _deepMerge(target[key], source[key]);\n }\n else {\n target[key] = source[key];\n }\n });\n}\n","/**\n * @license\n * Copyright (c) 2014 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at\n * http://polymer.github.io/LICENSE.txt The complete set of authors may be found\n * at http://polymer.github.io/AUTHORS.txt The complete set of contributors may\n * be found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by\n * Google as part of the polymer project is also subject to an additional IP\n * rights grant found at http://polymer.github.io/PATENTS.txt\n */\nimport * as config from './config.js';\n/**\n * @param {function()} callback A function to call when the active web component\n * frameworks have loaded.\n */\nexport function whenFrameworksReady(callback) {\n debug('whenFrameworksReady');\n var done = function () {\n debug('whenFrameworksReady done');\n callback();\n };\n // If webcomponents script is in the document, wait for WebComponentsReady.\n if (window.WebComponents && !window.WebComponents.ready) {\n debug('WebComponentsReady?');\n window.addEventListener('WebComponentsReady', function wcReady() {\n window.removeEventListener('WebComponentsReady', wcReady);\n debug('WebComponentsReady');\n done();\n });\n }\n else {\n done();\n }\n}\n/**\n * @return {string} '<count> <kind> tests' or '<count> <kind> test'.\n */\nexport function pluralizedStat(count, kind) {\n if (count === 1) {\n return count + ' ' + kind + ' test';\n }\n else {\n return count + ' ' + kind + ' tests';\n }\n}\n/**\n * @param {string} path The URI of the script to load.\n * @param {function} done\n */\nexport function loadScript(path, done) {\n var script = document.createElement('script');\n script.src = path;\n if (done) {\n script.onload = done.bind(null, null);\n script.onerror = done.bind(null, 'Failed to load script ' + script.src);\n }\n document.head.appendChild(script);\n}\n/**\n * @param {string} path The URI of the stylesheet to load.\n * @param {function} done\n */\nexport function loadStyle(path, done) {\n var link = document.createElement('link');\n link.rel = 'stylesheet';\n link.href = path;\n if (done) {\n link.onload = done.bind(null, null);\n link.onerror = done.bind(null, 'Failed to load stylesheet ' + link.href);\n }\n document.head.appendChild(link);\n}\n/**\n * @param {...*} var_args Logs values to the console when the `debug`\n * configuration option is true.\n */\nexport function debug() {\n var var_args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n var_args[_i] = arguments[_i];\n }\n if (!config.get('verbose')) {\n return;\n }\n var args = [window.location.pathname].concat(var_args);\n (console.debug || console.log).apply(console, args);\n}\n// URL Processing\n/**\n * @param {string} url\n * @return {{base: string, params: string}}\n */\nexport function parseUrl(url) {\n var parts = url.match(/^(.*?)(?:\\?(.*))?$/);\n return {\n base: parts[1],\n params: getParams(parts[2] || ''),\n };\n}\n/**\n * Expands a URL that may or may not be relative to `base`.\n *\n * @param {string} url\n * @param {string} base\n * @return {string}\n */\nexport function expandUrl(url, base) {\n if (!base)\n return url;\n if (url.match(/^(\\/|https?:\\/\\/)/))\n return url;\n if (base.substr(base.length - 1) !== '/') {\n base = base + '/';\n }\n return base + url;\n}\n/**\n * @param {string=} opt_query A query string to parse.\n * @return {!Object<string, !Array<string>>} All params on the URL's query.\n */\nexport function getParams(query) {\n query = typeof query === 'string' ? query : window.location.search;\n if (query.substring(0, 1) === '?') {\n query = query.substring(1);\n }\n // python's SimpleHTTPServer tacks a `/` on the end of query strings :(\n if (query.slice(-1) === '/') {\n query = query.substring(0, query.length - 1);\n }\n if (query === '')\n return {};\n var result = {};\n query.split('&').forEach(function (part) {\n var pair = part.split('=');\n if (pair.length !== 2) {\n console.warn('Invalid URL query part:', part);\n return;\n }\n var key = decodeURIComponent(pair[0]);\n var value = decodeURIComponent(pair[1]);\n if (!result[key]) {\n result[key] = [];\n }\n result[key].push(value);\n });\n return result;\n}\n/**\n * Merges params from `source` into `target` (mutating `target`).\n *\n * @param {!Object<string, !Array<string>>} target\n * @param {!Object<string, !Array<string>>} source\n */\nexport function mergeParams(target, source) {\n Object.keys(source).forEach(function (key) {\n if (!(key in target)) {\n target[key] = [];\n }\n target[key] = target[key].concat(source[key]);\n });\n}\n/**\n * @param {string} param The param to return a value for.\n * @return {?string} The first value for `param`, if found.\n */\nexport function getParam(param) {\n var params = getParams();\n return params[param] ? params[param][0] : null;\n}\n/**\n * @param {!Object<string, !Array<string>>} params\n * @return {string} `params` encoded as a URI query.\n */\nexport function paramsToQuery(params) {\n var pairs = [];\n Object.keys(params).forEach(function (key) {\n params[key].forEach(function (value) {\n pairs.push(encodeURIComponent(key) + '=' + encodeURIComponent(value));\n });\n });\n return (pairs.length > 0) ? ('?' + pairs.join('&')) : '';\n}\nfunction getPathName(location) {\n return typeof location === 'string' ? location : location.pathname;\n}\nexport function basePath(location) {\n return getPathName(location).match(/^.*\\//)[0];\n}\nexport function relativeLocation(location, basePath) {\n var path = getPathName(location);\n if (path.indexOf(basePath) === 0) {\n path = path.substring(basePath.length);\n }\n return path;\n}\nexport function cleanLocation(location) {\n var path = getPathName(location);\n if (path.slice(-11) === '/index.html') {\n path = path.slice(0, path.length - 10);\n }\n return path;\n}\nexport function parallel(runners, maybeLimit, done) {\n var limit;\n if (typeof maybeLimit !== 'number') {\n done = maybeLimit;\n limit = 0;\n }\n else {\n limit = maybeLimit;\n }\n if (!runners.length) {\n return done();\n }\n var called = false;\n var total = runners.length;\n var numActive = 0;\n var numDone = 0;\n function runnerDone(error) {\n if (called) {\n return;\n }\n numDone = numDone + 1;\n numActive = numActive - 1;\n if (error || numDone >= total) {\n called = true;\n done(error);\n }\n else {\n runOne();\n }\n }\n function runOne() {\n if (limit && numActive >= limit) {\n return;\n }\n if (!runners.length) {\n return;\n }\n numActive = numActive + 1;\n runners.shift()(runnerDone);\n }\n runners.forEach(runOne);\n}\n/**\n * Finds the directory that a loaded script is hosted on.\n *\n * @param {string} filename\n * @return {string?}\n */\nexport function scriptPrefix(filename) {\n var scripts = document.querySelectorAll('script[src*=\"' + filename + '\"]');\n if (scripts.length !== 1) {\n return null;\n }\n var script = scripts[0].src;\n return script.substring(0, script.indexOf(filename));\n}\n","/**\n * @license\n * Copyright (c) 2014 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at\n * http://polymer.github.io/LICENSE.txt The complete set of authors may be found\n * at http://polymer.github.io/AUTHORS.txt The complete set of contributors may\n * be found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by\n * Google as part of the polymer project is also subject to an additional IP\n * rights grant found at http://polymer.github.io/PATENTS.txt\n */\nimport * as util from './util.js';\n/**\n * A Mocha suite (or suites) run within a child iframe, but reported as if they\n * are part of the current context.\n */\nvar ChildRunner = /** @class */ (function () {\n function ChildRunner(url, parentScope) {\n var urlBits = util.parseUrl(url);\n util.mergeParams(urlBits.params, util.getParams(parentScope.location.search));\n delete urlBits.params.cli_browser_id;\n this.url = urlBits.base + util.paramsToQuery(urlBits.params);\n this.parentScope = parentScope;\n this.state = 'initializing';\n }\n /**\n * @return {ChildRunner} The `ChildRunner` that was registered for this\n * window.\n */\n ChildRunner.current = function () {\n return ChildRunner.get(window);\n };\n /**\n * @param {!Window} target A window to find the ChildRunner of.\n * @param {boolean} traversal Whether this is a traversal from a child window.\n * @return {ChildRunner} The `ChildRunner` that was registered for `target`.\n */\n ChildRunner.get = function (target, traversal) {\n var childRunner = ChildRunner._byUrl[target.location.href];\n if (childRunner) {\n return childRunner;\n }\n if (window.parent === window) { // Top window.\n if (traversal) {\n console.warn('Subsuite loaded but was never registered. This most likely is due to wonky history behavior. Reloading...');\n window.location.reload();\n }\n return null;\n }\n // Otherwise, traverse.\n return window.parent.WCT._ChildRunner.get(target, true);\n };\n /**\n * Loads and runs the subsuite.\n *\n * @param {function} done Node-style callback.\n */\n ChildRunner.prototype.run = function (done) {\n util.debug('ChildRunner#run', this.url);\n this.state = 'loading';\n this.onRunComplete = done;\n this.iframe = document.createElement('iframe');\n this.iframe.src = this.url;\n this.iframe.classList.add('subsuite');\n var container = document.getElementById('subsuites');\n if (!container) {\n container = document.createElement('div');\n container.id = 'subsuites';\n document.body.appendChild(container);\n }\n container.appendChild(this.iframe);\n // let the iframe expand the URL for us.\n this.url = this.iframe.src;\n ChildRunner._byUrl[this.url] = this;\n this.timeoutId = setTimeout(this.loaded.bind(this, new Error('Timed out loading ' + this.url)), ChildRunner.loadTimeout);\n this.iframe.addEventListener('error', this.loaded.bind(this, new Error('Failed to load document ' + this.url)));\n this.iframe.contentWindow.addEventListener('DOMContentLoaded', this.loaded.bind(this, null));\n };\n /**\n * Called when the sub suite's iframe has loaded (or errored during load).\n *\n * @param {*} error The error that occured, if any.\n */\n ChildRunner.prototype.loaded = function (error) {\n util.debug('ChildRunner#loaded', this.url, error);\n if (this.iframe.contentWindow == null && error) {\n this.signalRunComplete(error);\n this.done();\n return;\n }\n // Not all targets have WCT loaded (compatiblity mode)\n if (this.iframe.contentWindow.WCT) {\n this.share = this.iframe.contentWindow.WCT.share;\n }\n if (error) {\n this.signalRunComplete(error);\n this.done();\n }\n };\n /**\n * Called in mocha/run.js when all dependencies have loaded, and the child is\n * ready to start running tests\n *\n * @param {*} error The error that occured, if any.\n */\n ChildRunner.prototype.ready = function (error) {\n util.debug('ChildRunner#ready', this.url, error);\n if (this.timeoutId) {\n clearTimeout(this.timeoutId);\n }\n if (error) {\n this.signalRunComplete(error);\n this.done();\n }\n };\n /**\n * Called when the sub suite's tests are complete, so that it can clean up.\n */\n ChildRunner.prototype.done = function () {\n util.debug('ChildRunner#done', this.url, arguments);\n // make sure to clear that timeout\n this.ready();\n this.signalRunComplete();\n if (!this.iframe)\n return;\n // Be safe and avoid potential browser crashes when logic attempts to\n // interact with the removed iframe.\n setTimeout(function () {\n this.iframe.parentNode.removeChild(this.iframe);\n this.iframe = null;\n this.share = null;\n }.bind(this), 1);\n };\n ChildRunner.prototype.signalRunComplete = function (error) {\n if (!this.onRunComplete)\n return;\n this.state = 'complete';\n this.onRunComplete(error);\n this.onRunComplete = null;\n };\n // ChildRunners get a pretty generous load timeout by default.\n ChildRunner.loadTimeout = 60000;\n // We can't maintain properties on iframe elements in Firefox/Safari/???, so\n // we track childRunners by URL.\n ChildRunner._byUrl = {};\n return ChildRunner;\n}());\nexport default ChildRunner;\n","/**\n * @license\n * Copyright (c) 2014 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at\n * http://polymer.github.io/LICENSE.txt The complete set of authors may be found\n * at http://polymer.github.io/AUTHORS.txt The complete set of contributors may\n * be found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by\n * Google as part of the polymer project is also subject to an additional IP\n * rights grant found at http://polymer.github.io/PATENTS.txt\n */\nimport ChildRunner from './childrunner.js';\nimport * as util from './util.js';\nvar SOCKETIO_ENDPOINT = window.location.protocol + '//' + window.location.host;\nvar SOCKETIO_LIBRARY = SOCKETIO_ENDPOINT + '/socket.io/socket.io.js';\n/**\n * A socket for communication between the CLI and browser runners.\n *\n * @param {string} browserId An ID generated by the CLI runner.\n * @param {!io.Socket} socket The socket.io `Socket` to communicate over.\n */\nvar CLISocket = /** @class */ (function () {\n function CLISocket(browserId, socket) {\n this.browserId = browserId;\n this.socket = socket;\n }\n /**\n * @param {!Mocha.Runner} runner The Mocha `Runner` to observe, reporting\n * interesting events back to the CLI runner.\n */\n CLISocket.prototype.observe = function (runner) {\n var _this = this;\n this.emitEvent('browser-start', {\n url: window.location.toString(),\n });\n // We only emit a subset of events that we care about, and follow a more\n // general event format that is hopefully applicable to test runners beyond\n // mocha.\n //\n // For all possible mocha events, see:\n // https://github.com/visionmedia/mocha/blob/master/lib/runner.js#L36\n runner.on('test', function (test) {\n _this.emitEvent('test-start', { test: getTitles(test) });\n });\n runner.on('test end', function (test) {\n _this.emitEvent('test-end', {\n state: getState(test),\n test: getTitles(test),\n duration: test.duration,\n error: test.err,\n });\n });\n runner.on('fail', function (test, err) {\n // fail the test run if we catch errors outside of a test function\n if (test.type !== 'test') {\n _this.emitEvent('browser-fail', 'Error thrown outside of test function: ' + err.stack);\n }\n });\n runner.on('childRunner start', function (childRunner) {\n _this.emitEvent('sub-suite-start', childRunner.share);\n });\n runner.on('childRunner end', function (childRunner) {\n _this.emitEvent('sub-suite-end', childRunner.share);\n });\n runner.on('end', function () {\n _this.emitEvent('browser-end');\n });\n };\n /**\n * @param {string} event The name of the event to fire.\n * @param {*} data Additional data to pass with the event.\n */\n CLISocket.prototype.emitEvent = function (event, data) {\n this.socket.emit('client-event', {\n browserId: this.browserId,\n event: event,\n data: data,\n });\n };\n /**\n * Builds a `CLISocket` if we are within a CLI-run environment; short-circuits\n * otherwise.\n *\n * @param {function(*, CLISocket)} done Node-style callback.\n */\n CLISocket.init = function (done) {\n var browserId = util.getParam('cli_browser_id');\n if (!browserId)\n return done();\n // Only fire up the socket for root runners.\n if (ChildRunner.current())\n return done();\n util.loadScript(SOCKETIO_LIBRARY, function (error) {\n if (error)\n return done(error);\n var socket = io(SOCKETIO_ENDPOINT);\n socket.on('error', function (error) {\n socket.off();\n done(error);\n });\n socket.on('connect', function () {\n socket.off();\n done(null, new CLISocket(browserId, socket));\n });\n });\n };\n return CLISocket;\n}());\nexport default CLISocket;\n// Misc Utility\n/**\n * @param {!Mocha.Runnable} runnable The test or suite to extract titles from.\n * @return {!Array.<string>} The titles of the runnable and its parents.\n */\nfunction getTitles(runnable) {\n var titles = [];\n while (runnable && !runnable.root && runnable.title) {\n titles.unshift(runnable.title);\n runnable = runnable.parent;\n }\n return titles;\n}\n/**\n * @param {!Mocha.Runnable} runnable\n * @return {string}\n */\nfunction getState(runnable) {\n if (runnable.state === 'passed') {\n return 'passing';\n }\n else if (runnable.state === 'failed') {\n return 'failing';\n }\n else if (runnable.pending) {\n return 'pending';\n }\n else {\n return 'unknown';\n }\n}\n","/**\n * @license\n * Copyright (c) 2014 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at\n * http://polymer.github.io/LICENSE.txt The complete set of authors may be found\n * at http://polymer.github.io/AUTHORS.txt The complete set of contributors may\n * be found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by\n * Google as part of the polymer project is also subject to an additional IP\n * rights grant found at http://polymer.github.io/PATENTS.txt\n */\nimport * as util from '../util.js';\n// We capture console events when running tests; so make sure we have a\n// reference to the original one.\nvar console = window.console;\nvar FONT = ';font: normal 13px \"Roboto\", \"Helvetica Neue\", \"Helvetica\", sans-serif;';\nvar STYLES = {\n plain: FONT,\n suite: 'color: #5c6bc0' + FONT,\n test: FONT,\n passing: 'color: #259b24' + FONT,\n pending: 'color: #e65100' + FONT,\n failing: 'color: #c41411' + FONT,\n stack: 'color: #c41411',\n results: FONT + 'font-size: 16px',\n};\n// I don't think we can feature detect this one...\nvar userAgent = navigator.userAgent.toLowerCase();\nvar CAN_STYLE_LOG = userAgent.match('firefox') || userAgent.match('webkit');\nvar CAN_STYLE_GROUP = userAgent.match('webkit');\n// Track the indent for faked `console.group`\nvar logIndent = '';\nfunction log(text, style) {\n text = text.split('\\n')\n .map(function (l) {\n return logIndent + l;\n })\n .join('\\n');\n if (CAN_STYLE_LOG) {\n console.log('%c' + text, STYLES[style] || STYLES.plain);\n }\n else {\n console.log(text);\n }\n}\nfunction logGroup(text, style) {\n if (CAN_STYLE_GROUP) {\n console.group('%c' + text, STYLES[style] || STYLES.plain);\n }\n else if (console.group) {\n console.group(text);\n }\n else {\n logIndent = logIndent + ' ';\n log(text, style);\n }\n}\nfunction logGroupEnd() {\n if (console.groupEnd) {\n console.groupEnd();\n }\n else {\n logIndent = logIndent.substr(0, logIndent.length - 2);\n }\n}\nfunction logException(error) {\n log(error.stack || error.message || (error + ''), 'stack');\n}\n/**\n * A Mocha reporter that logs results out to the web `console`.\n */\nvar Console = /** @class */ (function () {\n /**\n * @param runner The runner that is being reported on.\n */\n function Console(runner) {\n Mocha.reporters.Base.call(this, runner);\n runner.on('suite', function (suite) {\n if (suite.root) {\n return;\n }\n logGroup(suite.title, 'suite');\n }.bind(this));\n runner.on('suite end', function (suite) {\n if (suite.root) {\n return;\n }\n logGroupEnd();\n }.bind(this));\n runner.on('test', function (test) {\n logGroup(test.title, 'test');\n }.bind(this));\n runner.on('pending', function (test) {\n logGroup(test.title, 'pending');\n }.bind(this));\n runner.on('fail', function (_test, error) {\n logException(error);\n }.bind(this));\n runner.on('test end', function (_test) {\n logGroupEnd();\n }.bind(this));\n runner.on('end', this.logSummary.bind(this));\n }\n /** Prints out a final summary of test results. */\n Console.prototype.logSummary = function () {\n logGroup('Test Results', 'results');\n if (this.stats.failures > 0) {\n log(util.pluralizedStat(this.stats.failures, 'failing'), 'failing');\n }\n if (this.stats.pending > 0) {\n log(util.pluralizedStat(this.stats.pending, 'pending'), 'pending');\n }\n log(util.pluralizedStat(this.stats.passes, 'passing'));\n if (!this.stats.failures) {\n log('test suite passed', 'passing');\n }\n log('Evaluated ' + this.stats.tests + ' tests in ' +\n this.stats.duration + 'ms.');\n logGroupEnd();\n };\n return Console;\n}());\nexport default Console;\n","/**\n * @license\n * Copyright (c) 2014 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at\n * http://polymer.github.io/LICENSE.txt The complete set of authors may be found\n * at http://polymer.github.io/AUTHORS.txt The complete set of contributors may\n * be found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by\n * Google as part of the polymer project is also subject to an additional IP\n * rights grant found at http://polymer.github.io/PATENTS.txt\n */\n/**\n * WCT-specific behavior on top of Mocha's default HTML reporter.\n *\n * @param {!Mocha.Runner} runner The runner that is being reported on.\n */\nexport default function HTML(runner) {\n var output = document.createElement('div');\n output.id = 'mocha';\n document.body.appendChild(output);\n runner.on('suite', function (_test) {\n this.total = runner.total;\n }.bind(this));\n Mocha.reporters.HTML.call(this, runner);\n}\n// Woo! What a hack. This just saves us from adding a bunch of complexity around\n// style loading.\nvar style = document.createElement('style');\nstyle.textContent = \"\\n html, body {\\n position: relative;\\n height: 100%;\\n width: 100%;\\n min-width: 900px;\\n }\\n #mocha, #subsuites {\\n height: 100%;\\n position: absolute;\\n top: 0;\\n }\\n #mocha {\\n box-sizing: border-box;\\n margin: 0 !important;\\n padding: 60px 20px;\\n right: 0;\\n left: 500px;\\n }\\n #subsuites {\\n -ms-flex-direction: column;\\n -webkit-flex-direction: column;\\n display: -ms-flexbox;\\n display: -webkit-flex;\\n display: flex;\\n flex-direction: column;\\n left: 0;\\n width: 500px;\\n }\\n #subsuites .subsuite {\\n border: 0;\\n width: 100%;\\n height: 100%;\\n }\\n #mocha .test.pass .duration {\\n color: #555 !important;\\n }\\n\";\ndocument.head.appendChild(style);\n","/**\n * @license\n * Copyright (c) 2014 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at\n * http://polymer.github.io/LICENSE.txt The complete set of authors may be found\n * at http://polymer.github.io/AUTHORS.txt The complete set of contributors may\n * be found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by\n * Google as part of the polymer project is also subject to an additional IP\n * rights grant found at http://polymer.github.io/PATENTS.txt\n */\nimport * as util from '../util.js';\nvar STACKY_CONFIG = {\n indent: ' ',\n locationStrip: [\n /^https?:\\/\\/[^\\/]+/,\n /\\?.*$/,\n ],\n filter: function (line) {\n return !!line.location.match(/\\/web-component-tester\\/[^\\/]+(\\?.*)?$/);\n },\n};\n// https://github.com/visionmedia/mocha/blob/master/lib/runner.js#L36-46\nvar MOCHA_EVENTS = [\n 'start', 'end', 'suite', 'suite end', 'test', 'test end', 'hook', 'hook end',\n 'pass', 'fail', 'pending', 'childRunner end'\n];\n// Until a suite has loaded, we assume this many tests in it.\nvar ESTIMATED_TESTS_PER_SUITE = 3;\n/**\n * A Mocha-like reporter that combines the output of multiple Mocha suites.\n */\nvar MultiReporter = /** @class */ (function () {\n /**\n * @param numSuites The number of suites that will be run, in order to\n * estimate the total number of tests that will be performed.\n * @param reporters The set of reporters that\n * should receive the unified event stream.\n * @param parent The parent reporter, if present.\n */\n function MultiReporter(numSuites, reporters, parent) {\n var _this = this;\n this.reporters = reporters.map(function (reporter) {\n return new reporter(_this);\n });\n this.parent = parent;\n this.basePath = parent && parent.basePath || util.basePath(window.location);\n this.total = numSuites * ESTIMATED_TESTS_PER_SUITE;\n // Mocha reporters assume a stream of events, so we have to be careful to\n // only report on one runner at a time...\n this.currentRunner = null;\n // ...while we buffer events for any other active runners.\n this.pendingEvents = [];\n this.emit('start');\n }\n /**\n * @param location The location this reporter represents.\n * @return A reporter-like \"class\" for each child suite\n * that should be passed to `mocha.run`.\n */\n MultiReporter.prototype.childReporter = function (location) {\n var name = this.suiteTitle(location);\n // The reporter is used as a constructor, so we can't depend on `this` being\n // properly bound.\n var self = this;\n return _a = /** @class */ (function () {\n function ChildReporter(runner) {\n runner.name = window.name;\n self.bindChildRunner(runner);\n }\n return ChildReporter;\n }()),\n _a.title = window.name,\n _a;\n var _a;\n };\n /** Must be called once all runners have finished. */\n MultiReporter.prototype.done = function () {\n this.complete = true;\n this.flushPendingEvents();\n this.emit('end');\n };\n /**\n * Emit a top level test that is not part of any suite managed by this\n * reporter.\n *\n * Helpful for reporting on global errors, loading issues, etc.\n *\n * @param title The title of the test.\n * @param error An error associated with this test. If falsy, test is\n * considered to be passing.\n * @param suiteTitle Title for the suite that's wrapping the test.\n * @param estimated If this test was included in the original\n * estimate of `numSuites`.\n */\n MultiReporter.prototype.emitOutOfBandTest = function (title, error, suiteTitle, estimated) {\n util.debug('MultiReporter#emitOutOfBandTest(', arguments, ')');\n var root = new Mocha.Suite(suiteTitle || '');\n var test = new Mocha.Test(title, function () { });\n test.parent = root;\n test.state = error ? 'failed' : 'passed';\n test.err = error;\n if (!estimated) {\n this.total = this.total + ESTIMATED_TESTS_PER_SUITE;\n }\n var runner = { total: 1 };\n this.proxyEvent('start', runner);\n this.proxyEvent('suite', runner, root);\n this.proxyEvent('test', runner, test);\n if (error) {\n this.proxyEvent('fail', runner, test, error);\n }\n else {\n this.proxyEvent('pass', runner, test);\n }\n this.proxyEvent('test end', runner, test);\n this.proxyEvent('suite end', runner, root);\n this.proxyEvent('end', runner);\n };\n /**\n * @param {!Location|string} location\n * @return {string}\n */\n MultiReporter.prototype.suiteTitle = function (location) {\n var path = util.relativeLocation(location, this.basePath);\n path = util.cleanLocation(path);\n return path;\n };\n // Internal Interface\n /** @param {!Mocha.runners.Base} runner The runner to listen to events for. */\n MultiReporter.prototype.bindChildRunner = function (runner) {\n var _this = this;\n MOCHA_EVENTS.forEach(function (eventName) {\n runner.on(eventName, _this.proxyEvent.bind(_this, eventName, runner));\n });\n };\n /**\n * Evaluates an event fired by `runner`, proxying it forward or buffering it.\n *\n * @param {string} eventName\n * @param {!Mocha.runners.Base} runner The runner that emitted this event.\n * @param {...*} var_args Any additional data passed as part of the event.\n */\n MultiReporter.prototype.proxyEvent = function (eventName, runner) {\n var _args = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n _args[_i - 2] = arguments[_i];\n }\n var extraArgs = Array.prototype.slice.call(arguments, 2);\n if (this.complete) {\n console.warn('out of order Mocha event for ' + runner.name + ':', eventName, extraArgs);\n return;\n }\n if (this.currentRunner && runner !== this.currentRunner) {\n this.pendingEvents.push(Array.prototype.slice.call(arguments));\n return;\n }\n util.debug('MultiReporter#proxyEvent(', arguments, ')');\n // This appears to be a Mocha bug: Tests failed by passing an error to their\n // done function don't set `err` properly.\n //\n // TODO(nevir): Track down.\n if (eventName === 'fail' && !extraArgs[0].err) {\n extraArgs[0].err = extraArgs[1];\n }\n if (eventName === 'start') {\n this.onRunnerStart(runner);\n }\n else if (eventName === 'end') {\n this.onRunnerEnd(runner);\n }\n else {\n this.cleanEvent(eventName, runner, extraArgs);\n this.emit.apply(this, [eventName].concat(extraArgs));\n }\n };\n /**\n * Cleans or modifies an event if needed.\n *\n * @param eventName\n * @param runner The runner that emitted this event.\n * @param extraArgs\n */\n MultiReporter.prototype.cleanEvent = function (eventName, _runner, extraArgs) {\n // Suite hierarchy\n if (extraArgs[0]) {\n extraArgs[0] = this.showRootSuite(extraArgs[0]);\n }\n // Normalize errors\n if (eventName === 'fail') {\n extraArgs[1] = Stacky.normalize(extraArgs[1], STACKY_CONFIG);\n }\n if (extraArgs[0] && extraArgs[0].err) {\n extraArgs[0].err = Stacky.normalize(extraArgs[0].err, STACKY_CONFIG);\n }\n };\n /**\n * We like to show the root suite's title, which requires a little bit of\n * trickery in the suite hierarchy.\n *\n * @param {!Mocha.Runnable} node\n */\n MultiReporter.prototype.showRootSuite = function (node) {\n var leaf = node = Object.create(node);\n while (node && node.parent) {\n var wrappedParent = Object.create(node.parent);\n node.parent = wrappedParent;\n node = wrappedParent;\n }\n node.root = false;\n return leaf;\n };\n /** @param {!Mocha.runners.Base} runner */\n MultiReporter.prototype.onRunnerStart = function (runner) {\n util.debug('MultiReporter#onRunnerStart:', runner.name);\n this.total = this.total - ESTIMATED_TESTS_PER_SUITE + runner.total;\n this.currentRunner = runner;\n };\n /** @param {!Mocha.runners.Base} runner */\n MultiReporter.prototype.onRunnerEnd = function (runner) {\n util.debug('MultiReporter#onRunnerEnd:', runner.name);\n this.currentRunner = null;\n this.flushPendingEvents();\n };\n /**\n * Flushes any buffered events and runs them through `proxyEvent`. This will\n * loop until all buffered runners are complete, or we have run out of\n * buffered events.\n */\n MultiReporter.prototype.flushPendingEvents = function () {\n var _this = this;\n var events = this.pendingEvents;\n this.pendingEvents = [];\n events.forEach(function (eventArgs) {\n _this.proxyEvent.apply(_this, eventArgs);\n });\n };\n return MultiReporter;\n}());\nexport default MultiReporter;\n","/**\n * @license\n * Copyright (c) 2014 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at\n * http://polymer.github.io/LICENSE.txt The complete set of authors may be found\n * at http://polymer.github.io/AUTHORS.txt The complete set of contributors may\n * be found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by\n * Google as part of the polymer project is also subject to an additional IP\n * rights grant found at http://polymer.github.io/PATENTS.txt\n */\nimport * as util from '../util.js';\nvar ARC_OFFSET = 0; // start at the right.\nvar ARC_WIDTH = 6;\n/**\n * A Mocha reporter that updates the document's title and favicon with\n * at-a-glance stats.\n *\n * @param {!Mocha.Runner} runner The runner that is being reported on.\n */\nvar Title = /** @class */ (function () {\n function Title(runner) {\n Mocha.reporters.Base.call(this, runner);\n runner.on('test end', this.report.bind(this));\n }\n /** Reports current stats via the page title and favicon. */\n Title.prototype.report = function () {\n this.updateTitle();\n this.updateFavicon();\n };\n /** Updates the document title with a summary of current stats. */\n Title.prototype.updateTitle = function () {\n if (this.stats.failures > 0) {\n document.title = util.pluralizedStat(this.stats.failures, 'failing');\n }\n else {\n document.title = util.pluralizedStat(this.stats.passes, 'passing');\n }\n };\n /** Updates the document's favicon w/ a summary of current stats. */\n Title.prototype.updateFavicon = function () {\n var canvas = document.createElement('canvas');\n canvas.height = canvas.width = 32;\n var context = canvas.getContext('2d');\n var passing = this.stats.passes;\n var pending = this.stats.pending;\n var failing = this.stats.failures;\n var total = Math.max(this.runner.total, passing + pending + failing);\n drawFaviconArc(context, total, 0, passing, '#0e9c57');\n drawFaviconArc(context, total, passing, pending, '#f3b300');\n drawFaviconArc(context, total, pending + passing, failing, '#ff5621');\n this.setFavicon(canvas.toDataURL());\n };\n /** Sets the current favicon by URL. */\n Title.prototype.setFavicon = function (url) {\n var current = document.head.querySelector('link[rel=\"icon\"]');\n if (current) {\n document.head.removeChild(current);\n }\n var link = document.createElement('link');\n link.rel = 'icon';\n link.type = 'image/x-icon';\n link.href = url;\n link.setAttribute('sizes', '32x32');\n document.head.appendChild(link);\n };\n return Title;\n}());\nexport default Title;\n/**\n * Draws an arc for the favicon status, relative to the total number of tests.\n */\nfunction drawFaviconArc(context, total, start, length, color) {\n var arcStart = ARC_OFFSET + Math.PI * 2 * (start / total);\n var arcEnd = ARC_OFFSET + Math.PI * 2 * ((start + length) / total);\n context.beginPath();\n context.strokeStyle = color;\n context.lineWidth = ARC_WIDTH;\n context.arc(16, 16, 16 - ARC_WIDTH / 2, arcStart, arcEnd);\n context.stroke();\n}\n","/**\n * @license\n * Copyright (c) 2014 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at\n * http://polymer.github.io/LICENSE.txt The complete set of authors may be found\n * at http://polymer.github.io/AUTHORS.txt The complete set of contributors may\n * be found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by\n * Google as part of the polymer project is also subject to an additional IP\n * rights grant found at http://polymer.github.io/PATENTS.txt\n */\nimport ChildRunner from './childrunner.js';\nimport * as config from './config.js';\nimport * as util from './util.js';\nexport var htmlSuites = [];\nexport var jsSuites = [];\n// We process grep ourselves to avoid loading suites that will be filtered.\nvar GREP = util.getParam('grep');\n// work around mocha bug (https://github.com/mochajs/mocha/issues/2070)\nif (GREP) {\n GREP = GREP.replace(/\\\\\\./g, '.');\n}\n/**\n * Loads suites of tests, supporting both `.js` and `.html` files.\n *\n * @param files The files to load.\n */\nexport function loadSuites(files) {\n files.forEach(function (file) {\n if (/\\.js(\\?.*)?$/.test(file)) {\n jsSuites.push(file);\n }\n else if (/\\.html(\\?.*)?$/.test(file)) {\n htmlSuites.push(file);\n }\n else {\n throw new Error('Unknown resource type: ' + file);\n }\n });\n}\n/**\n * @return The child suites that should be loaded, ignoring\n * those that would not match `GREP`.\n */\nexport function activeChildSuites() {\n var subsuites = htmlSuites;\n if (GREP) {\n var cleanSubsuites = [];\n for (var i = 0, subsuite = void 0; subsuite = subsuites[i]; i++) {\n if (GREP.indexOf(util.cleanLocation(subsuite)) !== -1) {\n cleanSubsuites.push(subsuite);\n }\n }\n subsuites = cleanSubsuites;\n }\n return subsuites;\n}\n/**\n * Loads all `.js` sources requested by the current suite.\n */\nexport function loadJsSuites(_reporter, done) {\n util.debug('loadJsSuites', jsSuites);\n var loaders = jsSuites.map(function (file) {\n // We only support `.js` dependencies for now.\n return util.loadScript.bind(util, file);\n });\n util.parallel(loaders, done);\n}\nexport function runSuites(reporter, childSuites, done) {\n util.debug('runSuites');\n var suiteRunners = [\n // Run the local tests (if any) first, not stopping on error;\n _runMocha.bind(null, reporter),\n ];\n // As well as any sub suites. Again, don't stop on error.\n childSuites.forEach(function (file) {\n suiteRunners.push(function (next) {\n var childRunner = new ChildRunner(file, window);\n reporter.emit('childRunner start', childRunner);\n childRunner.run(function (error) {\n reporter.emit('childRunner end', childRunner);\n if (error)\n reporter.emitOutOfBandTest(file, error);\n next();\n });\n });\n });\n util.parallel(suiteRunners, config.get('numConcurrentSuites'), function (error) {\n reporter.done();\n done(error);\n });\n}\n/**\n * Kicks off a mocha run, waiting for frameworks to load if necessary.\n *\n * @param {!MultiReporter} reporter Where to send Mocha's events.\n * @param {function} done A callback fired, _no error is passed_.\n */\nfunction _runMocha(reporter, done, waited) {\n if (config.get('waitForFrameworks') && !waited) {\n var waitFor = (config.get('waitFor') || util.whenFrameworksReady).bind(window);\n waitFor(_runMocha.bind(null, reporter, done, true));\n return;\n }\n util.debug('_runMocha');\n var mocha = window.mocha;\n var Mocha = window.Mocha;\n mocha.reporter(reporter.childReporter(window.location));\n mocha.suite.title = reporter.suiteTitle(window.location);\n mocha.grep(GREP);\n // We can't use `mocha.run` because it bashes over grep, invert, and friends.\n // See https://github.com/visionmedia/mocha/blob/master/support/tail.js#L137\n var runner = Mocha.prototype.run.call(mocha, function (_error) {\n if (document.getElementById('mocha')) {\n Mocha.utils.highlightTags('code');\n }\n done(); // We ignore the Mocha failure count.\n });\n // Mocha's default `onerror` handling strips the stack (to support really old\n // browsers). We upgrade this to get better stacks for async errors.\n //\n // TODO(nevir): Can we expand support to other browsers?\n if (navigator.userAgent.match(/chrome/i)) {\n window.onerror = null;\n window.addEventListener('error', function (event) {\n if (!event.error)\n return;\n if (event.error.ignore)\n return;\n runner.uncaught(event.error);\n });\n }\n}\n","import ConsoleReporter from './reporters/console.js';\nimport HTMLReporter from './reporters/html.js';\nimport MultiReporter from './reporters/multi.js';\nimport TitleReporter from './reporters/title.js';\nimport * as suites from './suites.js';\nexport var htmlSuites = [];\nexport var jsSuites = [];\n/**\n * @param {CLISocket} socket The CLI socket, if present.\n * @param {MultiReporter} parent The parent reporter, if present.\n * @return {!Array.<!Mocha.reporters.Base} The reporters that should be used.\n */\nexport function determineReporters(socket, parent) {\n // Parents are greedy.\n if (parent) {\n return [parent.childReporter(window.location)];\n }\n // Otherwise, we get to run wild without any parental supervision!\n var reporters = [TitleReporter, ConsoleReporter];\n if (socket) {\n reporters.push(function (runner) {\n socket.observe(runner);\n });\n }\n if (suites.htmlSuites.length > 0 || suites.jsSuites.length > 0) {\n reporters.push(HTMLReporter);\n }\n return reporters;\n}\n/**\n * Yeah, hideous, but this allows us to be loaded before Mocha, which is handy.\n */\nexport function injectMocha(Mocha) {\n _injectPrototype(ConsoleReporter, Mocha.reporters.Base.prototype);\n _injectPrototype(HTMLReporter, Mocha.reporters.HTML.prototype);\n // Mocha doesn't expose its `EventEmitter` shim directly, so:\n _injectPrototype(MultiReporter, Object.getPrototypeOf(Mocha.Runner.prototype));\n}\nfunction _injectPrototype(klass, prototype) {\n var newPrototype = Object.create(prototype);\n // Only support\n Object.keys(klass.prototype).forEach(function (key) {\n newPrototype[key] = klass.prototype[key];\n });\n klass.prototype = newPrototype;\n}\n","/**\n * @license\n * Copyright (c) 2014 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at\n * http://polymer.github.io/LICENSE.txt The complete set of authors may be found\n * at http://polymer.github.io/AUTHORS.txt The complete set of contributors may\n * be found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by\n * Google as part of the polymer project is also subject to an additional IP\n * rights grant found at http://polymer.github.io/PATENTS.txt\n */\nimport * as config from './config.js';\nimport * as reporters from './reporters.js';\nimport * as util from './util.js';\n/**\n * Loads all environment scripts ...synchronously ...after us.\n */\nexport function loadSync() {\n util.debug('Loading environment scripts:');\n var a11ySuiteScriptPath = 'web-component-tester/data/a11ySuite.js';\n var scripts = config.get('environmentScripts');\n var a11ySuiteWillBeLoaded = window.__generatedByWct || scripts.indexOf(a11ySuiteScriptPath) > -1;\n // We can't inject a11ySuite when running the npm version because it is a\n // module-based script that needs `<script type=module>` and compilation\n // for browsers without module support.\n if (!a11ySuiteWillBeLoaded && !window.__wctUseNpm) {\n // wct is running as a bower dependency, load a11ySuite from data/\n scripts.push(a11ySuiteScriptPath);\n }\n scripts.forEach(function (path) {\n var url = util.expandUrl(path, config.get('root'));\n util.debug('Loading environment script:', url);\n // Synchronous load.\n document.write('<script src=\"' + encodeURI(url) +\n '\"></script>'); // jshint ignore:line\n });\n util.debug('Environment scripts loaded');\n var imports = config.get('environmentImports');\n imports.forEach(function (path) {\n var url = util.expandUrl(path, config.get('root'));\n util.debug('Loading environment import:', url);\n // Synchronous load.\n document.write('<link rel=\"import\" href=\"' + encodeURI(url) +\n '\">'); // jshint ignore:line\n });\n util.debug('Environment imports loaded');\n}\n/**\n * We have some hard dependencies on things that should be loaded via\n * `environmentScripts`, so we assert that they're present here; and do any\n * post-facto setup.\n */\nexport function ensureDependenciesPresent() {\n _ensureMocha();\n _checkChai();\n}\nfunction _ensureMocha() {\n var Mocha = window.Mocha;\n if (!Mocha) {\n throw new Error('WCT requires Mocha. Please ensure that it is present in WCT.environmentScripts, or that you load it before loading web-component-tester/browser.js');\n }\n reporters.injectMocha(Mocha);\n // Magic loading of mocha's stylesheet\n var mochaPrefix = util.scriptPrefix('mocha.js');\n // only load mocha stylesheet for the test runner output\n // Not the end of the world, if it doesn't load.\n if (mochaPrefix && window.top === window.self) {\n util.loadStyle(mochaPrefix + 'mocha.css');\n }\n}\nfunction _checkChai() {\n if (!window.chai) {\n util.debug('Chai not present; not registering shorthands');\n return;\n }\n window.assert = window.chai.assert;\n window.expect = window.chai.expect;\n}\n","/**\n * @license\n * Copyright (c) 2014 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at\n * http://polymer.github.io/LICENSE.txt The complete set of authors may be found\n * at http://polymer.github.io/AUTHORS.txt The complete set of contributors may\n * be found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by\n * Google as part of the polymer project is also subject to an additional IP\n * rights grant found at http://polymer.github.io/PATENTS.txt\n */\nimport * as config from '../config.js';\n// We may encounter errors during initialization (for example, syntax errors in\n// a test file). Hang onto those (and more) until we are ready to report them.\nexport var globalErrors = [];\n/**\n * Hook the environment to pick up on global errors.\n */\nexport function listenForErrors() {\n window.addEventListener('error', function (event) {\n globalErrors.push(event.error);\n });\n // Also, we treat `console.error` as a test failure. Unless you prefer not.\n var origConsole = console;\n var origError = console.error;\n console.error = function wctShimmedError() {\n origError.apply(origConsole, arguments);\n if (config.get('trackConsoleError')) {\n throw 'console.error: ' + Array.prototype.join.call(arguments, ' ');\n }\n };\n}\n","var interfaceExtensions = [];\n/**\n * Registers an extension that extends the global `Mocha` implementation\n * with new helper methods. These helper methods will be added to the `window`\n * when tests run for both BDD and TDD interfaces.\n */\nexport function extendInterfaces(helperName, helperFactory) {\n interfaceExtensions.push(function () {\n var Mocha = window.Mocha;\n // For all Mocha interfaces (probably just TDD and BDD):\n Object.keys(Mocha.interfaces)\n .forEach(function (interfaceName) {\n // This is the original callback that defines the interface (TDD or\n // BDD):\n var originalInterface = Mocha.interfaces[interfaceName];\n // This is the name of the \"teardown\" or \"afterEach\" property for the\n // current interface:\n var teardownProperty = interfaceName === 'tdd' ? 'teardown' : 'afterEach';\n // The original callback is monkey patched with a new one that appends\n // to the global context however we want it to:\n Mocha.interfaces[interfaceName] = function (suite) {\n // Call back to the original callback so that we get the base\n // interface:\n originalInterface.apply(this, arguments);\n // Register a listener so that we can further extend the base\n // interface:\n suite.on('pre-require', function (context, _file, _mocha) {\n // Capture a bound reference to the teardown function as a\n // convenience:\n var teardown = context[teardownProperty].bind(context);\n // Add our new helper to the testing context. The helper is\n // generated by a factory method that receives the context,\n // the teardown function and the interface name and returns\n // the new method to be added to that context:\n context[helperName] =\n helperFactory(context, teardown, interfaceName);\n });\n };\n });\n });\n}\n/**\n * Applies any registered interface extensions. The extensions will be applied\n * as many times as this function is called, so don't call it more than once.\n */\nexport function applyExtensions() {\n interfaceExtensions.forEach(function (applyExtension) {\n applyExtension();\n });\n}\n","import { extendInterfaces } from './extend.js';\nextendInterfaces('fixture', function (context, teardown) {\n // Return context.fixture if it is already a thing, for backwards\n // compatibility with `test-fixture-mocha.js`:\n return context.fixture || function fixture(fixtureId, model) {\n // Automatically register a teardown callback that will restore the\n // test-fixture:\n teardown(function () {\n document.getElementById(fixtureId).restore();\n });\n // Find the test-fixture with the provided ID and create it, returning\n // the results:\n return document.getElementById(fixtureId).create(model);\n };\n});\n","import { extendInterfaces } from './extend.js';\n/**\n * stub\n *\n * The stub addon allows the tester to partially replace the implementation of\n * an element with some custom implementation. Usage example:\n *\n * beforeEach(function() {\n * stub('x-foo', {\n * attached: function() {\n * // Custom implementation of the `attached` method of element `x-foo`..\n * },\n * otherMethod: function() {\n * // More custom implementation..\n * },\n * getterSetterProperty: {\n * get: function() {\n * // Custom getter implementation..\n * },\n * set: function() {\n * // Custom setter implementation..\n * }\n * },\n * // etc..\n * });\n * });\n */\nextendInterfaces('stub', function (_context, teardown) {\n return function stub(tagName, implementation) {\n // Find the prototype of the element being stubbed:\n var proto = document.createElement(tagName).constructor.prototype;\n // For all keys in the implementation to stub with..\n var stubs = Object.keys(implementation).map(function (key) {\n // Stub the method on the element prototype with Sinon:\n return sinon.stub(proto, key, implementation[key]);\n });\n // After all tests..\n teardown(function () {\n stubs.forEach(function (stub) {\n stub.restore();\n });\n });\n };\n});\n","import { extendInterfaces } from './extend.js';\n// replacement map stores what should be\nvar replacements = {};\nvar replaceTeardownAttached = false;\n/**\n * replace\n *\n * The replace addon allows the tester to replace all usages of one element with\n * another element within all Polymer elements created within the time span of\n * the test. Usage example:\n *\n * beforeEach(function() {\n * replace('x-foo').with('x-fake-foo');\n * });\n *\n * All annotations and attributes will be set on the placement element the way\n * they were set for the original element.\n */\nextendInterfaces('replace', function (_context, teardown) {\n return function replace(oldTagName) {\n return {\n with: function (tagName) {\n // Standardizes our replacements map\n oldTagName = oldTagName.toLowerCase();\n tagName = tagName.toLowerCase();\n replacements[oldTagName] = tagName;\n // If the function is already a stub, restore it to original\n if (document.importNode.isSinonProxy) {\n return;\n }\n if (!window.Polymer.Element) {\n window.Polymer.Element = function () { };\n window.Polymer.Element.prototype._stampTemplate = function () { };\n }\n // Keep a reference to the original `document.importNode`\n // implementation for later:\n var originalImportNode = document.importNode;\n // Use Sinon to stub `document.ImportNode`:\n sinon.stub(document, 'importNode', function (origContent, deep) {\n var templateClone = document.createElement('template');\n var content = templateClone.content;\n var inertDoc = content.ownerDocument;\n // imports node from inertDoc which holds inert nodes.\n templateClone.content.appendChild(inertDoc.importNode(origContent, true));\n // optional arguments are not optional on IE.\n var nodeIterator = document.createNodeIterator(content, NodeFilter.SHOW_ELEMENT, null, true);\n var node;\n // Traverses the tree. A recently-replaced node will be put next,\n // so if a node is replaced, it will be checked if it needs to be\n // replaced again.\n while (node = nodeIterator.nextNode()) {\n var currentTagName = node.tagName.toLowerCase();\n if (replacements.hasOwnProperty(currentTagName)) {\n currentTagName = replacements[currentTagName];\n // find the final tag name.\n while (replacements[currentTagName]) {\n currentTagName = replacements[currentTagName];\n }\n // Create a replacement:\n var replacement = document.createElement(currentTagName);\n // For all attributes in the original node..\n for (var index = 0; index < node.attributes.length; ++index) {\n // Set that attribute on the replacement:\n replacement.setAttribute(node.attributes[index].name, node.attributes[index].value);\n }\n // Replace the original node with the replacement node:\n node.parentNode.replaceChild(replacement, node);\n }\n }\n return originalImportNode.call(this, content, deep);\n });\n if (!replaceTeardownAttached) {\n // After each test...\n teardown(function () {\n replaceTeardownAttached = true;\n // Restore the stubbed version of `document.importNode`:\n var documentImportNode = document.importNode;\n if (documentImportNode.isSinonProxy) {\n documentImportNode.restore();\n }\n // Empty the replacement map\n replacements = {};\n });\n }\n }\n };\n };\n});\n","/**\n * @license\n * Copyright (c) 2014 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at\n * http://polymer.github.io/LICENSE.txt The complete set of authors may be found\n * at http://polymer.github.io/AUTHORS.txt The complete set of contributors may\n * be found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by\n * Google as part of the polymer project is also subject to an additional IP\n * rights grant found at http://polymer.github.io/PATENTS.txt\n */\nimport './mocha/fixture.js';\nimport './mocha/stub.js';\nimport './mocha/replace.js';\nimport * as config from './config.js';\nimport { applyExtensions } from './mocha/extend.js';\n// Mocha global helpers, broken out by testing method.\n//\n// Keys are the method for a particular interface; values are their analog in\n// the opposite interface.\nvar MOCHA_EXPORTS = {\n // https://github.com/visionmedia/mocha/blob/master/lib/interfaces/tdd.js\n tdd: {\n 'setup': '\"before\"',\n 'teardown': '\"after\"',\n 'suiteSetup': '\"beforeEach\"',\n 'suiteTeardown': '\"afterEach\"',\n 'suite': '\"describe\" or \"context\"',\n 'test': '\"it\" or \"specify\"',\n },\n // https://github.com/visionmedia/mocha/blob/master/lib/interfaces/bdd.js\n bdd: {\n 'before': '\"setup\"',\n 'after': '\"teardown\"',\n 'beforeEach': '\"suiteSetup\"',\n 'afterEach': '\"suiteTeardown\"',\n 'describe': '\"suite\"',\n 'context': '\"suite\"',\n 'xdescribe': '\"suite.skip\"',\n 'xcontext': '\"suite.skip\"',\n 'it': '\"test\"',\n 'xit': '\"test.skip\"',\n 'specify': '\"test\"',\n 'xspecify': '\"test.skip\"',\n },\n};\n/**\n * Exposes all Mocha methods up front, configuring and running mocha\n * automatically when you call them.\n *\n * The assumption is that it is a one-off (sub-)suite of tests being run.\n */\nexport function stubInterfaces() {\n var keys = Object.keys(MOCHA_EXPORTS);\n keys.forEach(function (ui) {\n Object.keys(MOCHA_EXPORTS[ui]).forEach(function (key) {\n window[key] = function wrappedMochaFunction() {\n _setupMocha(ui, key, MOCHA_EXPORTS[ui][key]);\n if (!window[key] || window[key] === wrappedMochaFunction) {\n throw new Error('Expected mocha.setup to define ' + key);\n }\n window[key].apply(window, arguments);\n };\n });\n });\n}\n// Whether we've called `mocha.setup`\nvar _mochaIsSetup = false;\n/**\n * @param {string} ui Sets up mocha to run `ui`-style tests.\n * @param {string} key The method called that triggered this.\n * @param {string} alternate The matching method in the opposite interface.\n */\nfunction _setupMocha(ui, key, alternate) {\n var mochaOptions = config.get('mochaOptions');\n if (mochaOptions.ui && mochaOptions.ui !== ui) {\n var message = 'Mixing ' + mochaOptions.ui + ' and ' + ui +\n ' Mocha styles is not supported. ' +\n 'You called \"' + key + '\". Did you mean ' + alternate + '?';\n throw new Error(message);\n }\n if (_mochaIsSetup) {\n return;\n }\n applyExtensions();\n mochaOptions.ui = ui;\n mocha.setup(mochaOptions); // Note that the reporter is configured in run.js.\n}\n","/**\n * @license\n * Copyright (c) 2014 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at\n * http://polymer.github.io/LICENSE.txt The complete set of authors may be found\n * at http://polymer.github.io/AUTHORS.txt The complete set of contributors may\n * be found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by\n * Google as part of the polymer project is also subject to an additional IP\n * rights grant found at http://polymer.github.io/PATENTS.txt\n */\n/**\n * This file is the entry point into `web-component-tester`'s browser client.\n */\n// Registers a bunch of globals:\nimport './environment/helpers.js';\nimport ChildRunner from './childrunner.js';\nimport CLISocket from './clisocket.js';\nimport * as config from './config.js';\nimport * as environment from './environment.js';\nimport * as errors from './environment/errors.js';\nimport * as mocha from './mocha.js';\nimport * as reporters from './reporters.js';\nimport MultiReporter from './reporters/multi.js';\nimport * as suites from './suites.js';\nimport * as util from './util.js';\n// You can configure WCT before it has loaded by assigning your custom\n// configuration to the global `WCT`.\nconfig.setup(window.WCT);\n// Maybe some day we'll expose WCT as a module to whatever module registry you\n// are using (aka the UMD approach), or as an es6 module.\nvar WCT = window.WCT = {\n // A generic place to hang data about the current suite. This object is\n // reported\n // back via the `sub-suite-start` and `sub-suite-end` events.\n share: {},\n // Until then, we get to rely on it to expose parent runners to their\n // children.\n _ChildRunner: ChildRunner,\n _reporter: undefined,\n _config: config._config,\n // Public API\n /**\n * Loads suites of tests, supporting both `.js` and `.html` files.\n *\n * @param {!Array.<string>} files The files to load.\n */\n loadSuites: suites.loadSuites,\n};\n// Load Process\nerrors.listenForErrors();\nmocha.stubInterfaces();\nenvironment.loadSync();\n// Give any scripts on the page a chance to declare tests and muck with things.\ndocument.addEventListener('DOMContentLoaded', function () {\n util.debug('DOMContentLoaded');\n environment.ensureDependenciesPresent();\n // We need the socket built prior to building its reporter.\n CLISocket.init(function (error, socket) {\n if (error)\n throw error;\n // Are we a child of another run?\n var current = ChildRunner.current();\n var parent = current && current.parentScope.WCT._reporter;\n util.debug('parentReporter:', parent);\n var childSuites = suites.activeChildSuites();\n var reportersToUse = reporters.determineReporters(socket, parent);\n // +1 for any local tests.\n var reporter = new MultiReporter(childSuites.length + 1, reportersToUse, parent);\n WCT._reporter = reporter; // For environment/compatibility.js\n // We need the reporter so that we can report errors during load.\n suites.loadJsSuites(reporter, function (error) {\n // Let our parent know that we're about to start the tests.\n if (current)\n current.ready(error);\n if (error)\n throw error;\n // Emit any errors we've encountered up til now\n errors.globalErrors.forEach(function onError(error) {\n reporter.emitOutOfBandTest('Test Suite Initialization', error);\n });\n suites.runSuites(reporter, childSuites, function (error) {\n // Make sure to let our parent know that we're done.\n if (current)\n current.done();\n if (error)\n throw error;\n });\n });\n });\n});\n"],"names":["util.basePath","util.scriptPrefix","config.get","util.debug","util.paramsToQuery","util.getParams","util.mergeParams","util.parseUrl","util.loadScript","util.getParam","console","util.pluralizedStat","util.cleanLocation","util.relativeLocation","htmlSuites","jsSuites","util.parallel","util.whenFrameworksReady","HTMLReporter","suites.jsSuites","suites.htmlSuites","ConsoleReporter","TitleReporter","util.expandUrl","util.loadStyle","reporters.injectMocha","config.setup","suites.loadSuites","config._config","errors.listenForErrors","mocha.stubInterfaces","environment.loadSync","suites.runSuites","errors.globalErrors","suites.loadJsSuites","reporters.determineReporters","suites.activeChildSuites","environment.ensureDependenciesPresent"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;AAWA,IAAI,iBAAiB,GAAG,MAAM,CAAC,WAAW,CAAC;AAC3C,IAAI,gBAAgB,GAAG,MAAM,CAAC,UAAU,CAAC;AACzC,IAAI,2BAA2B,GAAG,MAAM,CAAC,qBAAqB,CAAC;;;;;;;;AAQ/D,SAAS,QAAQ,CAAC,QAAQ,EAAE,MAAM,EAAE;IAChC,IAAI,GAAG,CAAC;IACR,IAAI;QACA,MAAM,EAAE,CAAC;KACZ;IACD,OAAO,KAAK,EAAE;QACV,GAAG,GAAG,KAAK,CAAC;KACf;IACD,QAAQ,CAAC,GAAG,CAAC,CAAC;CACjB;;;;;;;;;;;;;AAaD,SAAS,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE;IACjC,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE;QACnB,OAAO,kBAAkB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;KAC3C;IACD,IAAI,GAAG,CAAC;IACR,IAAI;QACA,MAAM,EAAE,CAAC;KACZ;IACD,OAAO,KAAK,EAAE;QACV,GAAG,GAAG,KAAK,CAAC;KACf;IACD,IAAI,CAAC,IAAI,EAAE,UAAU,IAAI,EAAE;QACvB,IAAI,CA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