-
Notifications
You must be signed in to change notification settings - Fork 68
/
commands.h
78 lines (64 loc) · 3.1 KB
/
commands.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
// Copyright 2012 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_TEST_CHROMEDRIVER_COMMANDS_H_
#define CHROME_TEST_CHROMEDRIVER_COMMANDS_H_
#include <memory>
#include <string>
#include "base/functional/callback_forward.h"
#include "base/values.h"
#include "chrome/test/chromedriver/command.h"
#include "chrome/test/chromedriver/session_connection_map.h"
#include "chrome/test/chromedriver/session_thread_map.h"
struct Session;
class Status;
// Gets status/info about ChromeDriver.
void ExecuteGetStatus(const base::Value::Dict& params,
const std::string& session_id,
const CommandCallback& callback);
// Gets session.status about ChromeDriver.
void ExecuteBidiSessionStatus(const base::Value::Dict& params,
const std::string& session_id,
const CommandCallback& callback);
// Creates a new session.
void ExecuteCreateSession(SessionThreadMap* session_thread_map,
const Command& init_session_cmd,
const base::Value::Dict& params,
const std::string& host,
const CommandCallback& callback);
// Creates a new BiDi session.
void ExecuteBidiSessionNew(SessionThreadMap* session_thread_map,
const Command& init_session_cmd,
const base::Value::Dict& params,
const std::string& resource,
const CommandCallback& callback);
// Gets all sessions
void ExecuteGetSessions(const Command& session_capabilities_command,
SessionThreadMap* session_thread_map,
const base::Value::Dict& params,
const std::string& session_id,
const CommandCallback& callback);
// Quits all sessions.
void ExecuteQuitAll(const Command& quit_command,
SessionThreadMap* session_thread_map,
const base::Value::Dict& params,
const std::string& session_id,
const CommandCallback& callback);
typedef base::RepeatingCallback<Status(Session* session,
const base::Value::Dict&,
std::unique_ptr<base::Value>*)>
SessionCommand;
// Executes a given session command, after acquiring access to the appropriate
// session.
void ExecuteSessionCommand(SessionThreadMap* session_thread_map,
const char* command_name,
const SessionCommand& command,
bool w3c_standard_command,
bool return_ok_without_session,
const base::Value::Dict& params,
const std::string& session_id,
const CommandCallback& callback);
namespace internal {
void CreateSessionOnSessionThreadForTesting(const std::string& id);
} // namespace internal
#endif // CHROME_TEST_CHROMEDRIVER_COMMANDS_H_