| 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 1538 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1549 scoped_refptr<TabProxy> tab(window->GetTab(0)); | 1549 scoped_refptr<TabProxy> tab(window->GetTab(0)); |
| 1550 ASSERT_TRUE(tab.get()); | 1550 ASSERT_TRUE(tab.get()); |
| 1551 | 1551 |
| 1552 FilePath filename(test_data_directory_); | 1552 FilePath filename(test_data_directory_); |
| 1553 filename = filename.AppendASCII("dom_automation_test_with_popup.html"); | 1553 filename = filename.AppendASCII("dom_automation_test_with_popup.html"); |
| 1554 | 1554 |
| 1555 ASSERT_EQ(AUTOMATION_MSG_NAVIGATION_SUCCESS, | 1555 ASSERT_EQ(AUTOMATION_MSG_NAVIGATION_SUCCESS, |
| 1556 tab->NavigateToURL(net::FilePathToFileURL(filename))); | 1556 tab->NavigateToURL(net::FilePathToFileURL(filename))); |
| 1557 | 1557 |
| 1558 // Allow some time for the popup to show up and close. | 1558 // Allow some time for the popup to show up and close. |
| 1559 PlatformThread::Sleep(sleep_timeout_ms()); | 1559 base::PlatformThread::Sleep(sleep_timeout_ms()); |
| 1560 | 1560 |
| 1561 std::wstring expected(L"string"); | 1561 std::wstring expected(L"string"); |
| 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: |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1741 int diff_pixels_count = 0; | 1741 int diff_pixels_count = 0; |
| 1742 for (int x = 0; x < img_size.width(); ++x) { | 1742 for (int x = 0; x < img_size.width(); ++x) { |
| 1743 for (int y = 0; y < img_size.height(); ++y) { | 1743 for (int y = 0; y < img_size.height(); ++y) { |
| 1744 if (*snapshot_bmp.getAddr32(x, y) != *reference_bmp.getAddr32(x, y)) { | 1744 if (*snapshot_bmp.getAddr32(x, y) != *reference_bmp.getAddr32(x, y)) { |
| 1745 ++diff_pixels_count; | 1745 ++diff_pixels_count; |
| 1746 } | 1746 } |
| 1747 } | 1747 } |
| 1748 } | 1748 } |
| 1749 ASSERT_EQ(diff_pixels_count, 0); | 1749 ASSERT_EQ(diff_pixels_count, 0); |
| 1750 } | 1750 } |
| OLD | NEW |