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 |
11 #include <assert.h> | 11 #include <assert.h> |
12 #include <stdint.h> | 12 #include <stdint.h> |
13 #include <stdio.h> | 13 #include <stdio.h> |
14 #include <string.h> | 14 #include <string.h> |
15 | 15 |
16 #include <algorithm> | 16 #include <algorithm> |
17 #include <iostream> | 17 #include <iostream> |
18 #include <map> | 18 #include <map> |
19 #include <string> | 19 #include <string> |
20 #include <vector> | 20 #include <vector> |
21 | 21 |
22 #include "../third_party/base/logging.h" | |
23 #include "../third_party/base/numerics/safe_conversions.h" | |
24 #include "image_diff_png.h" | 22 #include "image_diff_png.h" |
| 23 #include "third_party/base/logging.h" |
| 24 #include "third_party/base/numerics/safe_conversions.h" |
25 | 25 |
26 #if defined(OS_WIN) | 26 #if defined(OS_WIN) |
27 #include "windows.h" | 27 #include "windows.h" |
28 #endif | 28 #endif |
29 | 29 |
30 // Return codes used by this utility. | 30 // Return codes used by this utility. |
31 static const int kStatusSame = 0; | 31 static const int kStatusSame = 0; |
32 static const int kStatusDifferent = 1; | 32 static const int kStatusDifferent = 1; |
33 static const int kStatusError = 2; | 33 static const int kStatusError = 2; |
34 | 34 |
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
389 if (!diff_filename.empty()) { | 389 if (!diff_filename.empty()) { |
390 return DiffImages(filename1, filename2, diff_filename); | 390 return DiffImages(filename1, filename2, diff_filename); |
391 } | 391 } |
392 } else if (!filename2.empty()) { | 392 } else if (!filename2.empty()) { |
393 return CompareImages(filename1, filename2, histograms); | 393 return CompareImages(filename1, filename2, histograms); |
394 } | 394 } |
395 | 395 |
396 PrintHelp(); | 396 PrintHelp(); |
397 return kStatusError; | 397 return kStatusError; |
398 } | 398 } |
OLD | NEW |