| 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 "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "base/file_path.h" | 9 #include "base/file_path.h" |
| 10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 : mock_(mock) { | 56 : mock_(mock) { |
| 57 channel_id_ = AutomationProxy::GenerateChannelID(); | 57 channel_id_ = AutomationProxy::GenerateChannelID(); |
| 58 } | 58 } |
| 59 | 59 |
| 60 AutomationProxy* CreateAutomationProxy(int execution_timeout) { | 60 AutomationProxy* CreateAutomationProxy(int execution_timeout) { |
| 61 *mock_ = new ExternalTabUITestMockClient(execution_timeout); | 61 *mock_ = new ExternalTabUITestMockClient(execution_timeout); |
| 62 (*mock_)->InitializeChannel(channel_id_, false); | 62 (*mock_)->InitializeChannel(channel_id_, false); |
| 63 return *mock_; | 63 return *mock_; |
| 64 } | 64 } |
| 65 | 65 |
| 66 bool InitializeConnection( | 66 void InitializeConnection(const LaunchState& state, |
| 67 const LaunchState& state, | 67 bool wait_for_initial_loads) { |
| 68 bool wait_for_initial_loads) OVERRIDE WARN_UNUSED_RESULT { | 68 ASSERT_TRUE(LaunchBrowserAndServer(state, wait_for_initial_loads)); |
| 69 bool launch_browser_and_server = | |
| 70 LaunchBrowserAndServer(state, wait_for_initial_loads); | |
| 71 EXPECT_TRUE(launch_browser_and_server); | |
| 72 return launch_browser_and_server; | |
| 73 } | 69 } |
| 74 | 70 |
| 75 void TerminateConnection() { | 71 void TerminateConnection() { |
| 76 CloseBrowserAndServer(); | 72 CloseBrowserAndServer(); |
| 77 } | 73 } |
| 78 | 74 |
| 79 std::string PrefixedChannelID() const { | 75 std::string PrefixedChannelID() const { |
| 80 return channel_id_; | 76 return channel_id_; |
| 81 } | 77 } |
| 82 | 78 |
| (...skipping 1577 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1660 int diff_pixels_count = 0; | 1656 int diff_pixels_count = 0; |
| 1661 for (int x = 0; x < img_size.width(); ++x) { | 1657 for (int x = 0; x < img_size.width(); ++x) { |
| 1662 for (int y = 0; y < img_size.height(); ++y) { | 1658 for (int y = 0; y < img_size.height(); ++y) { |
| 1663 if (*snapshot_bmp.getAddr32(x, y) != *reference_bmp.getAddr32(x, y)) { | 1659 if (*snapshot_bmp.getAddr32(x, y) != *reference_bmp.getAddr32(x, y)) { |
| 1664 ++diff_pixels_count; | 1660 ++diff_pixels_count; |
| 1665 } | 1661 } |
| 1666 } | 1662 } |
| 1667 } | 1663 } |
| 1668 ASSERT_EQ(diff_pixels_count, 0); | 1664 ASSERT_EQ(diff_pixels_count, 0); |
| 1669 } | 1665 } |
| OLD | NEW |