summaryrefslogtreecommitdiffstats
path: root/chrome/browser/automation/automation_provider.h
diff options
context:
space:
mode:
authorkkania@chromium.org <kkania@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-20 00:59:38 +0000
committerkkania@chromium.org <kkania@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-20 00:59:38 +0000
commit060e9ddba52b3ac3704bbdcfc1c755e53b695e1b (patch)
tree24e5c75523302405922d7c7a99652c713fbc55c7 /chrome/browser/automation/automation_provider.h
parent09a9da72051e7543bd800167c88e5d56c523b5fe (diff)
downloadchromium_src-060e9ddba52b3ac3704bbdcfc1c755e53b695e1b.zip
chromium_src-060e9ddba52b3ac3704bbdcfc1c755e53b695e1b.tar.gz
chromium_src-060e9ddba52b3ac3704bbdcfc1c755e53b695e1b.tar.bz2
Revert 66840 - Add named testing interface. This allows you to connect to a pre-existing Chrome process and run tests on it. This is an addition to the low level interface underlying testing frameworks like PyAuto and WebDriver.
Normally, test frameworks communicate with Chrome over an unnamed socket pair on POSIX. The test creates the socket pair and then launches the browser as a child process, passing an open file descriptor for one end of the socket to the browser. This change adds a command line switch that, when passed to the browser, causes it to listen on a named socket instead, eliminating this parent/child process requirement. Therefore, you can potentially connect any number of tests to a preexisting browser process. For ChromeOS, this allows you to run tests on the instance of Chrome that is launched on startup, which controls things like the login and lock screens, the battery meter, the wireless UI, etc. Currently there is no way to run tests on a pre-existing Chrome instance. Eventually this will also allow you to connect both PyAuto and WebDriver to the same Chrome instance and run both in the same test. If you pass the browser the following command line switch: ./chrome --testing-channel=NamedTestingInterface:/path/to/file This causes the browser to listen for incoming connections. An AutomationProxy can connect to the browser by connecting a Unix domain socket to the specified path and control the browser over the socket. This is currently only for POSIX. Windows support will come in a future change. Also, this initial change only allows one connection; multiple connection support will come in a future change. BUG=chromium-os:8512 TEST=Run Chrome with --testing-interface=/var/tmp/NamedTestingInterface, then run NamedInterfaceTest.BasicNamedInterface under ui_tests. Review URL: http://codereview.chromium.org/4202004 TBR=nirnimesh@chromium.org Review URL: http://codereview.chromium.org/5177007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@66856 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/automation/automation_provider.h')
-rw-r--r--chrome/browser/automation/automation_provider.h24
1 files changed, 4 insertions, 20 deletions
diff --git a/chrome/browser/automation/automation_provider.h b/chrome/browser/automation/automation_provider.h
index c30fb97..0da77a1 100644
--- a/chrome/browser/automation/automation_provider.h
+++ b/chrome/browser/automation/automation_provider.h
@@ -17,7 +17,6 @@
#include <vector>
#include "base/basictypes.h"
-#include "base/compiler_specific.h"
#include "base/observer_list.h"
#include "base/scoped_ptr.h"
#include "base/string16.h"
@@ -83,23 +82,15 @@ class AutomationProvider : public base::RefCounted<AutomationProvider>,
Profile* profile() const { return profile_; }
- // Initializes a channel for a connection to an AutomationProxy.
- // If channel_id starts with kNamedInterfacePrefix, it will act
- // as a server, create a named IPC socket with channel_id as its
- // path, and will listen on the socket for incoming connections.
- // If channel_id does not, it will act as a client and establish
- // a connection on its primary IPC channel. See ipc/ipc_channel_posix.cc
- // for more information about kPrimaryIPCChannel.
- bool InitializeChannel(const std::string& channel_id) WARN_UNUSED_RESULT;
+ // Establishes a connection to an automation client, if present.
+ // An AutomationProxy should be established (probably in a different process)
+ // before calling this.
+ void ConnectToChannel(const std::string& channel_id);
// Sets the number of tabs that we expect; when this number of tabs has
// loaded, an AutomationMsg_InitialLoadsComplete message is sent.
void SetExpectedTabCount(size_t expected_tabs);
- // Called when the inital set of tabs has finished loading.
- // Call SetExpectedTabCount(0) to set this to true immediately.
- void OnInitialLoadsComplete();
-
// Add a listener for navigation status notification. Currently only
// navigation completion is observed; when the |number_of_navigations|
// complete, the completed_response object is sent; if the server requires
@@ -147,7 +138,6 @@ class AutomationProvider : public base::RefCounted<AutomationProvider>,
// IPC implementations
virtual bool Send(IPC::Message* msg);
- virtual void OnChannelConnected(int pid);
virtual void OnMessageReceived(const IPC::Message& msg);
virtual void OnChannelError();
@@ -416,12 +406,6 @@ class AutomationProvider : public base::RefCounted<AutomationProvider>,
scoped_ptr<AutomationExtensionTracker> extension_tracker_;
PortContainerMap port_containers_;
- // True iff connected to an AutomationProxy.
- bool is_connected_;
-
- // True iff browser finished loading initial set of tabs.
- bool initial_loads_complete_;
-
DISALLOW_COPY_AND_ASSIGN(AutomationProvider);
};