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

Side by Side Diff: chrome/test/automation/proxy_launcher.h

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 unified diff | Download patch | Annotate | Revision Log
Property Changes:
Added: svn:eol-style
+ LF
OLDNEW
(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 #ifndef CHROME_TEST_AUTOMATION_PROXY_LAUNCHER_H_
6 #define CHROME_TEST_AUTOMATION_PROXY_LAUNCHER_H_
7
8 #include <string>
9
10 class AutomationProxy;
11 class UITestBase;
12
13 // Subclass from this class to use a different implementation of AutomationProxy
John Grabowski 2010/11/12 23:32:53 DISALLOW_COPY_AND_ASSIGN(classname) inside a priva
dtu 2010/11/16 01:30:40 Done.
14 // or to use different channel IDs inside a class that derives from UITest.
15 class ProxyLauncher {
16 public:
17 virtual ~ProxyLauncher() {}
18
19 // Creates an automation proxy.
20 virtual AutomationProxy* CreateAutomationProxy(
21 int execution_timeout) const = 0;
22
23 // Launches the browser if needed and establishes a connection
24 // connection with it using the specified UITestBase.
25 virtual void InitializeConnection(UITestBase* ui_test_base) const = 0;
26
27 // Returns the automation proxy's channel with any prefixes prepended,
28 // for passing as a command line parameter over to the browser.
29 virtual std::string PrefixedChannelID() const = 0;
30 };
31
32 // Uses an automation proxy that communicates over a named socket.
33 // The channel id is a constant specified by kInterfacePath.
34 class NamedProxyLauncher : public ProxyLauncher {
35 public:
36 // If launch_browser is true, launches Chrome with named interface enabled.
37 // Otherwise, there should be an existing instance the proxy can connect to.
38 NamedProxyLauncher(bool launch_browser, bool disconnect_on_failure);
39
40 virtual AutomationProxy* CreateAutomationProxy(int execution_timeout) const;
41 virtual void InitializeConnection(UITestBase* ui_test_base) const;
42 virtual std::string PrefixedChannelID() const;
43
44 protected:
45 std::string channel_id_; // Channel id of automation proxy.
46 bool launch_browser_; // True if we should launch the browser too.
47 bool disconnect_on_failure_; // True if we disconnect on IPC channel failure.
48 };
49
50 // Uses an automation proxy that communicates over an anonymous socket.
51 class AnonymousProxyLauncher : public ProxyLauncher {
52 public:
53 explicit AnonymousProxyLauncher(bool disconnect_on_failure);
54 virtual AutomationProxy* CreateAutomationProxy(int execution_timeout) const;
55 virtual void InitializeConnection(UITestBase* ui_test_base) const;
56 virtual std::string PrefixedChannelID() const;
57
58 protected:
59 std::string channel_id_; // Channel id of automation proxy.
60 bool disconnect_on_failure_; // True if we disconnect on IPC channel failure.
61 };
62
63 #endif // CHROME_TEST_AUTOMATION_PROXY_LAUNCHER_H_
64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698