(buildDirectoryPath, useDebugDevtools)
| 102 | } |
| 103 | |
| 104 | function runTests(buildDirectoryPath, useDebugDevtools) { |
| 105 | const testArgs = getInspectorTests().concat([ |
| 106 | '--build-directory', |
| 107 | buildDirectoryPath, |
| 108 | '--target', |
| 109 | TARGET, |
| 110 | ]); |
| 111 | if (useDebugDevtools) { |
| 112 | testArgs.push('--additional-driver-flag=--debug-devtools'); |
| 113 | } else { |
| 114 | console.log( |
| 115 | 'TIP: You can debug a test using: npm run debug-test inspector/test-name.html', |
| 116 | ); |
| 117 | } |
| 118 | |
| 119 | if (IS_DEBUG_ENABLED) { |
| 120 | testArgs.push('--additional-driver-flag=--remote-allow-origins=*'); |
| 121 | testArgs.push('--additional-driver-flag=--remote-debugging-port=9222'); |
| 122 | testArgs.push('--timeout-ms=6000000'); |
| 123 | console.log('\n============================================='); |
| 124 | const unitTest = testArgs.find( |
| 125 | arg => arg.includes('http/tests/devtools/unit/'), |
| 126 | ); |
| 127 | if (unitTest) { |
| 128 | const unitTestPath = `http://localhost:8080/${ |
| 129 | unitTest.slice( |
| 130 | 'http/tests/'.length, |
| 131 | )}`; |
| 132 | const link = `http://localhost:8080/inspector-sources/debug/integration_test_runner.html?test=${unitTestPath}`; |
| 133 | console.log('1) Go to: ', link); |
| 134 | console.log( |
| 135 | '2) Go to: http://localhost:9222/, click on "inspected-page.html", and copy the ws query parameter', |
| 136 | ); |
| 137 | console.log( |
| 138 | '3) Open DevTools on DevTools and you can refresh to re-run the test', |
| 139 | ); |
| 140 | } else { |
| 141 | console.log('Go to: http://localhost:9222/'); |
| 142 | console.log('Click on link and in console execute: test()'); |
| 143 | } |
| 144 | console.log('=============================================\n'); |
| 145 | } |
| 146 | const args = [...testArgs, ...getTestFlags()]; |
| 147 | console.log(`Running web tests with args: ${args.join(' ')}`); |
| 148 | childProcess.spawn(BLINK_TEST_PATH, args, {stdio: 'inherit'}); |
| 149 | } |
| 150 | |
| 151 | function getTestFlags() { |
| 152 | const flagValues = Object.keys(Flags).map(key => Flags[key]); |
no test coverage detected