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

Unified Diff: chrome/test/automation/proxy_launcher.cc

Issue 4202004: Add named testing interface (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 10 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: chrome/test/automation/proxy_launcher.cc
===================================================================
--- chrome/test/automation/proxy_launcher.cc (revision 0)
+++ chrome/test/automation/proxy_launcher.cc (revision 0)
@@ -0,0 +1,63 @@
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/test/automation/proxy_launcher.h"
+
+#include "chrome/common/automation_constants.h"
+#include "chrome/common/logging_chrome.h"
+#include "chrome/test/automation/automation_proxy.h"
+#include "chrome/test/ui/ui_test.h"
+
+// Default path of named testing interface.
+static const char kInterfacePath[] = "/var/tmp/ChromeTestingInterface";
+
+// NamedProxyLauncher functions
+
+NamedProxyLauncher::NamedProxyLauncher(bool disconnect_on_failure)
+ : disconnect_on_failure_(disconnect_on_failure) {
+ channel_id_ = kInterfacePath;
+}
+
+AutomationProxy* NamedProxyLauncher::CreateAutomationProxy(
+ int execution_timeout) const {
+ AutomationProxy* proxy = new AutomationProxy(execution_timeout,
+ disconnect_on_failure_);
+ proxy->InitializeChannel(channel_id_, false);
+ return proxy;
+}
+
+void NamedProxyLauncher::InitializeConnection(UITestBase* ui_test_base) const {
+ 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
+}
+
+std::string NamedProxyLauncher::PrefixedChannelID() const {
+ std::string channel_id;
+ channel_id.append(automation::kNamedInterfacePrefix).append(channel_id_);
+ return channel_id;
+}
+
+// AnonymousProxyLauncher functions
+
+AnonymousProxyLauncher::AnonymousProxyLauncher(bool disconnect_on_failure)
+ : disconnect_on_failure_(disconnect_on_failure) {
+ channel_id_ = AutomationProxy::GenerateChannelID();
+}
+
+AutomationProxy* AnonymousProxyLauncher::CreateAutomationProxy(
+ int execution_timeout) const {
+ AutomationProxy* proxy = new AutomationProxy(execution_timeout,
+ disconnect_on_failure_);
+ proxy->InitializeChannel(channel_id_, true);
+ return proxy;
+}
+
+void AnonymousProxyLauncher::InitializeConnection(
+ UITestBase* ui_test_base) const {
+ ui_test_base->LaunchBrowserAndServer();
+}
+
+std::string AnonymousProxyLauncher::PrefixedChannelID() const {
+ return channel_id_;
+}
+
Property changes on: chrome/test/automation/proxy_launcher.cc
___________________________________________________________________
Added: svn:eol-style
+ LF

Powered by Google App Engine
This is Rietveld 408576698