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 #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 1557 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1568 std::wstring jscript = CreateJSString(L"\"" + expected + L"\""); | 1568 std::wstring jscript = CreateJSString(L"\"" + expected + L"\""); |
1569 std::wstring actual; | 1569 std::wstring actual; |
1570 ASSERT_TRUE(tab->ExecuteAndExtractString(L"", jscript, &actual)); | 1570 ASSERT_TRUE(tab->ExecuteAndExtractString(L"", jscript, &actual)); |
1571 ASSERT_EQ(expected, actual); | 1571 ASSERT_EQ(expected, actual); |
1572 } | 1572 } |
1573 | 1573 |
1574 class AutomationProxySnapshotTest : public UITest { | 1574 class AutomationProxySnapshotTest : public UITest { |
1575 protected: | 1575 protected: |
1576 AutomationProxySnapshotTest() { | 1576 AutomationProxySnapshotTest() { |
1577 dom_automation_enabled_ = true; | 1577 dom_automation_enabled_ = true; |
1578 snapshot_dir_.CreateUniqueTempDir(); | 1578 if (!snapshot_dir_.CreateUniqueTempDir()) |
1579 snapshot_path_ = snapshot_dir_.path().AppendASCII("snapshot.png"); | 1579 ADD_FAILURE() << "Unable to create temporary directory"; |
| 1580 else |
| 1581 snapshot_path_ = snapshot_dir_.path().AppendASCII("snapshot.png"); |
1580 } | 1582 } |
1581 | 1583 |
1582 // Asserts that the given png file can be read and decoded into the given | 1584 // Asserts that the given png file can be read and decoded into the given |
1583 // bitmap. | 1585 // bitmap. |
1584 void AssertReadPNG(const FilePath& filename, SkBitmap* bitmap) { | 1586 void AssertReadPNG(const FilePath& filename, SkBitmap* bitmap) { |
1585 DCHECK(bitmap); | 1587 DCHECK(bitmap); |
1586 ASSERT_TRUE(file_util::PathExists(filename)); | 1588 ASSERT_TRUE(file_util::PathExists(filename)); |
1587 | 1589 |
1588 int64 size64; | 1590 int64 size64; |
1589 ASSERT_TRUE(file_util::GetFileSize(filename, &size64)); | 1591 ASSERT_TRUE(file_util::GetFileSize(filename, &size64)); |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1747 int diff_pixels_count = 0; | 1749 int diff_pixels_count = 0; |
1748 for (int x = 0; x < img_size.width(); ++x) { | 1750 for (int x = 0; x < img_size.width(); ++x) { |
1749 for (int y = 0; y < img_size.height(); ++y) { | 1751 for (int y = 0; y < img_size.height(); ++y) { |
1750 if (*snapshot_bmp.getAddr32(x, y) != *reference_bmp.getAddr32(x, y)) { | 1752 if (*snapshot_bmp.getAddr32(x, y) != *reference_bmp.getAddr32(x, y)) { |
1751 ++diff_pixels_count; | 1753 ++diff_pixels_count; |
1752 } | 1754 } |
1753 } | 1755 } |
1754 } | 1756 } |
1755 ASSERT_EQ(diff_pixels_count, 0); | 1757 ASSERT_EQ(diff_pixels_count, 0); |
1756 } | 1758 } |
OLD | NEW |