| 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_CHROMEDRIVER_COMMAND_EXECUTOR_IMPL_H_ | |
| 6 #define CHROME_TEST_CHROMEDRIVER_COMMAND_EXECUTOR_IMPL_H_ | |
| 7 | |
| 8 #include <string> | |
| 9 | |
| 10 #include "base/basictypes.h" | |
| 11 #include "base/callback_forward.h" | |
| 12 #include "base/compiler_specific.h" | |
| 13 #include "base/gtest_prod_util.h" | |
| 14 #include "base/memory/scoped_ptr.h" | |
| 15 #include "base/threading/thread.h" | |
| 16 #include "chrome/test/chromedriver/chrome/status.h" | |
| 17 #include "chrome/test/chromedriver/command.h" | |
| 18 #include "chrome/test/chromedriver/command_executor.h" | |
| 19 #include "chrome/test/chromedriver/net/sync_websocket_factory.h" | |
| 20 #include "chrome/test/chromedriver/session_map.h" | |
| 21 #include "chrome/test/chromedriver/synchronized_map.h" | |
| 22 | |
| 23 namespace base { | |
| 24 class DictionaryValue; | |
| 25 class Value; | |
| 26 } | |
| 27 | |
| 28 class Adb; | |
| 29 class ChromeLauncherImpl; | |
| 30 class DeviceManager; | |
| 31 class Log; | |
| 32 class URLRequestContextGetter; | |
| 33 | |
| 34 class CommandExecutorImpl : public CommandExecutor { | |
| 35 public: | |
| 36 explicit CommandExecutorImpl(Log* log); | |
| 37 virtual ~CommandExecutorImpl(); | |
| 38 | |
| 39 // Overridden from CommandExecutor: | |
| 40 virtual void Init() OVERRIDE; | |
| 41 virtual void ExecuteCommand(const std::string& name, | |
| 42 const base::DictionaryValue& params, | |
| 43 const std::string& session_id, | |
| 44 StatusCode* status_code, | |
| 45 scoped_ptr<base::Value>* value, | |
| 46 std::string* out_session_id) OVERRIDE; | |
| 47 | |
| 48 private: | |
| 49 FRIEND_TEST_ALL_PREFIXES(CommandExecutorImplTest, SimpleCommand); | |
| 50 FRIEND_TEST_ALL_PREFIXES( | |
| 51 CommandExecutorImplTest, CommandThatDoesntSetValueOrSessionId); | |
| 52 FRIEND_TEST_ALL_PREFIXES(CommandExecutorImplTest, CommandThatReturnsError); | |
| 53 | |
| 54 Log* log_; | |
| 55 base::Thread io_thread_; | |
| 56 scoped_refptr<URLRequestContextGetter> context_getter_; | |
| 57 SyncWebSocketFactory socket_factory_; | |
| 58 SessionMap session_map_; | |
| 59 SynchronizedMap<std::string, Command> command_map_; | |
| 60 scoped_ptr<Adb> adb_; | |
| 61 scoped_ptr<DeviceManager> device_manager_; | |
| 62 | |
| 63 DISALLOW_COPY_AND_ASSIGN(CommandExecutorImpl); | |
| 64 }; | |
| 65 | |
| 66 #endif // CHROME_TEST_CHROMEDRIVER_COMMAND_EXECUTOR_IMPL_H_ | |
| OLD | NEW |