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
);
38 // Quits all sessions.
40 const Command
& quit_command
,
41 SessionThreadMap
* session_thread_map
,
42 const base::DictionaryValue
& params
,
43 const std::string
& session_id
,
44 const CommandCallback
& callback
);
46 typedef base::Callback
<Status(
48 const base::DictionaryValue
&,
49 scoped_ptr
<base::Value
>*)> SessionCommand
;
51 // Executes a given session command, after acquiring access to the appropriate
53 void ExecuteSessionCommand(
54 SessionThreadMap
* session_thread_map
,
55 const char* command_name
,
56 const SessionCommand
& command
,
57 bool return_ok_without_session
,
58 const base::DictionaryValue
& params
,
59 const std::string
& session_id
,
60 const CommandCallback
& callback
);
63 void CreateSessionOnSessionThreadForTesting(const std::string
& id
);
64 } // namespace internal
66 #endif // CHROME_TEST_CHROMEDRIVER_COMMANDS_H_