| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_TEST_CHROMEDRIVER_COMMAND_EXECUTOR_IMPL_H_ | 5 #ifndef CHROME_TEST_CHROMEDRIVER_COMMAND_EXECUTOR_IMPL_H_ |
| 6 #define CHROME_TEST_CHROMEDRIVER_COMMAND_EXECUTOR_IMPL_H_ | 6 #define CHROME_TEST_CHROMEDRIVER_COMMAND_EXECUTOR_IMPL_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| 11 #include "base/callback_forward.h" | 11 #include "base/callback_forward.h" |
| 12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
| 13 #include "base/gtest_prod_util.h" | 13 #include "base/gtest_prod_util.h" |
| 14 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
| 15 #include "chrome/test/chromedriver/chrome_launcher_impl.h" | 15 #include "base/threading/thread.h" |
| 16 #include "chrome/test/chromedriver/command.h" | 16 #include "chrome/test/chromedriver/command.h" |
| 17 #include "chrome/test/chromedriver/command_executor.h" | 17 #include "chrome/test/chromedriver/command_executor.h" |
| 18 #include "chrome/test/chromedriver/session_map.h" | 18 #include "chrome/test/chromedriver/session_map.h" |
| 19 #include "chrome/test/chromedriver/status.h" | 19 #include "chrome/test/chromedriver/status.h" |
| 20 #include "chrome/test/chromedriver/synchronized_map.h" | 20 #include "chrome/test/chromedriver/synchronized_map.h" |
| 21 | 21 |
| 22 namespace base { | 22 namespace base { |
| 23 class DictionaryValue; | 23 class DictionaryValue; |
| 24 class Value; | 24 class Value; |
| 25 } | 25 } |
| 26 | 26 |
| 27 class ChromeLauncherImpl; |
| 28 class URLRequestContextGetter; |
| 29 |
| 27 class CommandExecutorImpl : public CommandExecutor { | 30 class CommandExecutorImpl : public CommandExecutor { |
| 28 public: | 31 public: |
| 29 CommandExecutorImpl(); | 32 CommandExecutorImpl(); |
| 30 virtual ~CommandExecutorImpl(); | 33 virtual ~CommandExecutorImpl(); |
| 31 | 34 |
| 32 // Overridden from CommandExecutor: | 35 // Overridden from CommandExecutor: |
| 36 virtual void Init() OVERRIDE; |
| 33 virtual void ExecuteCommand(const std::string& name, | 37 virtual void ExecuteCommand(const std::string& name, |
| 34 const base::DictionaryValue& params, | 38 const base::DictionaryValue& params, |
| 35 const std::string& session_id, | 39 const std::string& session_id, |
| 36 StatusCode* status_code, | 40 StatusCode* status_code, |
| 37 scoped_ptr<base::Value>* value, | 41 scoped_ptr<base::Value>* value, |
| 38 std::string* out_session_id) OVERRIDE; | 42 std::string* out_session_id) OVERRIDE; |
| 39 | 43 |
| 40 private: | 44 private: |
| 41 FRIEND_TEST_ALL_PREFIXES(CommandExecutorImplTest, SimpleCommand); | 45 FRIEND_TEST_ALL_PREFIXES(CommandExecutorImplTest, SimpleCommand); |
| 42 FRIEND_TEST_ALL_PREFIXES( | 46 FRIEND_TEST_ALL_PREFIXES( |
| 43 CommandExecutorImplTest, CommandThatDoesntSetValueOrSessionId); | 47 CommandExecutorImplTest, CommandThatDoesntSetValueOrSessionId); |
| 44 FRIEND_TEST_ALL_PREFIXES(CommandExecutorImplTest, CommandThatReturnsError); | 48 FRIEND_TEST_ALL_PREFIXES(CommandExecutorImplTest, CommandThatReturnsError); |
| 45 | 49 |
| 50 base::Thread io_thread_; |
| 51 scoped_refptr<URLRequestContextGetter> context_getter_; |
| 46 SessionMap session_map_; | 52 SessionMap session_map_; |
| 47 ChromeLauncherImpl launcher_; | 53 scoped_ptr<ChromeLauncherImpl> launcher_; |
| 48 SynchronizedMap<std::string, Command> command_map_; | 54 SynchronizedMap<std::string, Command> command_map_; |
| 49 | 55 |
| 50 DISALLOW_COPY_AND_ASSIGN(CommandExecutorImpl); | 56 DISALLOW_COPY_AND_ASSIGN(CommandExecutorImpl); |
| 51 }; | 57 }; |
| 52 | 58 |
| 53 #endif // CHROME_TEST_CHROMEDRIVER_COMMAND_EXECUTOR_IMPL_H_ | 59 #endif // CHROME_TEST_CHROMEDRIVER_COMMAND_EXECUTOR_IMPL_H_ |
| OLD | NEW |