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

Side by Side Diff: chrome/test/chromedriver/devtools_client.h

Issue 12321057: [chromedriver] Implement reconnection to DevTools. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix nits. Created 7 years, 9 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #ifndef CHROME_TEST_CHROMEDRIVER_DEVTOOLS_CLIENT_H_ 5 #ifndef CHROME_TEST_CHROMEDRIVER_DEVTOOLS_CLIENT_H_
6 #define CHROME_TEST_CHROMEDRIVER_DEVTOOLS_CLIENT_H_ 6 #define CHROME_TEST_CHROMEDRIVER_DEVTOOLS_CLIENT_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/callback_forward.h" 10 #include "base/callback_forward.h"
11 #include "base/memory/scoped_ptr.h" 11 #include "base/memory/scoped_ptr.h"
12 12
13 namespace base { 13 namespace base {
14 class DictionaryValue; 14 class DictionaryValue;
15 } 15 }
16 16
17 class DevToolsEventListener; 17 class DevToolsEventListener;
18 class Status; 18 class Status;
19 19
20 // A DevTools client of a single DevTools debugger. 20 // A DevTools client of a single DevTools debugger.
21 class DevToolsClient { 21 class DevToolsClient {
22 public: 22 public:
23 typedef base::Callback<bool()> ConditionalFunc; 23 typedef base::Callback<bool()> ConditionalFunc;
24 24
25 virtual ~DevToolsClient() {} 25 virtual ~DevToolsClient() {}
26 26
27 // Connect to DevTools if the DevToolsClient is disconnected.
28 virtual Status ConnectIfNecessary() = 0;
29
27 virtual Status SendCommand(const std::string& method, 30 virtual Status SendCommand(const std::string& method,
28 const base::DictionaryValue& params) = 0; 31 const base::DictionaryValue& params) = 0;
29 virtual Status SendCommandAndGetResult( 32 virtual Status SendCommandAndGetResult(
30 const std::string& method, 33 const std::string& method,
31 const base::DictionaryValue& params, 34 const base::DictionaryValue& params,
32 scoped_ptr<base::DictionaryValue>* result) = 0; 35 scoped_ptr<base::DictionaryValue>* result) = 0;
33 36
34 virtual void AddListener(DevToolsEventListener* listener) = 0; 37 virtual void AddListener(DevToolsEventListener* listener) = 0;
35 38
36 // Handles events until the given function returns true and there are no 39 // Handles events until the given function returns true and there are no
37 // more received events to handle. 40 // more received events to handle.
38 virtual Status HandleEventsUntil(const ConditionalFunc& conditional_func) = 0; 41 virtual Status HandleEventsUntil(const ConditionalFunc& conditional_func) = 0;
39 42
40 // Handles events that have been received but not yet handled. 43 // Handles events that have been received but not yet handled.
41 virtual Status HandleReceivedEvents(); 44 virtual Status HandleReceivedEvents();
42 }; 45 };
43 46
44 #endif // CHROME_TEST_CHROMEDRIVER_DEVTOOLS_CLIENT_H_ 47 #endif // CHROME_TEST_CHROMEDRIVER_DEVTOOLS_CLIENT_H_
OLDNEW
« no previous file with comments | « chrome/test/chromedriver/chrome_impl_unittest.cc ('k') | chrome/test/chromedriver/devtools_client_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698