Upstream version 5.34.104.0
[platform/framework/web/crosswalk.git] / src / chrome / test / chromedriver / alert_commands.h
1 // Copyright (c) 2013 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.
4
5 #ifndef CHROME_TEST_CHROMEDRIVER_ALERT_COMMANDS_H_
6 #define CHROME_TEST_CHROMEDRIVER_ALERT_COMMANDS_H_
7
8 #include "base/callback_forward.h"
9 #include "base/memory/scoped_ptr.h"
10
11 namespace base {
12 class DictionaryValue;
13 class Value;
14 }
15
16 struct Session;
17 class Status;
18 class WebView;
19
20 typedef base::Callback<Status(
21     Session* session,
22     WebView* web_view,
23     const base::DictionaryValue&,
24     scoped_ptr<base::Value>*)> AlertCommand;
25
26 // Executes an alert command.
27 Status ExecuteAlertCommand(
28      const AlertCommand& alert_command,
29      Session* session,
30      const base::DictionaryValue& params,
31      scoped_ptr<base::Value>* value);
32
33 // Returns whether an alert is open.
34 Status ExecuteGetAlert(
35     Session* session,
36     WebView* web_view,
37     const base::DictionaryValue& params,
38     scoped_ptr<base::Value>* value);
39
40 // Returns the text of the open alert.
41 Status ExecuteGetAlertText(
42     Session* session,
43     WebView* web_view,
44     const base::DictionaryValue& params,
45     scoped_ptr<base::Value>* value);
46
47 // Sets the value of the alert prompt.
48 Status ExecuteSetAlertValue(
49     Session* session,
50     WebView* web_view,
51     const base::DictionaryValue& params,
52     scoped_ptr<base::Value>* value);
53
54 // Accepts the open alert.
55 Status ExecuteAcceptAlert(
56     Session* session,
57     WebView* web_view,
58     const base::DictionaryValue& params,
59     scoped_ptr<base::Value>* value);
60
61 // Dismisses the open alert.
62 Status ExecuteDismissAlert(
63     Session* session,
64     WebView* web_view,
65     const base::DictionaryValue& params,
66     scoped_ptr<base::Value>* value);
67
68 #endif  // CHROME_TEST_CHROMEDRIVER_ALERT_COMMANDS_H_