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
3 // found in the LICENSE file.
5 #ifndef CHROME_TEST_CHROMEDRIVER_COMMANDS_H_
6 #define CHROME_TEST_CHROMEDRIVER_COMMANDS_H_
10 #include "base/callback_forward.h"
11 #include "base/memory/ref_counted.h"
12 #include "base/memory/scoped_ptr.h"
13 #include "chrome/test/chromedriver/command.h"
14 #include "chrome/test/chromedriver/session_thread_map.h"
17 class DictionaryValue
;
24 // Gets status/info about ChromeDriver.
25 void ExecuteGetStatus(
26 const base::DictionaryValue
& params
,
27 const std::string
& session_id
,
28 const CommandCallback
& callback
);
30 // Creates a new session.
31 void ExecuteCreateSession(
32 SessionThreadMap
* session_thread_map
,
33 const Command
& init_session_cmd
,
34 const base::DictionaryValue
& params
,
35 const std::string
& session_id
,
36 const CommandCallback
& callback
);
39 void ExecuteGetSessions(
40 const Command
& session_capabilities_command
,
41 SessionThreadMap
* session_thread_map
,
42 const base::DictionaryValue
& params
,
43 const std::string
& session_id
,
44 const CommandCallback
& callback
);
46 // Quits all sessions.
48 const Command
& quit_command
,
49 SessionThreadMap
* session_thread_map
,
50 const base::DictionaryValue
& params
,
51 const std::string
& session_id
,
52 const CommandCallback
& callback
);
54 typedef base::Callback
<Status(
56 const base::DictionaryValue
&,
57 scoped_ptr
<base::Value
>*)> SessionCommand
;
59 // Executes a given session command, after acquiring access to the appropriate
61 void ExecuteSessionCommand(
62 SessionThreadMap
* session_thread_map
,
63 const char* command_name
,
64 const SessionCommand
& command
,
65 bool return_ok_without_session
,
66 const base::DictionaryValue
& params
,
67 const std::string
& session_id
,
68 const CommandCallback
& callback
);
71 void CreateSessionOnSessionThreadForTesting(const std::string
& id
);
72 } // namespace internal
74 #endif // CHROME_TEST_CHROMEDRIVER_COMMANDS_H_