blob: f7d34ed17f4d40b7a3b615747908d54f5b4e88ee [file] [log] [blame]
Thieu Le3426c8f2012-01-11 17:35:11 -08001// Copyright (c) 2012 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
Ben Chanc45688b2014-07-02 23:50:45 -07005#ifndef SHILL_MOCK_METRICS_H_
6#define SHILL_MOCK_METRICS_H_
Thieu Le3426c8f2012-01-11 17:35:11 -08007
Alex Vakulenko8a532292014-06-16 17:18:44 -07008#include <string>
9
Thieu Le3426c8f2012-01-11 17:35:11 -080010#include "shill/metrics.h"
11
Wade Guthrie5a4e2ef2013-04-30 12:51:39 -070012#include <gmock/gmock.h>
13
Thieu Le3426c8f2012-01-11 17:35:11 -080014namespace shill {
15
16class MockMetrics : public Metrics {
17 public:
Wade Guthrie5a4e2ef2013-04-30 12:51:39 -070018 explicit MockMetrics(EventDispatcher *dispatcher);
Ben Chan5ea763b2014-08-13 11:07:54 -070019 ~MockMetrics() override;
Thieu Le3426c8f2012-01-11 17:35:11 -080020
Thieu Le6c1e3bb2013-02-06 15:20:35 -080021 MOCK_METHOD0(Start, void());
22 MOCK_METHOD0(Stop, void());
mukesh agrawal6cfe53f2013-08-13 13:39:01 -070023 MOCK_METHOD4(AddServiceStateTransitionTimer,
Wade Guthrie7ac610b2013-10-01 17:48:14 -070024 void(const Service &service, const std::string &histogram_name,
mukesh agrawal6cfe53f2013-08-13 13:39:01 -070025 Service::ConnectState start_state,
26 Service::ConnectState stop_state));
Peter Qiu9f5159e2014-09-12 16:50:14 -070027 MOCK_METHOD1(DeregisterDevice, void(int interface_index));
Wade Guthriec2728962013-07-10 09:32:16 -070028 MOCK_METHOD1(NotifyDeviceScanStarted, void(int interface_index));
Wade Guthrie5a4e2ef2013-04-30 12:51:39 -070029 MOCK_METHOD1(NotifyDeviceScanFinished, void(int interface_index));
Wade Guthrie44f290d2013-05-28 10:16:25 -070030 MOCK_METHOD1(ResetScanTimer, void(int interface_index));
31 MOCK_METHOD2(NotifyDeviceConnectStarted, void(int interface_index,
32 bool is_auto_connecting));
33 MOCK_METHOD1(NotifyDeviceConnectFinished, void(int interface_index));
34 MOCK_METHOD1(ResetConnectTimer, void(int interface_index));
Thieu Lea20cbc22012-01-09 22:01:43 +000035 MOCK_METHOD1(NotifyDefaultServiceChanged, void(const Service *service));
Darin Petkov58f0b6d2012-06-12 12:52:30 +020036 MOCK_METHOD2(NotifyServiceStateChanged,
Wade Guthrie7ac610b2013-10-01 17:48:14 -070037 void(const Service &service, Service::ConnectState new_state));
Peter Qiu1a72f542015-04-14 16:31:36 -070038#if !defined(DISABLE_WIFI)
Wade Guthriec2728962013-07-10 09:32:16 -070039 MOCK_METHOD2(Notify80211Disconnect, void(WiFiDisconnectByWhom by_whom,
40 IEEE_80211::WiFiReasonCode reason));
Peter Qiu1a72f542015-04-14 16:31:36 -070041#endif // DISABLE_WIFI
Prathmesh Prabhu08757aa2013-05-15 17:17:33 -070042 MOCK_METHOD0(Notify3GPPRegistrationDelayedDropPosted, void());
43 MOCK_METHOD0(Notify3GPPRegistrationDelayedDropCanceled, void());
Thieu Le5133b712013-02-19 14:47:21 -080044 MOCK_METHOD0(NotifyCorruptedProfile, void());
Thieu Le85e050b2012-03-13 15:04:38 -070045 MOCK_METHOD3(SendEnumToUMA, bool(const std::string &name, int sample,
46 int max));
47 MOCK_METHOD5(SendToUMA, bool(const std::string &name, int sample, int min,
48 int max, int num_buckets));
Peter Qiu574996a2014-04-04 10:55:47 -070049 MOCK_METHOD1(NotifyWifiAutoConnectableServices, void(int num_service));
50 MOCK_METHOD1(NotifyWifiAvailableBSSes, void(int num_bss));
Peter Qiu9d581932014-04-14 16:37:37 -070051 MOCK_METHOD1(NotifyServicesOnSameNetwork, void(int num_service));
Peter Qiue783f1c2014-05-02 11:42:33 -070052 MOCK_METHOD1(NotifyUserInitiatedEvent, void(int event));
Peter Qiu8e430582014-04-30 14:12:37 -070053 MOCK_METHOD1(NotifyWifiTxBitrate, void(int bitrate));
Peter Qiudc4e0992014-05-01 10:02:52 -070054 MOCK_METHOD2(NotifyUserInitiatedConnectionResult,
55 void(const std::string &name, int result));
Peter Qiud87179e2014-07-10 18:29:22 -070056 MOCK_METHOD2(NotifyUserInitiatedConnectionFailureReason,
57 void(const std::string &name,
58 const Service::ConnectFailure failure));
Peter Qiudc335f82014-05-15 10:33:17 -070059 MOCK_METHOD2(NotifyNetworkProblemDetected,
60 void(Technology::Identifier technology_id, int reason));
Peter Qiuf18e7712014-05-20 09:59:46 -070061 MOCK_METHOD2(NotifyFallbackDNSTestResult,
62 void(Technology::Identifier technology_id, int result));
Peter Qiu700de642014-07-14 16:31:30 -070063 MOCK_METHOD1(NotifyDeviceConnectionStatus,
64 void(Metrics::ConnectionStatus status));
Paul Stewart3bdf1ab2014-07-17 19:22:26 -070065 MOCK_METHOD1(NotifyDhcpClientStatus, void(Metrics::DhcpClientStatus status));
Peter Qiu300769e2014-08-27 11:48:45 -070066 MOCK_METHOD2(NotifyNetworkConnectionIPType,
67 void(Technology::Identifier technology_id,
68 Metrics::NetworkConnectionIPType type));
69 MOCK_METHOD2(NotifyIPv6ConnectivityStatus,
70 void(Technology::Identifier technology_id, bool status));
Peter Qiu94d18af2014-09-11 15:54:15 -070071 MOCK_METHOD2(NotifyDevicePresenceStatus,
72 void(Technology::Identifier technology_id, bool status));
Peter Qiua0572032014-09-26 10:07:37 -070073 MOCK_METHOD2(NotifyUnreliableLinkSignalStrength,
74 void(Technology::Identifier technology_id, int signal_strength));
Samuel Tanf144d5d2014-11-25 18:18:01 -080075 MOCK_METHOD1(NotifyVerifyWakeOnWiFiSettingsResult,
76 void(VerifyWakeOnWiFiSettingsResult result));
Samuel Tan1964b5d2014-12-02 10:11:21 -080077 MOCK_METHOD1(NotifyConnectedToServiceAfterWake,
78 void(WiFiConnectionStatusAfterWake status));
Samuel Tanc36b4102015-01-26 19:34:35 -080079 MOCK_METHOD0(NotifyWakeOnWiFiThrottled, void());
80 MOCK_METHOD0(NotifySuspendWithWakeOnWiFiEnabledDone, void());
Samuel Tan6d61faf2015-02-06 11:57:27 -080081 MOCK_METHOD0(NotifyDarkResumeInitiateScan, void());
Samuel Tana4933432015-02-06 18:20:41 -080082 MOCK_METHOD0(NotifyWakeupReasonReceived, void());
Peter Qiu1a72f542015-04-14 16:31:36 -070083#if !defined(DISABLE_WIFI)
Samuel Tana4933432015-02-06 18:20:41 -080084 MOCK_METHOD1(NotifyWakeOnWiFiOnDarkResume,
85 void(WakeOnWiFi::WakeOnWiFiTrigger reason));
Peter Qiu1a72f542015-04-14 16:31:36 -070086#endif // DISABLE_WIFI
Samuel Tand1bec5d2015-03-06 12:49:02 -080087 MOCK_METHOD1(NotifyScanStartedInDarkResume, void(bool is_active_scan));
Samuel Tan029feac2015-03-27 16:53:01 -070088 MOCK_METHOD0(NotifyDarkResumeScanRetry, void());
89 MOCK_METHOD2(NotifyBeforeSuspendActions,
90 void(bool is_connected, bool in_dark_resume));
Thieu Lea20cbc22012-01-09 22:01:43 +000091
Thieu Le3426c8f2012-01-11 17:35:11 -080092 private:
93 DISALLOW_COPY_AND_ASSIGN(MockMetrics);
94};
95
Wade Guthrie5a4e2ef2013-04-30 12:51:39 -070096} // namespace shill
Thieu Le3426c8f2012-01-11 17:35:11 -080097
Ben Chanc45688b2014-07-02 23:50:45 -070098#endif // SHILL_MOCK_METRICS_H_