Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(436)

Side by Side Diff: content/browser/gpu/gpu_pixel_browsertest.cc

Issue 16950028: Move file_util::Delete to the base namespace (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 241 matching lines...) Expand 10 before | Expand all | Expand 10 after
252 rt = false; 252 rt = false;
253 } else { 253 } else {
254 LOG(INFO) << "Saved reference image to: " 254 LOG(INFO) << "Saved reference image to: "
255 << img_path.value(); 255 << img_path.value();
256 } 256 }
257 if (rt) { 257 if (rt) {
258 if (!WriteREVFile(rev_path)) { 258 if (!WriteREVFile(rev_path)) {
259 LOG(ERROR) << "Can't save revision file to: " 259 LOG(ERROR) << "Can't save revision file to: "
260 << rev_path.value(); 260 << rev_path.value();
261 rt = false; 261 rt = false;
262 file_util::Delete(img_path, false); 262 base::Delete(img_path, false);
263 } else { 263 } else {
264 LOG(INFO) << "Saved revision file to: " 264 LOG(INFO) << "Saved revision file to: "
265 << rev_path.value(); 265 << rev_path.value();
266 } 266 }
267 } 267 }
268 if (ref_img_revision_ > 0) { 268 if (ref_img_revision_ > 0) {
269 LOG(ERROR) << "Can't read the local ref image: " 269 LOG(ERROR) << "Can't read the local ref image: "
270 << img_path.value() 270 << img_path.value()
271 << ", reset it."; 271 << ", reset it.";
272 rt = false; 272 rt = false;
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
422 continue; 422 continue;
423 if (revision < ref_img_revision_no_older_than_ || 423 if (revision < ref_img_revision_no_older_than_ ||
424 revision < max_revision) { 424 revision < max_revision) {
425 outdated_revs.push_back(full_path); 425 outdated_revs.push_back(full_path);
426 continue; 426 continue;
427 } 427 }
428 max_revision = revision; 428 max_revision = revision;
429 } 429 }
430 ref_img_revision_ = max_revision; 430 ref_img_revision_ = max_revision;
431 for (size_t i = 0; i < outdated_revs.size(); ++i) 431 for (size_t i = 0; i < outdated_revs.size(); ++i)
432 file_util::Delete(outdated_revs[i], false); 432 base::Delete(outdated_revs[i], false);
433 } 433 }
434 434
435 DISALLOW_COPY_AND_ASSIGN(GpuPixelBrowserTest); 435 DISALLOW_COPY_AND_ASSIGN(GpuPixelBrowserTest);
436 }; 436 };
437 437
438 IN_PROC_BROWSER_TEST_F(GpuPixelBrowserTest, MANUAL_WebGLGreenTriangle) { 438 IN_PROC_BROWSER_TEST_F(GpuPixelBrowserTest, MANUAL_WebGLGreenTriangle) {
439 // If test baseline needs to be updated after a given revision, update the 439 // If test baseline needs to be updated after a given revision, update the
440 // following number. If no revision requirement, then 0. 440 // following number. If no revision requirement, then 0.
441 const int64 ref_img_revision_update = 123489; 441 const int64 ref_img_revision_update = 123489;
442 442
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
557 557
558 gfx::Size container_size(400, 300); 558 gfx::Size container_size(400, 300);
559 base::FilePath url = 559 base::FilePath url =
560 test_data_dir().AppendASCII("pixel_browser_plugin.html"); 560 test_data_dir().AppendASCII("pixel_browser_plugin.html");
561 RunPixelTest(container_size, url, ref_img_revision_update, 561 RunPixelTest(container_size, url, ref_img_revision_update,
562 ref_pixels, ref_pixel_count); 562 ref_pixels, ref_pixel_count);
563 } 563 }
564 564
565 } // namespace content 565 } // namespace content
566 566
OLDNEW
« no previous file with comments | « content/browser/download/save_file_manager.cc ('k') | content/browser/in_process_webkit/browser_webkitplatformsupport_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698