OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 |
11 #include <algorithm> | 11 #include <algorithm> |
12 #include <vector> | 12 #include <vector> |
13 #include <string> | 13 #include <string> |
14 #include <iostream> | 14 #include <iostream> |
15 | 15 |
16 #include "base/basictypes.h" | 16 #include "base/basictypes.h" |
17 #include "base/command_line.h" | 17 #include "base/command_line.h" |
18 #include "base/file_path.h" | 18 #include "base/file_path.h" |
19 #include "base/file_util.h" | 19 #include "base/file_util.h" |
20 #include "base/logging.h" | 20 #include "base/logging.h" |
21 #include "base/process_util.h" | 21 #include "base/process_util.h" |
22 #include "base/scoped_ptr.h" | 22 #include "base/scoped_ptr.h" |
23 #include "base/string_util.h" | 23 #include "base/string_util.h" |
24 #include "base/utf_string_conversions.h" | 24 #include "base/utf_string_conversions.h" |
25 #include "gfx/codec/png_codec.h" | 25 #include "ui/gfx/codec/png_codec.h" |
26 | 26 |
27 #if defined(OS_WIN) | 27 #if defined(OS_WIN) |
28 #include "windows.h" | 28 #include "windows.h" |
29 #endif | 29 #endif |
30 | 30 |
31 // Causes the app to remain open, waiting for pairs of filenames on stdin. | 31 // Causes the app to remain open, waiting for pairs of filenames on stdin. |
32 // The caller is then responsible for terminating this app. | 32 // The caller is then responsible for terminating this app. |
33 static const char kOptionPollStdin[] = "use-stdin"; | 33 static const char kOptionPollStdin[] = "use-stdin"; |
34 static const char kOptionGenerateDiff[] = "diff"; | 34 static const char kOptionGenerateDiff[] = "diff"; |
35 | 35 |
(...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
371 FilePath(args[1]), | 371 FilePath(args[1]), |
372 FilePath(args[2])); | 372 FilePath(args[2])); |
373 } | 373 } |
374 } else if (args.size() == 2) { | 374 } else if (args.size() == 2) { |
375 return CompareImages(FilePath(args[0]), FilePath(args[1])); | 375 return CompareImages(FilePath(args[0]), FilePath(args[1])); |
376 } | 376 } |
377 | 377 |
378 PrintHelp(); | 378 PrintHelp(); |
379 return kStatusError; | 379 return kStatusError; |
380 } | 380 } |
OLD | NEW |