|
OLD | NEW |
---|---|
(Empty) | |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #include "chrome/test/automation/proxy_launcher.h" | |
6 | |
7 #include "chrome/common/automation_constants.h" | |
8 #include "chrome/common/logging_chrome.h" | |
9 #include "chrome/test/automation/automation_proxy.h" | |
10 #include "chrome/test/ui/ui_test.h" | |
11 | |
12 // Default path of named testing interface. | |
13 static const char kInterfacePath[] = "/var/tmp/ChromeTestingInterface"; | |
14 | |
15 // NamedProxyLauncher functions | |
16 | |
17 NamedProxyLauncher::NamedProxyLauncher(bool disconnect_on_failure) | |
18 : disconnect_on_failure_(disconnect_on_failure) { | |
19 channel_id_ = kInterfacePath; | |
20 } | |
21 | |
22 AutomationProxy* NamedProxyLauncher::CreateAutomationProxy( | |
23 int execution_timeout) const { | |
24 AutomationProxy* proxy = new AutomationProxy(execution_timeout, | |
25 disconnect_on_failure_); | |
26 proxy->InitializeChannel(channel_id_, false); | |
27 return proxy; | |
28 } | |
29 | |
30 void NamedProxyLauncher::InitializeConnection(UITestBase* ui_test_base) const { | |
31 ui_test_base->ConnectToRunningBrowser(); | |
Paweł Hajdan Jr.
2010/11/10 11:15:44
We need to go further. Now it adds another level o
dtu
2010/11/11 00:10:54
Those functions (and their helper functions Launch
Nirnimesh
2010/11/11 11:20:46
No, I disagree. We do NOT want this class to start
| |
32 } | |
33 | |
34 std::string NamedProxyLauncher::PrefixedChannelID() const { | |
35 std::string channel_id; | |
36 channel_id.append(automation::kNamedInterfacePrefix).append(channel_id_); | |
37 return channel_id; | |
38 } | |
39 | |
40 // AnonymousProxyLauncher functions | |
41 | |
42 AnonymousProxyLauncher::AnonymousProxyLauncher(bool disconnect_on_failure) | |
43 : disconnect_on_failure_(disconnect_on_failure) { | |
44 channel_id_ = AutomationProxy::GenerateChannelID(); | |
45 } | |
46 | |
47 AutomationProxy* AnonymousProxyLauncher::CreateAutomationProxy( | |
48 int execution_timeout) const { | |
49 AutomationProxy* proxy = new AutomationProxy(execution_timeout, | |
50 disconnect_on_failure_); | |
51 proxy->InitializeChannel(channel_id_, true); | |
52 return proxy; | |
53 } | |
54 | |
55 void AnonymousProxyLauncher::InitializeConnection( | |
56 UITestBase* ui_test_base) const { | |
57 ui_test_base->LaunchBrowserAndServer(); | |
58 } | |
59 | |
60 std::string AnonymousProxyLauncher::PrefixedChannelID() const { | |
61 return channel_id_; | |
62 } | |
63 | |
OLD | NEW |