summaryrefslogtreecommitdiffstats
path: root/chrome/test/chromedriver/command_executor.h
blob: e5d60c6cc2e2cba23e31da6dc8595eb9bdb226fb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef CHROME_TEST_CHROMEDRIVER_COMMAND_EXECUTOR_H_
#define CHROME_TEST_CHROMEDRIVER_COMMAND_EXECUTOR_H_

#include <string>

#include "base/basictypes.h"
#include "base/memory/scoped_ptr.h"
#include "base/threading/non_thread_safe.h"
#include "chrome/test/chromedriver/chrome/status.h"

namespace base {
class DictionaryValue;
class Value;
}

// Executes WebDriver commands.
class CommandExecutor {
 public:
  virtual ~CommandExecutor() {}

  virtual void Init() = 0;

  // Executes a command synchronously. This function must be thread safe.
  virtual void ExecuteCommand(const std::string& name,
                              const base::DictionaryValue& params,
                              const std::string& session_id,
                              StatusCode* status_code,
                              scoped_ptr<base::Value>* value,
                              std::string* out_session_id) = 0;
};

#endif  // CHROME_TEST_CHROMEDRIVER_COMMAND_EXECUTOR_H_