Updated the files.
This commit is contained in:
parent
1553e6b971
commit
753967d4f5
23418 changed files with 3784666 additions and 0 deletions
217
my-app/node_modules/karma-chrome-launcher/CHANGELOG.md
generated
vendored
Executable file
217
my-app/node_modules/karma-chrome-launcher/CHANGELOG.md
generated
vendored
Executable file
|
@ -0,0 +1,217 @@
|
|||
# [3.2.0](https://github.com/karma-runner/karma-chrome-launcher/compare/v3.1.1...v3.2.0) (2023-04-20)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* add process.env.ProgramW6432 as root location for binaries ([12a73db](https://github.com/karma-runner/karma-chrome-launcher/commit/12a73dba261c78fdba4aff4dbb741ac87adfed01))
|
||||
|
||||
## [3.1.1](https://github.com/karma-runner/karma-chrome-launcher/compare/v3.1.0...v3.1.1) (2022-03-09)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* artificially trigger a release ([83fdc3c](https://github.com/karma-runner/karma-chrome-launcher/commit/83fdc3ca5666374c677408ed0589e66b1124bec4))
|
||||
|
||||
<a name="3.1.0"></a>
|
||||
# [3.1.0](https://github.com/karma-runner/karma-chrome-launcher/compare/v3.0.0...v3.1.0) (2019-08-13)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* add --disable-dev-shm-usage flag to headless ([137005d](https://github.com/karma-runner/karma-chrome-launcher/commit/137005d))
|
||||
|
||||
|
||||
|
||||
<a name="3.0.0"></a>
|
||||
# [3.0.0](https://github.com/karma-runner/karma-chrome-launcher/compare/v2.2.0...v3.0.0) (2019-07-12)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* allow overriding of the default debug port ([26ae9f4](https://github.com/karma-runner/karma-chrome-launcher/commit/26ae9f4)), closes [#187](https://github.com/karma-runner/karma-chrome-launcher/issues/187)
|
||||
|
||||
|
||||
|
||||
<a name="2.2.0"></a>
|
||||
# [2.2.0](https://github.com/karma-runner/karma-chrome-launcher/compare/v2.1.1...v2.2.0) (2017-06-23)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* add ChromiumHeadless ([7a12021](https://github.com/karma-runner/karma-chrome-launcher/commit/7a12021))
|
||||
|
||||
|
||||
|
||||
<a name="2.1.1"></a>
|
||||
## [2.1.1](https://github.com/karma-runner/karma-chrome-launcher/compare/v2.1.0...v2.1.1) (2017-05-05)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* add disable-renderer-backgrounding flag ([6bfc170](https://github.com/karma-runner/karma-chrome-launcher/commit/6bfc170)), closes [#123](https://github.com/karma-runner/karma-chrome-launcher/issues/123)
|
||||
|
||||
|
||||
|
||||
<a name="2.1.0"></a>
|
||||
# [2.1.0](https://github.com/karma-runner/karma-chrome-launcher/compare/v2.0.0...v2.1.0) (2017-05-02)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* add support for custom user-data-dir in Chromium ([579fcfc](https://github.com/karma-runner/karma-chrome-launcher/commit/579fcfc)), closes [#89](https://github.com/karma-runner/karma-chrome-launcher/issues/89)
|
||||
* add support for headless Chrome/ChromeCanary ([7446181](https://github.com/karma-runner/karma-chrome-launcher/commit/7446181))
|
||||
|
||||
|
||||
|
||||
<a name="2.0.0"></a>
|
||||
# [2.0.0](https://github.com/karma-runner/karma-chrome-launcher/compare/v1.0.1...v2.0.0) (2016-08-18)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* Chromium support for Linux, Darwin and Windows ([33e8d82](https://github.com/karma-runner/karma-chrome-launcher/commit/33e8d82))
|
||||
|
||||
|
||||
|
||||
<a name="1.0.1"></a>
|
||||
## [1.0.1](https://github.com/karma-runner/karma-chrome-launcher/compare/v0.2.3...v1.0.1) (2016-05-02)
|
||||
|
||||
|
||||
|
||||
|
||||
<a name="0.2.3"></a>
|
||||
## [0.2.3](https://github.com/karma-runner/karma-chrome-launcher/compare/v0.2.1...v0.2.3) (2016-03-22)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **config:** Allow --user-data-dir to be set in launcher properties ([2c0b7f4](https://github.com/karma-runner/karma-chrome-launcher/commit/2c0b7f4))
|
||||
|
||||
|
||||
|
||||
<a name="0.2.2"></a>
|
||||
## [0.2.2](https://github.com/karma-runner/karma-chrome-launcher/compare/v0.2.1...v0.2.2) (2015-12-01)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* chrome will ignore command line flags it does not yet know about ([426e7c3](https://github.com/karma-runner/karma-chrome-launcher/commit/426e7c3))
|
||||
|
||||
|
||||
|
||||
<a name="0.2.1"></a>
|
||||
## [0.2.1](https://github.com/karma-runner/karma-chrome-launcher/compare/v0.2.0...v0.2.1) (2015-10-07)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **ChromeCanary:** on Linux (archlinux), it can be named google-chrome-unstable ([28cb5b0](https://github.com/karma-runner/karma-chrome-launcher/commit/28cb5b0))
|
||||
|
||||
|
||||
|
||||
<a name"0.2.0"></a>
|
||||
## 0.2.0 (2015-06-23)
|
||||
|
||||
|
||||
#### Bug Fixes
|
||||
|
||||
* Use fs-access shim for file detection. ([6355ca88](https://github.com/karma-runner/karma-chrome-launcher/commit/6355ca88), closes [#53](https://github.com/karma-runner/karma-chrome-launcher/issues/53))
|
||||
|
||||
|
||||
<a name"0.1.9"></a>
|
||||
### 0.1.9 (2015-06-23)
|
||||
|
||||
|
||||
<a name"0.1.8"></a>
|
||||
### 0.1.8 (2015-06-23)
|
||||
|
||||
|
||||
<a name"0.1.7"></a>
|
||||
### 0.1.7 (2015-06-23)
|
||||
|
||||
|
||||
<a name"0.1.6"></a>
|
||||
### 0.1.6 (2015-06-23)
|
||||
|
||||
|
||||
#### Bug Fixes
|
||||
|
||||
* **jsFlags:** un-quote --js-flags flag and automatically merge with presets ([4509c277](https://github.com/karma-runner/karma-chrome-launcher/commit/4509c277))
|
||||
|
||||
|
||||
<a name"0.1.5"></a>
|
||||
### 0.1.5 (2015-06-23)
|
||||
|
||||
|
||||
#### Bug Fixes
|
||||
|
||||
* better error when DARTIUM_BIN not set ([27462e86](https://github.com/karma-runner/karma-chrome-launcher/commit/27462e86))
|
||||
|
||||
|
||||
<a name"0.1.4"></a>
|
||||
### 0.1.4 (2015-06-23)
|
||||
|
||||
|
||||
#### Bug Fixes
|
||||
|
||||
* the translation is now disabled on launch ([b2f389ba](https://github.com/karma-runner/karma-chrome-launcher/commit/b2f389ba))
|
||||
|
||||
|
||||
<a name"0.1.3"></a>
|
||||
### 0.1.3 (2015-06-23)
|
||||
|
||||
|
||||
#### Features
|
||||
|
||||
* **Launcher:** Add Dartium launcher. ([ae81c0c1](https://github.com/karma-runner/karma-chrome-launcher/commit/ae81c0c1))
|
||||
|
||||
|
||||
<a name"0.1.2"></a>
|
||||
### 0.1.2 (2015-06-23)
|
||||
|
||||
|
||||
<a name"0.1.12"></a>
|
||||
### 0.1.12 (2015-06-23)
|
||||
|
||||
|
||||
<a name"0.1.11"></a>
|
||||
### 0.1.11 (2015-06-23)
|
||||
|
||||
|
||||
<a name"0.1.10"></a>
|
||||
### 0.1.10 (2015-06-23)
|
||||
|
||||
|
||||
#### Bug Fixes
|
||||
|
||||
* better error when DARTIUM_BIN not set ([27462e86](https://github.com/karma-runner/karma-chrome-launcher/commit/27462e86))
|
||||
* the translation is now disabled on launch ([b2f389ba](https://github.com/karma-runner/karma-chrome-launcher/commit/b2f389ba))
|
||||
* **jsFlags:** un-quote --js-flags flag and automatically merge with presets ([4509c277](https://github.com/karma-runner/karma-chrome-launcher/commit/4509c277))
|
||||
|
||||
|
||||
#### Features
|
||||
|
||||
* disable popup blocking by default ([2cdace9e](https://github.com/karma-runner/karma-chrome-launcher/commit/2cdace9e))
|
||||
* **Launcher:** Add Dartium launcher. ([ae81c0c1](https://github.com/karma-runner/karma-chrome-launcher/commit/ae81c0c1))
|
||||
|
||||
|
||||
<a name"0.1.1"></a>
|
||||
### 0.1.1 (2015-06-23)
|
||||
|
||||
|
||||
#### Bug Fixes
|
||||
|
||||
* handle Chrome location on Windows ([62df3014](https://github.com/karma-runner/karma-chrome-launcher/commit/62df3014))
|
||||
* correct Chrome path on Windows ([9ebd9974](https://github.com/karma-runner/karma-chrome-launcher/commit/9ebd9974), closes [#2](https://github.com/karma-runner/karma-chrome-launcher/issues/2))
|
||||
|
||||
|
||||
<a name"0.1.0"></a>
|
||||
## 0.1.0 (2015-06-23)
|
||||
|
||||
|
||||
<a name"0.0.2"></a>
|
||||
### 0.0.2 (2015-06-23)
|
||||
|
||||
|
||||
#### Features
|
||||
|
||||
* allow passing custom flags ([4ebc7694](https://github.com/karma-runner/karma-chrome-launcher/commit/4ebc7694))
|
20
my-app/node_modules/karma-chrome-launcher/LICENSE
generated
vendored
Executable file
20
my-app/node_modules/karma-chrome-launcher/LICENSE
generated
vendored
Executable file
|
@ -0,0 +1,20 @@
|
|||
The MIT License
|
||||
|
||||
Copyright (C) 2011-2013 Google, Inc.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
of the Software, and to permit persons to whom the Software is furnished to do
|
||||
so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
93
my-app/node_modules/karma-chrome-launcher/README.md
generated
vendored
Executable file
93
my-app/node_modules/karma-chrome-launcher/README.md
generated
vendored
Executable file
|
@ -0,0 +1,93 @@
|
|||
# karma-chrome-launcher
|
||||
|
||||
[](https://github.com/karma-runner/karma-chrome-launcher)
|
||||
[](https://www.npmjs.com/package/karma-chrome-launcher) [](https://www.npmjs.com/package/karma-chrome-launcher)
|
||||
|
||||
[](https://travis-ci.org/karma-runner/karma-chrome-launcher) [](https://david-dm.org/karma-runner/karma-chrome-launcher) [](https://david-dm.org/karma-runner/karma-chrome-launcher#info=devDependencies)
|
||||
|
||||
> Launcher for Google Chrome, Google Chrome Canary and Google Chromium.
|
||||
|
||||
## Installation
|
||||
|
||||
The easiest way is to keep `karma-chrome-launcher` as a devDependency in your `package.json`,
|
||||
by running
|
||||
|
||||
```bash
|
||||
$ npm i -D karma-chrome-launcher
|
||||
```
|
||||
|
||||
## Configuration
|
||||
|
||||
```js
|
||||
// karma.conf.js
|
||||
module.exports = function(config) {
|
||||
config.set({
|
||||
browsers: ['Chrome', 'Chrome_without_security'], // You may use 'ChromeCanary', 'Chromium' or any other supported browser
|
||||
|
||||
// you can define custom flags
|
||||
customLaunchers: {
|
||||
Chrome_without_security: {
|
||||
base: 'Chrome',
|
||||
flags: ['--disable-web-security', '--disable-site-isolation-trials']
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
```
|
||||
|
||||
The `--user-data-dir` is set to a temporary directory but can be overridden on a custom launcher as shown below.
|
||||
One reason to do this is to have a permanent Chrome user data directory inside the project directory to be able to
|
||||
install plugins there (e.g. JetBrains IDE Support plugin).
|
||||
|
||||
```js
|
||||
customLaunchers: {
|
||||
Chrome_with_debugging: {
|
||||
base: 'Chrome',
|
||||
chromeDataDir: path.resolve(__dirname, '.chrome')
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
You can pass list of browsers as a CLI argument too:
|
||||
|
||||
```bash
|
||||
$ karma start --browsers Chrome,Chrome_without_security
|
||||
```
|
||||
|
||||
## Headless Chromium with Puppeteer
|
||||
|
||||
The Chrome DevTools team created [Puppeteer](https://github.com/GoogleChrome/puppeteer) - it will automatically install Chromium for all
|
||||
platforms and contains everything you need to run it from within your CI.
|
||||
|
||||
### Available Browsers
|
||||
*Note: Headless mode requires a browser version >= 59*
|
||||
|
||||
- Chrome (CHROME_BIN)
|
||||
- ChromeHeadless (CHROME_BIN)
|
||||
- Chromium (CHROMIUM_BIN)
|
||||
- ChromiumHeadless (CHROMIUM_BIN)
|
||||
- ChromeCanary (CHROME_CANARY_BIN)
|
||||
- ChromeCanaryHeadless (CHROME_CANARY_BIN)
|
||||
- Dartium (DARTIUM_BIN)
|
||||
|
||||
#### Usage
|
||||
```bash
|
||||
$ npm i -D puppeteer karma-chrome-launcher
|
||||
```
|
||||
|
||||
```js
|
||||
// karma.conf.js
|
||||
process.env.CHROME_BIN = require('puppeteer').executablePath()
|
||||
|
||||
module.exports = function(config) {
|
||||
config.set({
|
||||
browsers: ['ChromeHeadless']
|
||||
})
|
||||
}
|
||||
```
|
||||
|
||||
----
|
||||
|
||||
For more information on Karma see the [homepage].
|
||||
|
||||
[homepage]: https://karma-runner.github.io
|
1
my-app/node_modules/karma-chrome-launcher/commitlint.config.js
generated
vendored
Executable file
1
my-app/node_modules/karma-chrome-launcher/commitlint.config.js
generated
vendored
Executable file
|
@ -0,0 +1 @@
|
|||
module.exports = { extends: ['@commitlint/config-angular'] }
|
7
my-app/node_modules/karma-chrome-launcher/examples/simple/index.spec.js
generated
vendored
Executable file
7
my-app/node_modules/karma-chrome-launcher/examples/simple/index.spec.js
generated
vendored
Executable file
|
@ -0,0 +1,7 @@
|
|||
/* eslint-env mocha */
|
||||
|
||||
describe('ChromeLauncher', function () {
|
||||
it('works', function () {
|
||||
return 1 + 1 === 2
|
||||
})
|
||||
})
|
32
my-app/node_modules/karma-chrome-launcher/examples/simple/karma.conf.js
generated
vendored
Executable file
32
my-app/node_modules/karma-chrome-launcher/examples/simple/karma.conf.js
generated
vendored
Executable file
|
@ -0,0 +1,32 @@
|
|||
module.exports = function (config) {
|
||||
config.set({
|
||||
basePath: '',
|
||||
|
||||
frameworks: ['mocha'],
|
||||
|
||||
files: [
|
||||
'*.js'
|
||||
],
|
||||
|
||||
exclude: [],
|
||||
|
||||
reporters: ['progress'],
|
||||
|
||||
port: 9876,
|
||||
|
||||
colors: true,
|
||||
|
||||
logLevel: config.LOG_INFO,
|
||||
|
||||
autoWatch: false,
|
||||
|
||||
browsers: ['Chrome'],
|
||||
|
||||
singleRun: false,
|
||||
|
||||
plugins: [
|
||||
require('../../'),
|
||||
'karma-mocha'
|
||||
]
|
||||
})
|
||||
}
|
339
my-app/node_modules/karma-chrome-launcher/index.js
generated
vendored
Executable file
339
my-app/node_modules/karma-chrome-launcher/index.js
generated
vendored
Executable file
|
@ -0,0 +1,339 @@
|
|||
var fs = require('fs')
|
||||
var path = require('path')
|
||||
var which = require('which')
|
||||
|
||||
function isJSFlags (flag) {
|
||||
return flag.indexOf('--js-flags=') === 0
|
||||
}
|
||||
|
||||
function sanitizeJSFlags (flag) {
|
||||
var test = /--js-flags=(['"])/.exec(flag)
|
||||
if (!test) {
|
||||
return flag
|
||||
}
|
||||
var escapeChar = test[1]
|
||||
var endExp = new RegExp(escapeChar + '$')
|
||||
var startExp = new RegExp('--js-flags=' + escapeChar)
|
||||
return flag.replace(startExp, '--js-flags=').replace(endExp, '')
|
||||
}
|
||||
|
||||
var ChromeBrowser = function (baseBrowserDecorator, args) {
|
||||
baseBrowserDecorator(this)
|
||||
|
||||
var flags = args.flags || []
|
||||
var userDataDir = args.chromeDataDir || this._tempDir
|
||||
|
||||
this._getOptions = function (url) {
|
||||
// Chrome CLI options
|
||||
// http://peter.sh/experiments/chromium-command-line-switches/
|
||||
flags.forEach(function (flag, i) {
|
||||
if (isJSFlags(flag)) {
|
||||
flags[i] = sanitizeJSFlags(flag)
|
||||
}
|
||||
})
|
||||
|
||||
return [
|
||||
'--user-data-dir=' + userDataDir,
|
||||
// https://github.com/GoogleChrome/chrome-launcher/blob/master/docs/chrome-flags-for-tools.md#--enable-automation
|
||||
'--enable-automation',
|
||||
'--no-default-browser-check',
|
||||
'--no-first-run',
|
||||
'--disable-default-apps',
|
||||
'--disable-popup-blocking',
|
||||
'--disable-translate',
|
||||
'--disable-background-timer-throttling',
|
||||
// on macOS, disable-background-timer-throttling is not enough
|
||||
// and we need disable-renderer-backgrounding too
|
||||
// see https://github.com/karma-runner/karma-chrome-launcher/issues/123
|
||||
'--disable-renderer-backgrounding',
|
||||
'--disable-device-discovery-notifications'
|
||||
].concat(flags, [url])
|
||||
}
|
||||
}
|
||||
|
||||
// Return location of chrome.exe file for a given Chrome directory (available: "Chrome", "Chrome SxS").
|
||||
function getChromeExe (chromeDirName) {
|
||||
// Only run these checks on win32
|
||||
if (process.platform !== 'win32') {
|
||||
return null
|
||||
}
|
||||
var windowsChromeDirectory, i, prefix
|
||||
var suffix = '\\Google\\' + chromeDirName + '\\Application\\chrome.exe'
|
||||
var prefixes = [process.env.LOCALAPPDATA, process.env.PROGRAMFILES, process.env['PROGRAMFILES(X86)'], process.env.ProgramW6432]
|
||||
|
||||
for (i = 0; i < prefixes.length; i++) {
|
||||
prefix = prefixes[i]
|
||||
try {
|
||||
windowsChromeDirectory = path.join(prefix, suffix)
|
||||
fs.accessSync(windowsChromeDirectory)
|
||||
return windowsChromeDirectory
|
||||
} catch (e) {}
|
||||
}
|
||||
|
||||
return windowsChromeDirectory
|
||||
}
|
||||
|
||||
var ChromiumBrowser = function (baseBrowserDecorator, args) {
|
||||
baseBrowserDecorator(this)
|
||||
|
||||
var flags = args.flags || []
|
||||
var userDataDir = args.chromeDataDir || this._tempDir
|
||||
|
||||
this._getOptions = function (url) {
|
||||
// Chromium CLI options
|
||||
// http://peter.sh/experiments/chromium-command-line-switches/
|
||||
flags.forEach(function (flag, i) {
|
||||
if (isJSFlags(flag)) {
|
||||
flags[i] = sanitizeJSFlags(flag)
|
||||
}
|
||||
})
|
||||
|
||||
return [
|
||||
'--user-data-dir=' + userDataDir,
|
||||
'--no-default-browser-check',
|
||||
'--no-first-run',
|
||||
'--disable-default-apps',
|
||||
'--disable-popup-blocking',
|
||||
'--disable-translate',
|
||||
'--disable-background-timer-throttling'
|
||||
].concat(flags, [url])
|
||||
}
|
||||
}
|
||||
|
||||
// Return location of Chromium's chrome.exe file.
|
||||
function getChromiumExe (chromeDirName) {
|
||||
// Only run these checks on win32
|
||||
if (process.platform !== 'win32') {
|
||||
return null
|
||||
}
|
||||
var windowsChromiumDirectory, i, prefix
|
||||
var suffix = '\\Chromium\\Application\\chrome.exe'
|
||||
var prefixes = [process.env.LOCALAPPDATA, process.env.PROGRAMFILES, process.env['PROGRAMFILES(X86)'], process.env.ProgramW6432]
|
||||
|
||||
for (i = 0; i < prefixes.length; i++) {
|
||||
prefix = prefixes[i]
|
||||
try {
|
||||
windowsChromiumDirectory = path.join(prefix, suffix)
|
||||
fs.accessSync(windowsChromiumDirectory)
|
||||
return windowsChromiumDirectory
|
||||
} catch (e) {}
|
||||
}
|
||||
|
||||
return windowsChromiumDirectory
|
||||
}
|
||||
|
||||
function getBin (commands) {
|
||||
// Don't run these checks on win32
|
||||
if (process.platform !== 'linux') {
|
||||
return null
|
||||
}
|
||||
var bin, i
|
||||
for (i = 0; i < commands.length; i++) {
|
||||
try {
|
||||
if (which.sync(commands[i])) {
|
||||
bin = commands[i]
|
||||
break
|
||||
}
|
||||
} catch (e) {}
|
||||
}
|
||||
return bin
|
||||
}
|
||||
|
||||
function getChromeDarwin (defaultPath) {
|
||||
if (process.platform !== 'darwin') {
|
||||
return null
|
||||
}
|
||||
|
||||
try {
|
||||
var homePath = path.join(process.env.HOME, defaultPath)
|
||||
fs.accessSync(homePath)
|
||||
return homePath
|
||||
} catch (e) {
|
||||
return defaultPath
|
||||
}
|
||||
}
|
||||
|
||||
ChromeBrowser.prototype = {
|
||||
name: 'Chrome',
|
||||
|
||||
DEFAULT_CMD: {
|
||||
linux: getBin(['google-chrome', 'google-chrome-stable']),
|
||||
darwin: getChromeDarwin('/Applications/Google Chrome.app/Contents/MacOS/Google Chrome'),
|
||||
win32: getChromeExe('Chrome')
|
||||
},
|
||||
ENV_CMD: 'CHROME_BIN'
|
||||
}
|
||||
|
||||
ChromeBrowser.$inject = ['baseBrowserDecorator', 'args']
|
||||
|
||||
function headlessGetOptions (url, args, parent) {
|
||||
var mergedArgs = parent.call(this, url, args).concat([
|
||||
'--headless',
|
||||
'--disable-gpu',
|
||||
'--disable-dev-shm-usage'
|
||||
])
|
||||
|
||||
var isRemoteDebuggingFlag = function (flag) {
|
||||
return flag.indexOf('--remote-debugging-port=') !== -1
|
||||
}
|
||||
|
||||
return mergedArgs.some(isRemoteDebuggingFlag)
|
||||
? mergedArgs
|
||||
: mergedArgs.concat(['--remote-debugging-port=9222'])
|
||||
}
|
||||
|
||||
var ChromeHeadlessBrowser = function (baseBrowserDecorator, args) {
|
||||
ChromeBrowser.apply(this, arguments)
|
||||
|
||||
var parentOptions = this._getOptions
|
||||
this._getOptions = function (url) {
|
||||
return headlessGetOptions.call(this, url, args, parentOptions)
|
||||
}
|
||||
}
|
||||
|
||||
ChromeHeadlessBrowser.prototype = {
|
||||
name: 'ChromeHeadless',
|
||||
|
||||
DEFAULT_CMD: {
|
||||
linux: getBin(['google-chrome', 'google-chrome-stable']),
|
||||
darwin: getChromeDarwin('/Applications/Google Chrome.app/Contents/MacOS/Google Chrome'),
|
||||
win32: getChromeExe('Chrome')
|
||||
},
|
||||
ENV_CMD: 'CHROME_BIN'
|
||||
}
|
||||
|
||||
ChromeHeadlessBrowser.$inject = ['baseBrowserDecorator', 'args']
|
||||
|
||||
function canaryGetOptions (url, args, parent) {
|
||||
// disable crankshaft optimizations, as it causes lot of memory leaks (as of Chrome 23.0)
|
||||
var flags = args.flags || []
|
||||
var augmentedFlags
|
||||
var customFlags = '--nocrankshaft --noopt'
|
||||
|
||||
flags.forEach(function (flag) {
|
||||
if (isJSFlags(flag)) {
|
||||
augmentedFlags = sanitizeJSFlags(flag) + ' ' + customFlags
|
||||
}
|
||||
})
|
||||
|
||||
return parent.call(this, url).concat([augmentedFlags || '--js-flags=' + customFlags])
|
||||
}
|
||||
|
||||
var ChromeCanaryBrowser = function (baseBrowserDecorator, args) {
|
||||
ChromeBrowser.apply(this, arguments)
|
||||
|
||||
var parentOptions = this._getOptions
|
||||
this._getOptions = function (url) {
|
||||
return canaryGetOptions.call(this, url, args, parentOptions)
|
||||
}
|
||||
}
|
||||
|
||||
ChromeCanaryBrowser.prototype = {
|
||||
name: 'ChromeCanary',
|
||||
|
||||
DEFAULT_CMD: {
|
||||
linux: getBin(['google-chrome-canary', 'google-chrome-unstable']),
|
||||
darwin: getChromeDarwin('/Applications/Google Chrome Canary.app/Contents/MacOS/Google Chrome Canary'),
|
||||
win32: getChromeExe('Chrome SxS')
|
||||
},
|
||||
ENV_CMD: 'CHROME_CANARY_BIN'
|
||||
}
|
||||
|
||||
ChromeCanaryBrowser.$inject = ['baseBrowserDecorator', 'args']
|
||||
|
||||
var ChromeCanaryHeadlessBrowser = function (baseBrowserDecorator, args) {
|
||||
ChromeCanaryBrowser.apply(this, arguments)
|
||||
|
||||
var parentOptions = this._getOptions
|
||||
this._getOptions = function (url) {
|
||||
return headlessGetOptions.call(this, url, args, parentOptions)
|
||||
}
|
||||
}
|
||||
|
||||
ChromeCanaryHeadlessBrowser.prototype = {
|
||||
name: 'ChromeCanaryHeadless',
|
||||
|
||||
DEFAULT_CMD: {
|
||||
linux: getBin(['google-chrome-canary', 'google-chrome-unstable']),
|
||||
darwin: getChromeDarwin('/Applications/Google Chrome Canary.app/Contents/MacOS/Google Chrome Canary'),
|
||||
win32: getChromeExe('Chrome SxS')
|
||||
},
|
||||
ENV_CMD: 'CHROME_CANARY_BIN'
|
||||
}
|
||||
|
||||
ChromeCanaryHeadlessBrowser.$inject = ['baseBrowserDecorator', 'args']
|
||||
|
||||
ChromiumBrowser.prototype = {
|
||||
name: 'Chromium',
|
||||
|
||||
DEFAULT_CMD: {
|
||||
// Try chromium-browser before chromium to avoid conflict with the legacy
|
||||
// chromium-bsu package previously known as 'chromium' in Debian and Ubuntu.
|
||||
linux: getBin(['chromium-browser', 'chromium']),
|
||||
darwin: '/Applications/Chromium.app/Contents/MacOS/Chromium',
|
||||
win32: getChromiumExe()
|
||||
},
|
||||
ENV_CMD: 'CHROMIUM_BIN'
|
||||
}
|
||||
|
||||
ChromiumBrowser.$inject = ['baseBrowserDecorator', 'args']
|
||||
|
||||
var ChromiumHeadlessBrowser = function (baseBrowserDecorator, args) {
|
||||
ChromiumBrowser.apply(this, arguments)
|
||||
|
||||
var parentOptions = this._getOptions
|
||||
this._getOptions = function (url) {
|
||||
return headlessGetOptions.call(this, url, args, parentOptions)
|
||||
}
|
||||
}
|
||||
|
||||
ChromiumHeadlessBrowser.prototype = {
|
||||
name: 'ChromiumHeadless',
|
||||
|
||||
DEFAULT_CMD: {
|
||||
// Try chromium-browser before chromium to avoid conflict with the legacy
|
||||
// chromium-bsu package previously known as 'chromium' in Debian and Ubuntu.
|
||||
linux: getBin(['chromium-browser', 'chromium']),
|
||||
darwin: '/Applications/Chromium.app/Contents/MacOS/Chromium',
|
||||
win32: getChromiumExe()
|
||||
},
|
||||
ENV_CMD: 'CHROMIUM_BIN'
|
||||
}
|
||||
|
||||
var DartiumBrowser = function () {
|
||||
ChromeBrowser.apply(this, arguments)
|
||||
|
||||
var checkedFlag = '--checked'
|
||||
var dartFlags = process.env.DART_FLAGS || ''
|
||||
var flags = dartFlags.split(' ')
|
||||
if (flags.indexOf(checkedFlag) === -1) {
|
||||
flags.push(checkedFlag)
|
||||
process.env.DART_FLAGS = flags.join(' ')
|
||||
}
|
||||
}
|
||||
|
||||
DartiumBrowser.prototype = {
|
||||
name: 'Dartium',
|
||||
DEFAULT_CMD: {},
|
||||
ENV_CMD: 'DARTIUM_BIN'
|
||||
}
|
||||
|
||||
DartiumBrowser.$inject = ['baseBrowserDecorator', 'args']
|
||||
|
||||
// PUBLISH DI MODULE
|
||||
module.exports = {
|
||||
'launcher:Chrome': ['type', ChromeBrowser],
|
||||
'launcher:ChromeHeadless': ['type', ChromeHeadlessBrowser],
|
||||
'launcher:ChromeCanary': ['type', ChromeCanaryBrowser],
|
||||
'launcher:ChromeCanaryHeadless': ['type', ChromeCanaryHeadlessBrowser],
|
||||
'launcher:Chromium': ['type', ChromiumBrowser],
|
||||
'launcher:ChromiumHeadless': ['type', ChromiumHeadlessBrowser],
|
||||
'launcher:Dartium': ['type', DartiumBrowser]
|
||||
}
|
||||
|
||||
module.exports.test = {
|
||||
isJSFlags: isJSFlags,
|
||||
sanitizeJSFlags: sanitizeJSFlags,
|
||||
headlessGetOptions: headlessGetOptions,
|
||||
canaryGetOptions: canaryGetOptions
|
||||
}
|
83
my-app/node_modules/karma-chrome-launcher/package.json
generated
vendored
Executable file
83
my-app/node_modules/karma-chrome-launcher/package.json
generated
vendored
Executable file
|
@ -0,0 +1,83 @@
|
|||
{
|
||||
"name": "karma-chrome-launcher",
|
||||
"version": "3.2.0",
|
||||
"description": "A Karma plugin. Launcher for Chrome and Chrome Canary.",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"lint": "standard",
|
||||
"integration-test": "npx karma start examples/simple/karma.conf.js --single-run --browsers ChromeHeadless",
|
||||
"unit-test": "npx mocha test/*",
|
||||
"test": "npm run unit-test && npm run integration-test",
|
||||
"release": "semantic-release",
|
||||
"commitlint": "commitlint"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/karma-runner/karma-chrome-launcher.git"
|
||||
},
|
||||
"keywords": [
|
||||
"karma-plugin",
|
||||
"karma-launcher",
|
||||
"chrome"
|
||||
],
|
||||
"author": "Vojta Jina <vojta.jina@gmail.com>",
|
||||
"dependencies": {
|
||||
"which": "^1.2.1"
|
||||
},
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"@commitlint/cli": "^12.1.4",
|
||||
"@commitlint/config-angular": "^12.1.4",
|
||||
"@semantic-release/changelog": "^5.0.1",
|
||||
"@semantic-release/git": "^9.0.1",
|
||||
"chai": "^4.2.0",
|
||||
"karma": "^6.4.1",
|
||||
"karma-mocha": "1.x || ^0.2.0",
|
||||
"mocha": "^5.2.0",
|
||||
"semantic-release": "^17.0.1",
|
||||
"sinon": "^7.1.1",
|
||||
"standard": "^12.0.0"
|
||||
},
|
||||
"contributors": [
|
||||
"Mark Ethan Trostler <mark@zzo.com>",
|
||||
"Rogério Vicente <rogeriopvl@gmail.com>",
|
||||
"dignifiedquire <dignifiedquire@gmail.com>",
|
||||
"Jonathan Ginsburg <jon@than.ml>",
|
||||
"rogeriopvl <rogeriopvl@gmail.com>",
|
||||
"Friedel Ziegelmayer <dignifiedquire@gmail.com>",
|
||||
"greenkeeperio-bot <support@greenkeeper.io>",
|
||||
"johnjbarton <johnjbarton@johnjbarton.com>",
|
||||
"Mark Trostler <mark@zzo.com>",
|
||||
"Michał Gołębiowski-Owczarek <m.goleb@gmail.com>",
|
||||
"Friedel Ziegelmayer <friedel.ziegelmayer@gmail.com>",
|
||||
"dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>",
|
||||
"Andrey Taranov <andrey.taranov@nordea.com>",
|
||||
"Aymeric Beaumet <aymeric@beaumet.me>",
|
||||
"Filipe Guerra <alias.mac@gmail.com>",
|
||||
"Alexander Fedyashov <af@e42.guru>",
|
||||
"Darryl Pogue <dvpdiner2@gmail.com>",
|
||||
"David <davidsu@wix.com>",
|
||||
"Florian Richter <florian@lkr24.de>",
|
||||
"Florian-R <florian.r.dev@gmail.com>",
|
||||
"François SIMOND <frsimond@users.noreply.github.com>",
|
||||
"Hai Feng Kao <haifeng@cocoaspice.in>",
|
||||
"J Rob Gant <rgant@alum.wpi.edu>",
|
||||
"J. Abbott <abbotto@users.noreply.github.com>",
|
||||
"Jeff Cross <middlefloor@gmail.com>",
|
||||
"Joe Doyle <valdain@gmail.com>",
|
||||
"Julien Sanchez <julien.sanchez@lim.eu>",
|
||||
"Marko Vuksanovic <markovuksanovic@gmail.com>",
|
||||
"Nicholas Mitchell <mitchellnicholasl@gmail.com>",
|
||||
"Parashuram N <code@r.nparashuram.com>",
|
||||
"Stefan Bley <stefan.bley@zeiss.com>",
|
||||
"Tatsuyuki Ishi <ishitatsuyuki@gmail.com>",
|
||||
"Timo Tijhof <krinklemail@gmail.com>",
|
||||
"Vincent Voyer <vincent.voyer@algolia.com>",
|
||||
"aSemy <897017+aSemy@users.noreply.github.com>",
|
||||
"brutalcrozt <goendoell49@gmail.com>",
|
||||
"cexbrayat <cedric@ninja-squad.com>",
|
||||
"daniel rodriguez <maieutiquer@users.noreply.github.com>",
|
||||
"gkostov <p_e_a@gbg.bg>",
|
||||
"semantic-release-bot <semantic-release-bot@martynus.net>"
|
||||
]
|
||||
}
|
44
my-app/node_modules/karma-chrome-launcher/release.config.js
generated
vendored
Executable file
44
my-app/node_modules/karma-chrome-launcher/release.config.js
generated
vendored
Executable file
|
@ -0,0 +1,44 @@
|
|||
module.exports = {
|
||||
branches: 'master',
|
||||
verifyConditions: [
|
||||
'@semantic-release/changelog',
|
||||
'@semantic-release/github',
|
||||
'@semantic-release/npm'
|
||||
],
|
||||
prepare: [
|
||||
'./tools/update-contributors',
|
||||
'@semantic-release/changelog',
|
||||
'@semantic-release/git',
|
||||
'@semantic-release/npm'
|
||||
],
|
||||
publish: [
|
||||
'@semantic-release/github',
|
||||
'@semantic-release/npm'
|
||||
],
|
||||
success: [
|
||||
'@semantic-release/github'
|
||||
],
|
||||
fail: [
|
||||
'@semantic-release/github'
|
||||
],
|
||||
|
||||
// The release rules determine what kind of release should be triggered
|
||||
// based on the information included in the commit message. The default
|
||||
// rules used by semantic-release are the same, but they are set explicitly
|
||||
// for better visibility.
|
||||
// See https://github.com/semantic-release/commit-analyzer/blob/master/lib/default-release-rules.js
|
||||
releaseRules: [
|
||||
{ breaking: true, release: 'major' },
|
||||
{ revert: true, release: 'patch' },
|
||||
{ type: 'feat', release: 'minor' },
|
||||
{ type: 'fix', release: 'patch' },
|
||||
{ type: 'perf', release: 'patch' }
|
||||
],
|
||||
|
||||
// The preset determines which commits are included in the changelog and how
|
||||
// the changelog is formatted. The default value used by semantic-release is
|
||||
// the same, but it is set explicitly for visibility.
|
||||
// See https://semantic-release.gitbook.io/semantic-release/#commit-message-format
|
||||
// See https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-angular
|
||||
preset: 'angular'
|
||||
}
|
89
my-app/node_modules/karma-chrome-launcher/test/jsflags.spec.js
generated
vendored
Executable file
89
my-app/node_modules/karma-chrome-launcher/test/jsflags.spec.js
generated
vendored
Executable file
|
@ -0,0 +1,89 @@
|
|||
/* eslint-env mocha */
|
||||
|
||||
var expect = require('chai').expect
|
||||
var sinon = require('sinon')
|
||||
|
||||
var launcher = require('../index')
|
||||
|
||||
describe('isJSFlags()', function () {
|
||||
var isJSFlags = launcher.test.isJSFlags
|
||||
|
||||
it('should return true if flag begins with --js-flags=', function () {
|
||||
expect(isJSFlags('--js-flags=--expose-gc')).to.be.eql(true)
|
||||
expect(isJSFlags('--js-flags="--expose-gc"')).to.be.eql(true)
|
||||
expect(isJSFlags("--js-flags='--expose-gc'")).to.be.eql(true)
|
||||
})
|
||||
|
||||
it('should return false if flag does not begin with --js-flags=', function () {
|
||||
expect(isJSFlags(' --js-flags=--expose-gc')).to.be.eql(false)
|
||||
expect(isJSFlags('--js-flags"--expose-gc"')).to.be.eql(false)
|
||||
expect(isJSFlags('--jsflags="--expose-gc"')).to.be.eql(false)
|
||||
})
|
||||
})
|
||||
|
||||
describe('sanitizeJSFlags()', function () {
|
||||
var sanitizeJSFlags = launcher.test.sanitizeJSFlags
|
||||
|
||||
it('should do nothing if flags are not contained in quotes', function () {
|
||||
expect(sanitizeJSFlags('--js-flags=--expose-gc')).to.be.eql('--js-flags=--expose-gc')
|
||||
})
|
||||
|
||||
it('should symmetrically remove single or double quote if wraps all flags', function () {
|
||||
expect(sanitizeJSFlags("--js-flags='--expose-gc'")).to.be.eql('--js-flags=--expose-gc')
|
||||
expect(sanitizeJSFlags('--js-flags="--expose-gc"')).to.be.eql('--js-flags=--expose-gc')
|
||||
})
|
||||
|
||||
it('should NOT remove anything if the flags are not contained within quote', function () {
|
||||
expect(sanitizeJSFlags('--js-flags=--expose-gc="true"')).to.be.eql('--js-flags=--expose-gc="true"')
|
||||
expect(sanitizeJSFlags("--js-flags=--expose-gc='true'")).to.be.eql("--js-flags=--expose-gc='true'")
|
||||
})
|
||||
})
|
||||
|
||||
describe('canaryGetOptions', function () {
|
||||
var canaryGetOptions = launcher.test.canaryGetOptions
|
||||
|
||||
it('should return a merged version of --js-flags', function () {
|
||||
var parent = sinon.stub().returns(['-incognito'])
|
||||
var context = {}
|
||||
var url = 'http://localhost:9876'
|
||||
var args = { flags: ['--js-flags="--expose-gc"'] }
|
||||
expect(canaryGetOptions.call(context, url, args, parent)).to.be.eql([
|
||||
'-incognito',
|
||||
'--js-flags=--expose-gc --nocrankshaft --noopt'
|
||||
])
|
||||
})
|
||||
})
|
||||
|
||||
describe('headlessGetOptions', function () {
|
||||
var headlessGetOptions = launcher.test.headlessGetOptions
|
||||
|
||||
it('should return the headless flags', function () {
|
||||
var parent = sinon.stub().returns(['-incognito'])
|
||||
var context = {}
|
||||
var url = 'http://localhost:9876'
|
||||
var args = {}
|
||||
expect(headlessGetOptions.call(context, url, args, parent)).to.be.eql([
|
||||
'-incognito',
|
||||
'--headless',
|
||||
'--disable-gpu',
|
||||
'--disable-dev-shm-usage',
|
||||
'--remote-debugging-port=9222'
|
||||
])
|
||||
})
|
||||
|
||||
it('should not overwrite custom remote-debugging-port', function () {
|
||||
var parent = sinon.stub().returns(
|
||||
['-incognito', '--remote-debugging-port=9333']
|
||||
)
|
||||
var context = {}
|
||||
var url = 'http://localhost:9876'
|
||||
var args = {}
|
||||
expect(headlessGetOptions.call(context, url, args, parent)).to.be.eql([
|
||||
'-incognito',
|
||||
'--remote-debugging-port=9333',
|
||||
'--headless',
|
||||
'--disable-gpu',
|
||||
'--disable-dev-shm-usage'
|
||||
])
|
||||
})
|
||||
})
|
25
my-app/node_modules/karma-chrome-launcher/tools/update-contributors.js
generated
vendored
Executable file
25
my-app/node_modules/karma-chrome-launcher/tools/update-contributors.js
generated
vendored
Executable file
|
@ -0,0 +1,25 @@
|
|||
// From https://github.com/karma-runner/karma/blob/master/tools/update-contributors.js
|
||||
// When modifying this file also modify upstream.
|
||||
const { execSync } = require('child_process')
|
||||
const { readFileSync, writeFileSync } = require('fs')
|
||||
const { resolve } = require('path')
|
||||
|
||||
const prepare = async (pluginConfig, { logger }) => {
|
||||
// Example output:
|
||||
// 1042 Vojta Jina <vojta.jina@gmail.com>
|
||||
// 412 Friedel Ziegelmayer <friedel.ziegelmayer@gmail.com>
|
||||
// 206 dignifiedquire <friedel.ziegelmayer@gmail.com>
|
||||
// 139 johnjbarton <johnjbarton@johnjbarton.com>
|
||||
const stdout = execSync('git log --pretty=short | git shortlog -nse', { encoding: 'utf8' })
|
||||
|
||||
const pkgPath = resolve(__dirname, '..', 'package.json')
|
||||
const pkg = JSON.parse(readFileSync(pkgPath, 'utf8'))
|
||||
|
||||
// First line is already included as author field. Last line is dropped as it is an empty line.
|
||||
pkg.contributors = stdout.split('\n').slice(1, -1).map((line) => line.replace(/^[\W\d]+/, ''))
|
||||
writeFileSync(pkgPath, JSON.stringify(pkg, undefined, ' ') + '\n', 'utf8')
|
||||
|
||||
logger.info('Updated contributors list.')
|
||||
}
|
||||
|
||||
module.exports = { prepare }
|
Loading…
Add table
Add a link
Reference in a new issue