| Index: content/browser/gpu/gpu_pixel_browsertest.cc
|
| diff --git a/content/browser/gpu/gpu_pixel_browsertest.cc b/content/browser/gpu/gpu_pixel_browsertest.cc
|
| index 9dd36d5f54e92d1b03a8b3b4b902a667d6362550..49aa9a8175a9f1577df8c36739cc490e15fdf225 100644
|
| --- a/content/browser/gpu/gpu_pixel_browsertest.cc
|
| +++ b/content/browser/gpu/gpu_pixel_browsertest.cc
|
| @@ -52,9 +52,9 @@ const char kBuildRevision[] = "build-revision";
|
|
|
| // Reads and decodes a PNG image to a bitmap. Returns true on success. The PNG
|
| // should have been encoded using |gfx::PNGCodec::Encode|.
|
| -bool ReadPNGFile(const FilePath& file_path, SkBitmap* bitmap) {
|
| +bool ReadPNGFile(const base::FilePath& file_path, SkBitmap* bitmap) {
|
| DCHECK(bitmap);
|
| - FilePath abs_path(file_path);
|
| + base::FilePath abs_path(file_path);
|
| if (!file_util::AbsolutePath(&abs_path))
|
| return false;
|
|
|
| @@ -67,7 +67,7 @@ bool ReadPNGFile(const FilePath& file_path, SkBitmap* bitmap) {
|
|
|
| // Encodes a bitmap into a PNG and write to disk. Returns true on success. The
|
| // parent directory does not have to exist.
|
| -bool WritePNGFile(const SkBitmap& bitmap, const FilePath& file_path) {
|
| +bool WritePNGFile(const SkBitmap& bitmap, const base::FilePath& file_path) {
|
| std::vector<unsigned char> png_data;
|
| if (gfx::PNGCodec::EncodeBGRASkBitmap(bitmap, true, &png_data) &&
|
| file_util::CreateDirectory(file_path.DirName())) {
|
| @@ -81,7 +81,7 @@ bool WritePNGFile(const SkBitmap& bitmap, const FilePath& file_path) {
|
|
|
| // Write an empty file, whose name indicates the chrome revision when the ref
|
| // image was generated.
|
| -bool WriteREVFile(const FilePath& file_path) {
|
| +bool WriteREVFile(const base::FilePath& file_path) {
|
| if (file_util::CreateDirectory(file_path.DirName())) {
|
| char one_byte = 0;
|
| int bytes_written = file_util::WriteFile(file_path, &one_byte, 1);
|
| @@ -156,7 +156,7 @@ class GpuPixelBrowserTest : public ContentBrowserTest {
|
| // If the existing ref image was saved from an revision older than the
|
| // ref_img_update_revision, refresh the ref image.
|
| void RunPixelTest(const gfx::Size& tab_container_size,
|
| - const FilePath& url,
|
| + const base::FilePath& url,
|
| int64 ref_img_update_revision,
|
| const ReferencePixel* ref_pixels,
|
| size_t ref_pixel_count) {
|
| @@ -183,14 +183,14 @@ class GpuPixelBrowserTest : public ContentBrowserTest {
|
| EXPECT_TRUE(same_pixels);
|
| }
|
|
|
| - const FilePath& test_data_dir() const {
|
| + const base::FilePath& test_data_dir() const {
|
| return test_data_dir_;
|
| }
|
|
|
| private:
|
| - FilePath test_data_dir_;
|
| - FilePath generated_img_dir_;
|
| - FilePath ref_img_dir_;
|
| + base::FilePath test_data_dir_;
|
| + base::FilePath generated_img_dir_;
|
| + base::FilePath ref_img_dir_;
|
| int64 ref_img_revision_;
|
| std::string build_revision_;
|
| // The name of the test, with any special prefixes dropped.
|
| @@ -221,7 +221,7 @@ class GpuPixelBrowserTest : public ContentBrowserTest {
|
| bool CompareImages(const SkBitmap& gen_bmp) {
|
| SkBitmap ref_bmp_on_disk;
|
|
|
| - FilePath img_path = ref_img_dir_.AppendASCII(test_name_ + ".png");
|
| + base::FilePath img_path = ref_img_dir_.AppendASCII(test_name_ + ".png");
|
| bool found_ref_img = ReadPNGFile(img_path, &ref_bmp_on_disk);
|
|
|
| if (!found_ref_img && ref_img_option_ == kReferenceImageCheckedIn) {
|
| @@ -238,7 +238,7 @@ class GpuPixelBrowserTest : public ContentBrowserTest {
|
|
|
| if ((ref_img_revision_ <= 0 && ref_img_option_ == kReferenceImageLocal) ||
|
| !found_ref_img) {
|
| - FilePath rev_path = ref_img_dir_.AppendASCII(
|
| + base::FilePath rev_path = ref_img_dir_.AppendASCII(
|
| test_name_ + "_" + build_revision_ + ".rev");
|
| if (!WritePNGFile(gen_bmp, img_path)) {
|
| LOG(ERROR) << "Can't save generated image to: "
|
| @@ -321,7 +321,7 @@ class GpuPixelBrowserTest : public ContentBrowserTest {
|
|
|
| std::string ref_img_filename = img_path.BaseName().MaybeAsASCII();
|
| if (save_gen) {
|
| - FilePath img_fail_path = generated_img_dir_.AppendASCII(
|
| + base::FilePath img_fail_path = generated_img_dir_.AppendASCII(
|
| "FAIL_" + ref_img_filename);
|
| if (!WritePNGFile(gen_bmp, img_fail_path)) {
|
| LOG(ERROR) << "Can't save generated image to: "
|
| @@ -332,7 +332,7 @@ class GpuPixelBrowserTest : public ContentBrowserTest {
|
| }
|
| }
|
| if (save_diff) {
|
| - FilePath img_diff_path = generated_img_dir_.AppendASCII(
|
| + base::FilePath img_diff_path = generated_img_dir_.AppendASCII(
|
| "DIFF_" + ref_img_filename);
|
| if (!WritePNGFile(diff_bmp, img_diff_path)) {
|
| LOG(ERROR) << "Can't save generated diff image to: "
|
| @@ -396,15 +396,15 @@ class GpuPixelBrowserTest : public ContentBrowserTest {
|
|
|
| // If no valid local revision file is located, the ref_img_revision_ is 0.
|
| void ObtainLocalRefImageRevision() {
|
| - FilePath filter;
|
| + base::FilePath filter;
|
| filter = filter.AppendASCII(test_name_ + "_*.rev");
|
| file_util::FileEnumerator locator(ref_img_dir_,
|
| false, // non recursive
|
| file_util::FileEnumerator::FILES,
|
| filter.value());
|
| int64 max_revision = 0;
|
| - std::vector<FilePath> outdated_revs;
|
| - for (FilePath full_path = locator.Next();
|
| + std::vector<base::FilePath> outdated_revs;
|
| + for (base::FilePath full_path = locator.Next();
|
| !full_path.empty();
|
| full_path = locator.Next()) {
|
| std::string filename =
|
| @@ -447,7 +447,7 @@ IN_PROC_BROWSER_TEST_F(GpuPixelBrowserTest, MANUAL_WebGLGreenTriangle) {
|
| const size_t ref_pixel_count = sizeof(ref_pixels) / sizeof(ReferencePixel);
|
|
|
| gfx::Size container_size(400, 300);
|
| - FilePath url =
|
| + base::FilePath url =
|
| test_data_dir().AppendASCII("pixel_webgl.html");
|
| RunPixelTest(container_size, url, ref_img_revision_update,
|
| ref_pixels, ref_pixel_count);
|
| @@ -470,7 +470,7 @@ IN_PROC_BROWSER_TEST_F(GpuPixelBrowserTest, MANUAL_CSS3DBlueBox) {
|
| const size_t ref_pixel_count = sizeof(ref_pixels) / sizeof(ReferencePixel);
|
|
|
| gfx::Size container_size(400, 300);
|
| - FilePath url =
|
| + base::FilePath url =
|
| test_data_dir().AppendASCII("pixel_css3d.html");
|
| RunPixelTest(container_size, url, ref_img_revision_update,
|
| ref_pixels, ref_pixel_count);
|
| @@ -491,7 +491,7 @@ IN_PROC_BROWSER_TEST_F(GpuPixelBrowserTest, MANUAL_Canvas2DRedBoxHD) {
|
| const size_t ref_pixel_count = sizeof(ref_pixels) / sizeof(ReferencePixel);
|
|
|
| gfx::Size container_size(400, 300);
|
| - FilePath url =
|
| + base::FilePath url =
|
| test_data_dir().AppendASCII("pixel_canvas2d.html");
|
| RunPixelTest(container_size, url, ref_img_revision_update,
|
| ref_pixels, ref_pixel_count);
|
| @@ -520,7 +520,7 @@ IN_PROC_BROWSER_TEST_F(GpuPixelTestCanvas2DSD, MANUAL_Canvas2DRedBoxSD) {
|
| const size_t ref_pixel_count = sizeof(ref_pixels) / sizeof(ReferencePixel);
|
|
|
| gfx::Size container_size(400, 300);
|
| - FilePath url =
|
| + base::FilePath url =
|
| test_data_dir().AppendASCII("pixel_canvas2d.html");
|
| RunPixelTest(container_size, url, ref_img_revision_update,
|
| ref_pixels, ref_pixel_count);
|
|
|