OLD | NEW |
| (Empty) |
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. | |
4 | |
5 #ifndef CHROME_TEST_WEBDRIVER_COMMANDS_HTML5_STORAGE_COMMANDS_H_ | |
6 #define CHROME_TEST_WEBDRIVER_COMMANDS_HTML5_STORAGE_COMMANDS_H_ | |
7 | |
8 #include <string> | |
9 #include <vector> | |
10 | |
11 #include "chrome/test/webdriver/commands/webdriver_command.h" | |
12 | |
13 namespace base { | |
14 class DictionaryValue; | |
15 } | |
16 | |
17 namespace webdriver { | |
18 | |
19 class Response; | |
20 | |
21 class LocalStorageCommand : public WebDriverCommand { | |
22 public: | |
23 LocalStorageCommand(const std::vector<std::string>& path_segments, | |
24 const base::DictionaryValue* const parameters); | |
25 virtual ~LocalStorageCommand(); | |
26 | |
27 virtual bool DoesGet() OVERRIDE; | |
28 virtual bool DoesPost() OVERRIDE; | |
29 virtual bool DoesDelete() OVERRIDE; | |
30 | |
31 // Returns the list of all keys in the HTML5 localStorage object. | |
32 virtual void ExecuteGet(Response* const response) OVERRIDE; | |
33 | |
34 // Sets the value of an item in the HTML5 localStorage. | |
35 virtual void ExecutePost(Response* const response) OVERRIDE; | |
36 | |
37 // Deletes all items from the localStorage object. | |
38 virtual void ExecuteDelete(Response* const response) OVERRIDE; | |
39 | |
40 private: | |
41 DISALLOW_COPY_AND_ASSIGN(LocalStorageCommand); | |
42 }; | |
43 | |
44 class LocalStorageKeyCommand : public WebDriverCommand { | |
45 public: | |
46 LocalStorageKeyCommand(const std::vector<std::string>& path_segments, | |
47 const base::DictionaryValue* const parameters); | |
48 virtual ~LocalStorageKeyCommand(); | |
49 | |
50 virtual bool DoesGet() OVERRIDE; | |
51 virtual bool DoesDelete() OVERRIDE; | |
52 | |
53 // Returns the value of an item in the HTML5 localStorage. | |
54 virtual void ExecuteGet(Response* const response) OVERRIDE; | |
55 | |
56 // Deletes an item in the HTML5 localStorage and returns the value. | |
57 virtual void ExecuteDelete(Response* const response) OVERRIDE; | |
58 | |
59 private: | |
60 DISALLOW_COPY_AND_ASSIGN(LocalStorageKeyCommand); | |
61 }; | |
62 | |
63 class LocalStorageSizeCommand : public WebDriverCommand { | |
64 public: | |
65 LocalStorageSizeCommand(const std::vector<std::string>& path_segments, | |
66 const base::DictionaryValue* const parameters); | |
67 virtual ~LocalStorageSizeCommand(); | |
68 | |
69 virtual bool DoesGet() OVERRIDE; | |
70 | |
71 // Returns the size of the HTML5 localStorage object. | |
72 virtual void ExecuteGet(Response* const response) OVERRIDE; | |
73 | |
74 private: | |
75 DISALLOW_COPY_AND_ASSIGN(LocalStorageSizeCommand); | |
76 }; | |
77 | |
78 class SessionStorageCommand : public WebDriverCommand { | |
79 public: | |
80 SessionStorageCommand(const std::vector<std::string>& path_segments, | |
81 base::DictionaryValue* parameters); | |
82 virtual ~SessionStorageCommand(); | |
83 | |
84 virtual bool DoesGet() OVERRIDE; | |
85 virtual bool DoesPost() OVERRIDE; | |
86 virtual bool DoesDelete() OVERRIDE; | |
87 | |
88 // Returns the key of all items in the HTML5 sessionStorage object. | |
89 virtual void ExecuteGet(Response* const response) OVERRIDE; | |
90 | |
91 // Set the value of an item in the HTML5 sessionStorage. | |
92 virtual void ExecutePost(Response* const response) OVERRIDE; | |
93 | |
94 // Deletes all items from the sessionStorage object. | |
95 virtual void ExecuteDelete(Response* const response) OVERRIDE; | |
96 | |
97 private: | |
98 DISALLOW_COPY_AND_ASSIGN(SessionStorageCommand); | |
99 }; | |
100 | |
101 class SessionStorageKeyCommand : public WebDriverCommand { | |
102 public: | |
103 SessionStorageKeyCommand(const std::vector<std::string>& path_segments, | |
104 const base::DictionaryValue* const parameters); | |
105 virtual ~SessionStorageKeyCommand(); | |
106 | |
107 virtual bool DoesGet() OVERRIDE; | |
108 virtual bool DoesDelete() OVERRIDE; | |
109 | |
110 // Returns the value of an item in the HTML5 sessionStorage. | |
111 virtual void ExecuteGet(Response* const response) OVERRIDE; | |
112 | |
113 // Deletes an item in the HTML5 sessionStorage and returns the value. | |
114 virtual void ExecuteDelete(Response* const response) OVERRIDE; | |
115 | |
116 private: | |
117 DISALLOW_COPY_AND_ASSIGN(SessionStorageKeyCommand); | |
118 }; | |
119 | |
120 class SessionStorageSizeCommand : public WebDriverCommand { | |
121 public: | |
122 SessionStorageSizeCommand(const std::vector<std::string>& path_segments, | |
123 const base::DictionaryValue* const parameters); | |
124 virtual ~SessionStorageSizeCommand(); | |
125 | |
126 virtual bool DoesGet() OVERRIDE; | |
127 | |
128 // Returns the size of the HTML5 sessionStorage object. | |
129 virtual void ExecuteGet(Response* const response) OVERRIDE; | |
130 | |
131 private: | |
132 DISALLOW_COPY_AND_ASSIGN(SessionStorageSizeCommand); | |
133 }; | |
134 | |
135 } // namespace webdriver | |
136 | |
137 #endif // CHROME_TEST_WEBDRIVER_COMMANDS_HTML5_STORAGE_COMMANDS_H_ | |
OLD | NEW |