OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 <string> | 5 #include <string> |
6 | 6 |
7 #include "app/app_switches.h" | 7 #include "app/app_switches.h" |
8 #include "app/message_box_flags.h" | 8 #include "app/message_box_flags.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 1551 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1562 std::wstring jscript = CreateJSString(L"\"" + expected + L"\""); | 1562 std::wstring jscript = CreateJSString(L"\"" + expected + L"\""); |
1563 std::wstring actual; | 1563 std::wstring actual; |
1564 ASSERT_TRUE(tab->ExecuteAndExtractString(L"", jscript, &actual)); | 1564 ASSERT_TRUE(tab->ExecuteAndExtractString(L"", jscript, &actual)); |
1565 ASSERT_EQ(expected, actual); | 1565 ASSERT_EQ(expected, actual); |
1566 } | 1566 } |
1567 | 1567 |
1568 class AutomationProxySnapshotTest : public UITest { | 1568 class AutomationProxySnapshotTest : public UITest { |
1569 protected: | 1569 protected: |
1570 AutomationProxySnapshotTest() { | 1570 AutomationProxySnapshotTest() { |
1571 dom_automation_enabled_ = true; | 1571 dom_automation_enabled_ = true; |
1572 snapshot_dir_.CreateUniqueTempDir(); | 1572 if (!snapshot_dir_.CreateUniqueTempDir()) |
1573 snapshot_path_ = snapshot_dir_.path().AppendASCII("snapshot.png"); | 1573 ADD_FAILURE() << "Unable to create temporary directory"; |
| 1574 else |
| 1575 snapshot_path_ = snapshot_dir_.path().AppendASCII("snapshot.png"); |
1574 } | 1576 } |
1575 | 1577 |
1576 // Asserts that the given png file can be read and decoded into the given | 1578 // Asserts that the given png file can be read and decoded into the given |
1577 // bitmap. | 1579 // bitmap. |
1578 void AssertReadPNG(const FilePath& filename, SkBitmap* bitmap) { | 1580 void AssertReadPNG(const FilePath& filename, SkBitmap* bitmap) { |
1579 DCHECK(bitmap); | 1581 DCHECK(bitmap); |
1580 ASSERT_TRUE(file_util::PathExists(filename)); | 1582 ASSERT_TRUE(file_util::PathExists(filename)); |
1581 | 1583 |
1582 int64 size64; | 1584 int64 size64; |
1583 ASSERT_TRUE(file_util::GetFileSize(filename, &size64)); | 1585 ASSERT_TRUE(file_util::GetFileSize(filename, &size64)); |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1741 int diff_pixels_count = 0; | 1743 int diff_pixels_count = 0; |
1742 for (int x = 0; x < img_size.width(); ++x) { | 1744 for (int x = 0; x < img_size.width(); ++x) { |
1743 for (int y = 0; y < img_size.height(); ++y) { | 1745 for (int y = 0; y < img_size.height(); ++y) { |
1744 if (*snapshot_bmp.getAddr32(x, y) != *reference_bmp.getAddr32(x, y)) { | 1746 if (*snapshot_bmp.getAddr32(x, y) != *reference_bmp.getAddr32(x, y)) { |
1745 ++diff_pixels_count; | 1747 ++diff_pixels_count; |
1746 } | 1748 } |
1747 } | 1749 } |
1748 } | 1750 } |
1749 ASSERT_EQ(diff_pixels_count, 0); | 1751 ASSERT_EQ(diff_pixels_count, 0); |
1750 } | 1752 } |
OLD | NEW |