OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2015 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_CHROME_RECORDER_DEVTOOLS_CLIENT_H_ |
| 6 #define CHROME_TEST_CHROMEDRIVER_CHROME_RECORDER_DEVTOOLS_CLIENT_H_ |
| 7 |
| 8 #include <vector> |
| 9 |
| 10 #include "base/values.h" |
| 11 #include "chrome/test/chromedriver/chrome/stub_devtools_client.h" |
| 12 |
| 13 namespace base { |
| 14 class DictionaryValue; |
| 15 } |
| 16 |
| 17 class Status; |
| 18 |
| 19 struct Command { |
| 20 Command() {} |
| 21 Command(const std::string& method, const base::DictionaryValue& params) |
| 22 : method(method) { |
| 23 this->params.MergeDictionary(¶ms); |
| 24 } |
| 25 Command(const Command& command) { |
| 26 *this = command; |
| 27 } |
| 28 Command& operator=(const Command& command) { |
| 29 method = command.method; |
| 30 params.Clear(); |
| 31 params.MergeDictionary(&command.params); |
| 32 return *this; |
| 33 } |
| 34 ~Command() {} |
| 35 |
| 36 std::string method; |
| 37 base::DictionaryValue params; |
| 38 }; |
| 39 |
| 40 class RecorderDevToolsClient : public StubDevToolsClient { |
| 41 public: |
| 42 RecorderDevToolsClient(); |
| 43 ~RecorderDevToolsClient() override; |
| 44 |
| 45 // Overridden from StubDevToolsClient: |
| 46 Status SendCommandAndGetResult( |
| 47 const std::string& method, |
| 48 const base::DictionaryValue& params, |
| 49 scoped_ptr<base::DictionaryValue>* result) override; |
| 50 |
| 51 std::vector<Command> commands_; |
| 52 }; |
| 53 |
| 54 #endif // CHROME_TEST_CHROMEDRIVER_CHROME_RECORDER_DEVTOOLS_CLIENT_H_ |
OLD | NEW |