Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5)

Side by Side Diff: third_party/WebKit/LayoutTests/webaudio/tools/layout-test-tidy.js

Issue 2895963003: Apply layout-test-tidy to LayoutTests/webaudio (Closed)
Patch Set: Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 #!/usr/bin/env node 1 #!/usr/bin/env node
2 2
3 // Copyright 2017 The Chromium Authors. All rights reserved. 3 // Copyright 2017 The Chromium Authors. All rights reserved.
4 // Use of this source code is governed by a BSD-style license that can be 4 // Use of this source code is governed by a BSD-style license that can be
5 // found in the LICENSE file. 5 // found in the LICENSE file.
6 6
7 'use strict'; 7 'use strict';
8 8
9 const os = require('os'); 9 const os = require('os');
10 const fs = require('fs'); 10 const fs = require('fs');
(...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after
346 // Clean up the head element section. 346 // Clean up the head element section.
347 DOMUtil.tidyHeadElementSync(this.jsdom_.window.document, this); 347 DOMUtil.tidyHeadElementSync(this.jsdom_.window.document, this);
348 348
349 let scriptElement = 349 let scriptElement =
350 DOMUtil.getElementWithTestCodeSync(this.jsdom_.window.document, this); 350 DOMUtil.getElementWithTestCodeSync(this.jsdom_.window.document, this);
351 351
352 if (!scriptElement) 352 if (!scriptElement)
353 Util.logAndExit('TidyTask.processHTML_', 'Invalid <script> element.'); 353 Util.logAndExit('TidyTask.processHTML_', 'Invalid <script> element.');
354 354
355 // Start with clang-foramt, then HTMLTidy and RegExp substitution. 355 // Start with clang-foramt, then HTMLTidy and RegExp substitution.
356 Module.runClangFormat( 356 Module
357 scriptElement.textContent, OPTIONS.ClangFormat, 3, this) 357 .runClangFormat(scriptElement.textContent, OPTIONS.ClangFormat, 3, this)
Raymond Toy 2017/05/23 16:47:18 Does this mean that you forgot to run tidy on the
358 .then((formattedCodeString) => { 358 .then((formattedCodeString) => {
359 // Replace the original code with clang-formatted code. 359 // Replace the original code with clang-formatted code.
360 scriptElement.textContent = formattedCodeString; 360 scriptElement.textContent = formattedCodeString;
361 361
362 // Then tidy the text data from JSDOM. After this point, DOM 362 // Then tidy the text data from JSDOM. After this point, DOM
363 // manipulation is not possible anymore. 363 // manipulation is not possible anymore.
364 let pageString = this.jsdom_.serialize(); 364 let pageString = this.jsdom_.serialize();
365 pageString = 365 pageString =
366 Module.runHTMLTidySync(pageString, OPTIONS.HTMLTidy, this); 366 Module.runHTMLTidySync(pageString, OPTIONS.HTMLTidy, this);
367 pageString = Module.runRegExpSwapSync( 367 pageString = Module.runRegExpSwapSync(
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
553 553
554 if (files.length > 0) { 554 if (files.length > 0) {
555 let taskRunner = new TidyTaskRunner(files, options); 555 let taskRunner = new TidyTaskRunner(files, options);
556 taskRunner.startProcessing(); 556 taskRunner.startProcessing();
557 } else { 557 } else {
558 Util.logAndExit('main', 'No files to process.'); 558 Util.logAndExit('main', 'No files to process.');
559 } 559 }
560 } 560 }
561 561
562 main(); 562 main();
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/webaudio/test-basic.html ('k') | third_party/WebKit/LayoutTests/webaudio/unit-tests/audit.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698