#ifndef CHROMEOS_DBUS_FAKE_GSM_SMS_CLIENT_H_
#define CHROMEOS_DBUS_FAKE_GSM_SMS_CLIENT_H_
#include <string>
#include "base/memory/weak_ptr.h"
#include "base/values.h"
#include "chromeos/dbus/gsm_sms_client.h"
#include "dbus/object_path.h"
namespace chromeos {
class CHROMEOS_EXPORT FakeGsmSMSClient : public GsmSMSClient {
public:
FakeGsmSMSClient();
virtual ~FakeGsmSMSClient();
virtual void Init(dbus::Bus* bus) OVERRIDE;
virtual void SetSmsReceivedHandler(const std::string& service_name,
const dbus::ObjectPath& object_path,
const SmsReceivedHandler& handler)
OVERRIDE;
virtual void ResetSmsReceivedHandler(const std::string& service_name,
const dbus::ObjectPath& object_path)
OVERRIDE;
virtual void Delete(const std::string& service_name,
const dbus::ObjectPath& object_path,
uint32 index,
const DeleteCallback& callback) OVERRIDE;
virtual void Get(const std::string& service_name,
const dbus::ObjectPath& object_path,
uint32 index,
const GetCallback& callback) OVERRIDE;
virtual void List(const std::string& service_name,
const dbus::ObjectPath& object_path,
const ListCallback& callback) OVERRIDE;
virtual void RequestUpdate(const std::string& service_name,
const dbus::ObjectPath& object_path) OVERRIDE;
void set_sms_test_message_switch_present(bool is_present) {
sms_test_message_switch_present_ = is_present;
}
private:
void PushTestMessageChain();
void PushTestMessageDelayed();
bool PushTestMessage();
int test_index_;
std::vector<std::string> test_messages_;
base::ListValue message_list_;
SmsReceivedHandler handler_;
bool sms_test_message_switch_present_;
base::WeakPtrFactory<FakeGsmSMSClient> weak_ptr_factory_;
DISALLOW_COPY_AND_ASSIGN(FakeGsmSMSClient);
};
}
#endif