This tool, a Node.js CLI utility, performs a set of clean-up tasks for layout test files in LayoutTests/webaudio. (Potentially it can be applied to any kind of layout test files in HTML or JS format.)
The clean-up tasks includes:
For every step of clean-up processing, the tool collects warning, diagnostics or notes and print out the logs at the end of the processing.
The run-webkit-tests script process all the files in the webaudio/ directory, so files created by the node package installation will pollute the test result. To avoid this, copy tools/ directory to another directory. Then run the following in that directory.
cd ${WHERE_PACKAGE_JSON_IS} npm install
The warning from html-tidy package can be safely ignored.
node layout-test-tidy [-[viR]] ${TARGET_PATH}
Available options:
-v or --verbose: verbose output. Useful when collecting warnings and notes generated by the tool.-i or --inplace: in-place processing. Write directly into the original file.-R or --recursive: Expand the given path recursively.The result will be written to stdout, and only HTML and JS files with proper file extension (.html, .js) will be processed.
# To collect the result with warning/notes to a file.
node layout-test-tidy -v ${TARGET_PATH} > result.txt
# Apply in-place tidy to the entire layout test files for WebAudio.
node layout-test-tidy -i -R ${CHROME_SRC}/third_party/WebKit/LayoutTests/webaudio