| 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 558 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 569 dom_automation_enabled_ = true; | 569 dom_automation_enabled_ = true; |
| 570 launch_arguments_ = CommandLine(CommandLine::NO_PROGRAM); | 570 launch_arguments_ = CommandLine(CommandLine::NO_PROGRAM); |
| 571 launch_arguments_.AppendArgPath(document1_); | 571 launch_arguments_.AppendArgPath(document1_); |
| 572 } | 572 } |
| 573 | 573 |
| 574 FilePath document1_; | 574 FilePath document1_; |
| 575 }; | 575 }; |
| 576 | 576 |
| 577 std::wstring CreateJSStringForDOMQuery(const std::wstring& id) { | 577 std::wstring CreateJSStringForDOMQuery(const std::wstring& id) { |
| 578 std::wstring jscript(L"window.domAutomationController"); | 578 std::wstring jscript(L"window.domAutomationController"); |
| 579 StringAppendF(&jscript, L".send(document.getElementById('%ls').nodeName);", | 579 base::StringAppendF(&jscript, |
| 580 id.c_str()); | 580 L".send(document.getElementById('%ls').nodeName);", |
| 581 id.c_str()); |
| 581 return jscript; | 582 return jscript; |
| 582 } | 583 } |
| 583 | 584 |
| 584 TEST_F(AutomationProxyTest3, FrameDocumentCanBeAccessed) { | 585 TEST_F(AutomationProxyTest3, FrameDocumentCanBeAccessed) { |
| 585 scoped_refptr<BrowserProxy> window(automation()->GetBrowserWindow(0)); | 586 scoped_refptr<BrowserProxy> window(automation()->GetBrowserWindow(0)); |
| 586 ASSERT_TRUE(window.get()); | 587 ASSERT_TRUE(window.get()); |
| 587 | 588 |
| 588 scoped_refptr<TabProxy> tab(window->GetTab(0)); | 589 scoped_refptr<TabProxy> tab(window->GetTab(0)); |
| 589 ASSERT_TRUE(tab.get()); | 590 ASSERT_TRUE(tab.get()); |
| 590 | 591 |
| (...skipping 1104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1695 int diff_pixels_count = 0; | 1696 int diff_pixels_count = 0; |
| 1696 for (int x = 0; x < img_size.width(); ++x) { | 1697 for (int x = 0; x < img_size.width(); ++x) { |
| 1697 for (int y = 0; y < img_size.height(); ++y) { | 1698 for (int y = 0; y < img_size.height(); ++y) { |
| 1698 if (*snapshot_bmp.getAddr32(x, y) != *reference_bmp.getAddr32(x, y)) { | 1699 if (*snapshot_bmp.getAddr32(x, y) != *reference_bmp.getAddr32(x, y)) { |
| 1699 ++diff_pixels_count; | 1700 ++diff_pixels_count; |
| 1700 } | 1701 } |
| 1701 } | 1702 } |
| 1702 } | 1703 } |
| 1703 ASSERT_EQ(diff_pixels_count, 0); | 1704 ASSERT_EQ(diff_pixels_count, 0); |
| 1704 } | 1705 } |
| OLD | NEW |