| 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 379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 390 return kStatusError; | 390 return kStatusError; |
| 391 | 391 |
| 392 return kStatusDifferent; | 392 return kStatusDifferent; |
| 393 } | 393 } |
| 394 | 394 |
| 395 // It isn't strictly correct to only support ASCII paths, but this | 395 // It isn't strictly correct to only support ASCII paths, but this |
| 396 // program reads paths on stdin and the program that spawns it outputs | 396 // program reads paths on stdin and the program that spawns it outputs |
| 397 // paths as non-wide strings anyway. | 397 // paths as non-wide strings anyway. |
| 398 base::FilePath FilePathFromASCII(const std::string& str) { | 398 base::FilePath FilePathFromASCII(const std::string& str) { |
| 399 #if defined(OS_WIN) | 399 #if defined(OS_WIN) |
| 400 return base::FilePath(ASCIIToWide(str)); | 400 return base::FilePath(base::ASCIIToWide(str)); |
| 401 #else | 401 #else |
| 402 return base::FilePath(str); | 402 return base::FilePath(str); |
| 403 #endif | 403 #endif |
| 404 } | 404 } |
| 405 | 405 |
| 406 int main(int argc, const char* argv[]) { | 406 int main(int argc, const char* argv[]) { |
| 407 base::EnableTerminationOnHeapCorruption(); | 407 base::EnableTerminationOnHeapCorruption(); |
| 408 CommandLine::Init(argc, argv); | 408 CommandLine::Init(argc, argv); |
| 409 const CommandLine& parsed_command_line = *CommandLine::ForCurrentProcess(); | 409 const CommandLine& parsed_command_line = *CommandLine::ForCurrentProcess(); |
| 410 bool histograms = parsed_command_line.HasSwitch(kOptionCompareHistograms); | 410 bool histograms = parsed_command_line.HasSwitch(kOptionCompareHistograms); |
| (...skipping 29 matching lines...) Expand all Loading... |
| 440 base::FilePath(args[2])); | 440 base::FilePath(args[2])); |
| 441 } | 441 } |
| 442 } else if (args.size() == 2) { | 442 } else if (args.size() == 2) { |
| 443 return CompareImages( | 443 return CompareImages( |
| 444 base::FilePath(args[0]), base::FilePath(args[1]), histograms); | 444 base::FilePath(args[0]), base::FilePath(args[1]), histograms); |
| 445 } | 445 } |
| 446 | 446 |
| 447 PrintHelp(); | 447 PrintHelp(); |
| 448 return kStatusError; | 448 return kStatusError; |
| 449 } | 449 } |
| OLD | NEW |