root/chrome/test/chromedriver/chrome/stub_devtools_client.cc

/* [<][>][^][v][top][bottom][index][help] */

DEFINITIONS

This source file includes following definitions.
  1. GetId
  2. WasCrashed
  3. ConnectIfNecessary
  4. SendCommand
  5. SendCommandAndGetResult
  6. AddListener
  7. HandleEventsUntil
  8. HandleReceivedEvents

// Copyright (c) 2013 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.

#include "chrome/test/chromedriver/chrome/stub_devtools_client.h"

#include "base/values.h"
#include "chrome/test/chromedriver/chrome/status.h"

StubDevToolsClient::StubDevToolsClient() : id_("stub-id") {}

StubDevToolsClient::StubDevToolsClient(const std::string& id) : id_(id) {}

StubDevToolsClient::~StubDevToolsClient() {}

const std::string& StubDevToolsClient::GetId() {
  return id_;
}

bool StubDevToolsClient::WasCrashed() {
  return false;
}

Status StubDevToolsClient::ConnectIfNecessary() {
  return Status(kOk);
}

Status StubDevToolsClient::SendCommand(const std::string& method,
                                       const base::DictionaryValue& params) {
  scoped_ptr<base::DictionaryValue> result;
  return SendCommandAndGetResult(method, params, &result);
}

Status StubDevToolsClient::SendCommandAndGetResult(
      const std::string& method,
      const base::DictionaryValue& params,
      scoped_ptr<base::DictionaryValue>* result) {
  result->reset(new base::DictionaryValue());
  return Status(kOk);
}

void StubDevToolsClient::AddListener(DevToolsEventListener* listener) {
  listeners_.push_back(listener);
}

Status StubDevToolsClient::HandleEventsUntil(
    const ConditionalFunc& conditional_func,
    const base::TimeDelta& timeout) {
  return Status(kOk);
}

Status StubDevToolsClient::HandleReceivedEvents() {
  return Status(kOk);
}

/* [<][>][^][v][top][bottom][index][help] */