| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 #include "base/command_line.h" | 5 #include "base/command_line.h" |
| 6 #include "base/file_util.h" | 6 #include "base/file_util.h" |
| 7 #include "base/files/file_enumerator.h" | 7 #include "base/files/file_enumerator.h" |
| 8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
| 9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
| 10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
| (...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 248 rt = false; | 248 rt = false; |
| 249 } else { | 249 } else { |
| 250 LOG(INFO) << "Saved reference image to: " | 250 LOG(INFO) << "Saved reference image to: " |
| 251 << img_path.value(); | 251 << img_path.value(); |
| 252 } | 252 } |
| 253 if (rt) { | 253 if (rt) { |
| 254 if (!WriteREVFile(rev_path)) { | 254 if (!WriteREVFile(rev_path)) { |
| 255 LOG(ERROR) << "Can't save revision file to: " | 255 LOG(ERROR) << "Can't save revision file to: " |
| 256 << rev_path.value(); | 256 << rev_path.value(); |
| 257 rt = false; | 257 rt = false; |
| 258 base::Delete(img_path, false); | 258 base::DeleteFile(img_path, false); |
| 259 } else { | 259 } else { |
| 260 LOG(INFO) << "Saved revision file to: " | 260 LOG(INFO) << "Saved revision file to: " |
| 261 << rev_path.value(); | 261 << rev_path.value(); |
| 262 } | 262 } |
| 263 } | 263 } |
| 264 if (ref_img_revision_ > 0) { | 264 if (ref_img_revision_ > 0) { |
| 265 LOG(ERROR) << "Can't read the local ref image: " | 265 LOG(ERROR) << "Can't read the local ref image: " |
| 266 << img_path.value() | 266 << img_path.value() |
| 267 << ", reset it."; | 267 << ", reset it."; |
| 268 rt = false; | 268 rt = false; |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 418 continue; | 418 continue; |
| 419 if (revision < ref_img_revision_no_older_than_ || | 419 if (revision < ref_img_revision_no_older_than_ || |
| 420 revision < max_revision) { | 420 revision < max_revision) { |
| 421 outdated_revs.push_back(full_path); | 421 outdated_revs.push_back(full_path); |
| 422 continue; | 422 continue; |
| 423 } | 423 } |
| 424 max_revision = revision; | 424 max_revision = revision; |
| 425 } | 425 } |
| 426 ref_img_revision_ = max_revision; | 426 ref_img_revision_ = max_revision; |
| 427 for (size_t i = 0; i < outdated_revs.size(); ++i) | 427 for (size_t i = 0; i < outdated_revs.size(); ++i) |
| 428 base::Delete(outdated_revs[i], false); | 428 base::DeleteFile(outdated_revs[i], false); |
| 429 } | 429 } |
| 430 | 430 |
| 431 DISALLOW_COPY_AND_ASSIGN(GpuPixelBrowserTest); | 431 DISALLOW_COPY_AND_ASSIGN(GpuPixelBrowserTest); |
| 432 }; | 432 }; |
| 433 | 433 |
| 434 IN_PROC_BROWSER_TEST_F(GpuPixelBrowserTest, MANUAL_WebGLGreenTriangle) { | 434 IN_PROC_BROWSER_TEST_F(GpuPixelBrowserTest, MANUAL_WebGLGreenTriangle) { |
| 435 // If test baseline needs to be updated after a given revision, update the | 435 // If test baseline needs to be updated after a given revision, update the |
| 436 // following number. If no revision requirement, then 0. | 436 // following number. If no revision requirement, then 0. |
| 437 const int64 ref_img_revision_update = 123489; | 437 const int64 ref_img_revision_update = 123489; |
| 438 | 438 |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 553 | 553 |
| 554 gfx::Size container_size(400, 300); | 554 gfx::Size container_size(400, 300); |
| 555 base::FilePath url = | 555 base::FilePath url = |
| 556 test_data_dir().AppendASCII("pixel_browser_plugin.html"); | 556 test_data_dir().AppendASCII("pixel_browser_plugin.html"); |
| 557 RunPixelTest(container_size, url, ref_img_revision_update, | 557 RunPixelTest(container_size, url, ref_img_revision_update, |
| 558 ref_pixels, ref_pixel_count); | 558 ref_pixels, ref_pixel_count); |
| 559 } | 559 } |
| 560 | 560 |
| 561 } // namespace content | 561 } // namespace content |
| 562 | 562 |
| OLD | NEW |