OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 // This file input format is based loosely on | 5 // This file input format is based loosely on |
6 // Tools/DumpRenderTree/ImageDiff.m | 6 // Tools/DumpRenderTree/ImageDiff.m |
7 | 7 |
8 // The exact format of this tool's output to stdout is important, to match | 8 // The exact format of this tool's output to stdout is important, to match |
9 // what the run-webkit-tests script expects. | 9 // what the run-webkit-tests script expects. |
10 | 10 |
(...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
359 filename1 = FilePath(); | 359 filename1 = FilePath(); |
360 } else { | 360 } else { |
361 // Save the first filename in another buffer and wait for the second | 361 // Save the first filename in another buffer and wait for the second |
362 // filename to arrive via stdin. | 362 // filename to arrive via stdin. |
363 filename1 = FilePathFromASCII(stdin_buffer); | 363 filename1 = FilePathFromASCII(stdin_buffer); |
364 } | 364 } |
365 } | 365 } |
366 return 0; | 366 return 0; |
367 } | 367 } |
368 | 368 |
369 const std::vector<CommandLine::StringType>& args = parsed_command_line.args(); | 369 const CommandLine::StringVector& args = parsed_command_line.GetArgs(); |
370 if (parsed_command_line.HasSwitch(kOptionGenerateDiff)) { | 370 if (parsed_command_line.HasSwitch(kOptionGenerateDiff)) { |
371 if (args.size() == 3) { | 371 if (args.size() == 3) { |
372 return DiffImages(FilePath(args[0]), | 372 return DiffImages(FilePath(args[0]), |
373 FilePath(args[1]), | 373 FilePath(args[1]), |
374 FilePath(args[2])); | 374 FilePath(args[2])); |
375 } | 375 } |
376 } else if (args.size() == 2) { | 376 } else if (args.size() == 2) { |
377 return CompareImages(FilePath(args[0]), FilePath(args[1])); | 377 return CompareImages(FilePath(args[0]), FilePath(args[1])); |
378 } | 378 } |
379 | 379 |
380 PrintHelp(); | 380 PrintHelp(); |
381 return kStatusError; | 381 return kStatusError; |
382 } | 382 } |
OLD | NEW |