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

Unified Diff: chrome/test/chromedriver/commands.h

Issue 19616008: [chromedriver] Allow commands to be async. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix Created 7 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/test/chromedriver/command.h ('k') | chrome/test/chromedriver/commands.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/chromedriver/commands.h
diff --git a/chrome/test/chromedriver/commands.h b/chrome/test/chromedriver/commands.h
index 2e624e425959b61da232eb840d5aa72264c339ea..e69764cfa0f8b3255f9b93a16f521ed3d50bcc26 100644
--- a/chrome/test/chromedriver/commands.h
+++ b/chrome/test/chromedriver/commands.h
@@ -12,7 +12,7 @@
#include "base/memory/scoped_ptr.h"
#include "chrome/test/chromedriver/command.h"
#include "chrome/test/chromedriver/net/sync_websocket_factory.h"
-#include "chrome/test/chromedriver/session_map.h"
+#include "chrome/test/chromedriver/session_thread_map.h"
namespace base {
class DictionaryValue;
@@ -21,55 +21,63 @@ class Value;
class DeviceManager;
class Log;
+struct Session;
class Status;
class URLRequestContextGetter;
// Gets status/info about ChromeDriver.
-Status ExecuteGetStatus(
+void ExecuteGetStatus(
const base::DictionaryValue& params,
const std::string& session_id,
- scoped_ptr<base::Value>* out_value,
- std::string* out_session_id);
+ const CommandCallback& callback);
struct NewSessionParams {
NewSessionParams(Log* log,
- SessionMap* session_map,
+ SessionThreadMap* session_thread_map,
scoped_refptr<URLRequestContextGetter> context_getter,
const SyncWebSocketFactory& socket_factory,
DeviceManager* device_manager);
~NewSessionParams();
Log* log;
- SessionMap* session_map;
+ SessionThreadMap* session_thread_map;
scoped_refptr<URLRequestContextGetter> context_getter;
SyncWebSocketFactory socket_factory;
DeviceManager* device_manager;
};
// Creates a new session.
-Status ExecuteNewSession(
+void ExecuteNewSession(
const NewSessionParams& bound_params,
const base::DictionaryValue& params,
const std::string& session_id,
- scoped_ptr<base::Value>* out_value,
- std::string* out_session_id);
+ const CommandCallback& callback);
-// Quits a particular session.
-Status ExecuteQuit(
- bool allow_detach,
- SessionMap* session_map,
+// Quits all sessions.
+void ExecuteQuitAll(
+ const Command& quit_command,
+ SessionThreadMap* session_thread_map,
const base::DictionaryValue& params,
const std::string& session_id,
- scoped_ptr<base::Value>* out_value,
- std::string* out_session_id);
+ const CommandCallback& callback);
-// Quits all sessions.
-Status ExecuteQuitAll(
- Command quit_command,
- SessionMap* session_map,
+typedef base::Callback<Status(
+ Session* session,
+ const base::DictionaryValue&,
+ scoped_ptr<base::Value>*)> SessionCommand;
+
+// Executes a given session command, after acquiring access to the appropriate
+// session.
+void ExecuteSessionCommand(
+ SessionThreadMap* session_thread_map,
+ const SessionCommand& command,
+ bool return_ok_without_session,
const base::DictionaryValue& params,
const std::string& session_id,
- scoped_ptr<base::Value>* out_value,
- std::string* out_session_id);
+ const CommandCallback& callback);
+
+namespace internal {
+void CreateSessionOnSessionThreadForTesting(const std::string& id);
+} // namespace internal
#endif // CHROME_TEST_CHROMEDRIVER_COMMANDS_H_
« no previous file with comments | « chrome/test/chromedriver/command.h ('k') | chrome/test/chromedriver/commands.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698