| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 var childProcess = require("child_process"); | 5 var childProcess = require("child_process"); |
| 6 var fs = require("fs"); | 6 var fs = require("fs"); |
| 7 var path = require("path"); | 7 var path = require("path"); |
| 8 var shell = require("child_process").execSync; | 8 var shell = require("child_process").execSync; |
| 9 | 9 |
| 10 var utils = require("./utils"); | 10 var utils = require("./utils"); |
| (...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 219 var contentShellResourcesPath = path.resolve(buildDirectoryPath, "Release",
"resources"); | 219 var contentShellResourcesPath = path.resolve(buildDirectoryPath, "Release",
"resources"); |
| 220 build(contentShellResourcesPath); | 220 build(contentShellResourcesPath); |
| 221 if (IS_BUILD_ONLY) | 221 if (IS_BUILD_ONLY) |
| 222 return; | 222 return; |
| 223 runTests(buildDirectoryPath, {useRelease: false}); | 223 runTests(buildDirectoryPath, {useRelease: false}); |
| 224 } | 224 } |
| 225 | 225 |
| 226 function build(contentShellResourcesPath) | 226 function build(contentShellResourcesPath) |
| 227 { | 227 { |
| 228 var devtoolsResourcesPath = path.resolve(contentShellResourcesPath, "inspect
or"); | 228 var devtoolsResourcesPath = path.resolve(contentShellResourcesPath, "inspect
or"); |
| 229 var copiedFrontendPath = path.resolve(devtoolsResourcesPath, "front_end"); | |
| 230 var debugPath = path.resolve(devtoolsResourcesPath, "debug"); | |
| 231 utils.removeRecursive(copiedFrontendPath); | |
| 232 utils.removeRecursive(debugPath); | |
| 233 utils.copyRecursive(SOURCE_PATH, devtoolsResourcesPath); | |
| 234 fs.renameSync(copiedFrontendPath, debugPath); | |
| 235 var inspectorBackendCommandsPath = path.resolve(devtoolsResourcesPath, "Insp
ectorBackendCommands.js"); | 229 var inspectorBackendCommandsPath = path.resolve(devtoolsResourcesPath, "Insp
ectorBackendCommands.js"); |
| 236 var supportedCSSPropertiesPath = path.resolve(devtoolsResourcesPath, "Suppor
tedCSSProperties.js"); | 230 var supportedCSSPropertiesPath = path.resolve(devtoolsResourcesPath, "Suppor
tedCSSProperties.js"); |
| 237 utils.copy(inspectorBackendCommandsPath, debugPath); | 231 utils.copy(inspectorBackendCommandsPath, SOURCE_PATH); |
| 238 utils.copy(supportedCSSPropertiesPath, debugPath); | 232 utils.copy(supportedCSSPropertiesPath, SOURCE_PATH); |
| 239 } | 233 } |
| 240 | 234 |
| 241 function runTests(buildDirectoryPath, options) | 235 function runTests(buildDirectoryPath, options) |
| 242 { | 236 { |
| 243 var testArgs = getInspectorTests().concat([ | 237 var testArgs = getInspectorTests().concat([ |
| 244 "--no-pixel-tests", | 238 "--no-pixel-tests", |
| 245 "--build-directory", | 239 "--build-directory", |
| 246 buildDirectoryPath, | 240 buildDirectoryPath, |
| 247 ]); | 241 ]); |
| 248 if (!options.useRelease) | 242 if (!options.useRelease) { |
| 249 testArgs.push("--additional-driver-flag=--debug-devtools"); | 243 testArgs.push("--additional-driver-flag=--debug-devtools"); |
| 244 testArgs.push(`--additional-driver-flag=--custom-devtools-frontend=${SOU
RCE_PATH}`); |
| 245 } |
| 250 if (IS_DEBUG_ENABLED) { | 246 if (IS_DEBUG_ENABLED) { |
| 251 testArgs.push("--additional-driver-flag=--remote-debugging-port=9222"); | 247 testArgs.push("--additional-driver-flag=--remote-debugging-port=9222"); |
| 252 testArgs.push("--time-out-ms=6000000"); | 248 testArgs.push("--time-out-ms=6000000"); |
| 253 console.log("\n============================================="); | 249 console.log("\n============================================="); |
| 254 console.log("Go to: http://localhost:9222/"); | 250 console.log("Go to: http://localhost:9222/"); |
| 255 console.log("Click on link and in console execute: test()"); | 251 console.log("Click on link and in console execute: test()"); |
| 256 console.log("=============================================\n"); | 252 console.log("=============================================\n"); |
| 257 } | 253 } |
| 258 var args = [BLINK_TEST_PATH].concat(testArgs).concat(getTestFlags()); | 254 var args = [BLINK_TEST_PATH].concat(testArgs).concat(getTestFlags()); |
| 259 console.log(`Running layout tests with args: ${args}`); | 255 console.log(`Running layout tests with args: ${args}`); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 271 function getInspectorTests() | 267 function getInspectorTests() |
| 272 { | 268 { |
| 273 var specificTests = process.argv.filter(arg => utils.includes(arg, "inspecto
r")); | 269 var specificTests = process.argv.filter(arg => utils.includes(arg, "inspecto
r")); |
| 274 if (specificTests.length) | 270 if (specificTests.length) |
| 275 return specificTests; | 271 return specificTests; |
| 276 return [ | 272 return [ |
| 277 "inspector*", | 273 "inspector*", |
| 278 "http/tests/inspector*", | 274 "http/tests/inspector*", |
| 279 ]; | 275 ]; |
| 280 } | 276 } |
| OLD | NEW |