Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1887)

Side by Side Diff: chrome/test/automation/automation_proxy_uitest.cc

Issue 5967003: Refactor UITestBase/ProxyLauncher. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Fix issues and clean up. Created 9 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 void InitializeConnection(UITestBase* ui_test_base) const { 66 void InitializeConnection(const CommandLine& arguments,
67 ui_test_base->LaunchBrowserAndServer(); 67 bool include_testing_id,
68 bool clear_profile,
69 FilePath& template_user_data,
70 ProfileType profile_type,
71 FilePath browser_directory,
72 bool show_window,
73 bool wait_for_initial_loads,
74 base::TimeTicks* browser_launch_time,
75 base::ProcessHandle* process,
76 base::ProcessId* process_id) {
77 LaunchBrowserAndServer(arguments, include_testing_id, clear_profile,
78 template_user_data, profile_type, browser_directory,
79 show_window, wait_for_initial_loads,
80 browser_launch_time, process, process_id);
68 } 81 }
69 82
70 std::string PrefixedChannelID() const { 83 std::string PrefixedChannelID() const {
71 return channel_id_; 84 return channel_id_;
72 } 85 }
73 86
74 private: 87 private:
75 ExternalTabUITestMockClient **mock_; 88 ExternalTabUITestMockClient **mock_;
76 std::string channel_id_; // Channel id of automation proxy. 89 std::string channel_id_; // Channel id of automation proxy.
77 }; 90 };
(...skipping 1663 matching lines...) Expand 10 before | Expand all | Expand 10 after
1741 int diff_pixels_count = 0; 1754 int diff_pixels_count = 0;
1742 for (int x = 0; x < img_size.width(); ++x) { 1755 for (int x = 0; x < img_size.width(); ++x) {
1743 for (int y = 0; y < img_size.height(); ++y) { 1756 for (int y = 0; y < img_size.height(); ++y) {
1744 if (*snapshot_bmp.getAddr32(x, y) != *reference_bmp.getAddr32(x, y)) { 1757 if (*snapshot_bmp.getAddr32(x, y) != *reference_bmp.getAddr32(x, y)) {
1745 ++diff_pixels_count; 1758 ++diff_pixels_count;
1746 } 1759 }
1747 } 1760 }
1748 } 1761 }
1749 ASSERT_EQ(diff_pixels_count, 0); 1762 ASSERT_EQ(diff_pixels_count, 0);
1750 } 1763 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698