blob: 5b44fda95c8594145aa71b11afb1dc1f90ed9649 [file] [log] [blame]
Chris Masonea82b7112011-05-25 15:16:29 -07001// Copyright (c) 2011 The Chromium OS 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#include "shill/mock_service.h"
6
7#include <string>
8
9#include <base/memory/ref_counted.h>
10#include <base/stringprintf.h>
11#include <gmock/gmock.h>
12
Chris Masone7aa5f902011-07-11 11:13:35 -070013#include "shill/refptr_types.h"
Chris Masone6515aab2011-10-12 16:19:09 -070014#include "shill/store_interface.h"
Chris Masone7aa5f902011-07-11 11:13:35 -070015
16using std::string;
Paul Stewart22aa71b2011-09-16 12:15:11 -070017using testing::_;
Chris Masone6791a432011-07-12 13:23:19 -070018using testing::Return;
Chris Masone7aa5f902011-07-11 11:13:35 -070019
Chris Masonea82b7112011-05-25 15:16:29 -070020namespace shill {
21
22class ControlInterface;
23class EventDispatcher;
Chris Masone6791a432011-07-12 13:23:19 -070024class Manager;
Chris Masonea82b7112011-05-25 15:16:29 -070025
Chris Masonea82b7112011-05-25 15:16:29 -070026MockService::MockService(ControlInterface *control_interface,
27 EventDispatcher *dispatcher,
mukesh agrawal51a7e932011-07-27 16:18:26 -070028 Manager *manager)
mukesh agrawal7a4e4002011-09-06 11:26:05 -070029 : Service(control_interface, dispatcher, manager, "mock") {
Chris Masone6515aab2011-10-12 16:19:09 -070030 const string &id = UniqueName();
31 EXPECT_CALL(*this, GetRpcIdentifier()).WillRepeatedly(Return(id));
32 EXPECT_CALL(*this, GetStorageIdentifier()).WillRepeatedly(Return(id));
Paul Stewart22aa71b2011-09-16 12:15:11 -070033 ON_CALL(*this, state()).WillByDefault(Return(kStateUnknown));
34 ON_CALL(*this, failure()).WillByDefault(Return(kFailureUnknown));
35 ON_CALL(*this, TechnologyIs(_)).WillByDefault(Return(false));
Chris Masonea82b7112011-05-25 15:16:29 -070036}
37
38MockService::~MockService() {}
39
Chris Masone6515aab2011-10-12 16:19:09 -070040bool MockService::FauxSave(StoreInterface *store) {
41 return store->SetString(UniqueName(), "dummy", "dummy");
42}
43
Chris Masonea82b7112011-05-25 15:16:29 -070044} // namespace shill