Thieu Le | 3426c8f | 2012-01-11 17:35:11 -0800 | [diff] [blame] | 1 | // 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 Chan | c45688b | 2014-07-02 23:50:45 -0700 | [diff] [blame] | 5 | #ifndef SHILL_MOCK_METRICS_H_ |
| 6 | #define SHILL_MOCK_METRICS_H_ |
Thieu Le | 3426c8f | 2012-01-11 17:35:11 -0800 | [diff] [blame] | 7 | |
Alex Vakulenko | 8a53229 | 2014-06-16 17:18:44 -0700 | [diff] [blame] | 8 | #include <string> |
| 9 | |
Thieu Le | 3426c8f | 2012-01-11 17:35:11 -0800 | [diff] [blame] | 10 | #include "shill/metrics.h" |
| 11 | |
Wade Guthrie | 5a4e2ef | 2013-04-30 12:51:39 -0700 | [diff] [blame] | 12 | #include <gmock/gmock.h> |
| 13 | |
Thieu Le | 3426c8f | 2012-01-11 17:35:11 -0800 | [diff] [blame] | 14 | namespace shill { |
| 15 | |
| 16 | class MockMetrics : public Metrics { |
| 17 | public: |
Wade Guthrie | 5a4e2ef | 2013-04-30 12:51:39 -0700 | [diff] [blame] | 18 | explicit MockMetrics(EventDispatcher *dispatcher); |
Ben Chan | 5ea763b | 2014-08-13 11:07:54 -0700 | [diff] [blame] | 19 | ~MockMetrics() override; |
Thieu Le | 3426c8f | 2012-01-11 17:35:11 -0800 | [diff] [blame] | 20 | |
Thieu Le | 6c1e3bb | 2013-02-06 15:20:35 -0800 | [diff] [blame] | 21 | MOCK_METHOD0(Start, void()); |
| 22 | MOCK_METHOD0(Stop, void()); |
mukesh agrawal | 6cfe53f | 2013-08-13 13:39:01 -0700 | [diff] [blame] | 23 | MOCK_METHOD4(AddServiceStateTransitionTimer, |
Wade Guthrie | 7ac610b | 2013-10-01 17:48:14 -0700 | [diff] [blame] | 24 | void(const Service &service, const std::string &histogram_name, |
mukesh agrawal | 6cfe53f | 2013-08-13 13:39:01 -0700 | [diff] [blame] | 25 | Service::ConnectState start_state, |
| 26 | Service::ConnectState stop_state)); |
Peter Qiu | 9f5159e | 2014-09-12 16:50:14 -0700 | [diff] [blame] | 27 | MOCK_METHOD1(DeregisterDevice, void(int interface_index)); |
Wade Guthrie | c272896 | 2013-07-10 09:32:16 -0700 | [diff] [blame] | 28 | MOCK_METHOD1(NotifyDeviceScanStarted, void(int interface_index)); |
Wade Guthrie | 5a4e2ef | 2013-04-30 12:51:39 -0700 | [diff] [blame] | 29 | MOCK_METHOD1(NotifyDeviceScanFinished, void(int interface_index)); |
Wade Guthrie | 44f290d | 2013-05-28 10:16:25 -0700 | [diff] [blame] | 30 | 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 Le | a20cbc2 | 2012-01-09 22:01:43 +0000 | [diff] [blame] | 35 | MOCK_METHOD1(NotifyDefaultServiceChanged, void(const Service *service)); |
Darin Petkov | 58f0b6d | 2012-06-12 12:52:30 +0200 | [diff] [blame] | 36 | MOCK_METHOD2(NotifyServiceStateChanged, |
Wade Guthrie | 7ac610b | 2013-10-01 17:48:14 -0700 | [diff] [blame] | 37 | void(const Service &service, Service::ConnectState new_state)); |
Peter Qiu | 1a72f54 | 2015-04-14 16:31:36 -0700 | [diff] [blame] | 38 | #if !defined(DISABLE_WIFI) |
Wade Guthrie | c272896 | 2013-07-10 09:32:16 -0700 | [diff] [blame] | 39 | MOCK_METHOD2(Notify80211Disconnect, void(WiFiDisconnectByWhom by_whom, |
| 40 | IEEE_80211::WiFiReasonCode reason)); |
Peter Qiu | 1a72f54 | 2015-04-14 16:31:36 -0700 | [diff] [blame] | 41 | #endif // DISABLE_WIFI |
Prathmesh Prabhu | 08757aa | 2013-05-15 17:17:33 -0700 | [diff] [blame] | 42 | MOCK_METHOD0(Notify3GPPRegistrationDelayedDropPosted, void()); |
| 43 | MOCK_METHOD0(Notify3GPPRegistrationDelayedDropCanceled, void()); |
Thieu Le | 5133b71 | 2013-02-19 14:47:21 -0800 | [diff] [blame] | 44 | MOCK_METHOD0(NotifyCorruptedProfile, void()); |
Thieu Le | 85e050b | 2012-03-13 15:04:38 -0700 | [diff] [blame] | 45 | 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 Qiu | 574996a | 2014-04-04 10:55:47 -0700 | [diff] [blame] | 49 | MOCK_METHOD1(NotifyWifiAutoConnectableServices, void(int num_service)); |
| 50 | MOCK_METHOD1(NotifyWifiAvailableBSSes, void(int num_bss)); |
Peter Qiu | 9d58193 | 2014-04-14 16:37:37 -0700 | [diff] [blame] | 51 | MOCK_METHOD1(NotifyServicesOnSameNetwork, void(int num_service)); |
Peter Qiu | e783f1c | 2014-05-02 11:42:33 -0700 | [diff] [blame] | 52 | MOCK_METHOD1(NotifyUserInitiatedEvent, void(int event)); |
Peter Qiu | 8e43058 | 2014-04-30 14:12:37 -0700 | [diff] [blame] | 53 | MOCK_METHOD1(NotifyWifiTxBitrate, void(int bitrate)); |
Peter Qiu | dc4e099 | 2014-05-01 10:02:52 -0700 | [diff] [blame] | 54 | MOCK_METHOD2(NotifyUserInitiatedConnectionResult, |
| 55 | void(const std::string &name, int result)); |
Peter Qiu | d87179e | 2014-07-10 18:29:22 -0700 | [diff] [blame] | 56 | MOCK_METHOD2(NotifyUserInitiatedConnectionFailureReason, |
| 57 | void(const std::string &name, |
| 58 | const Service::ConnectFailure failure)); |
Peter Qiu | dc335f8 | 2014-05-15 10:33:17 -0700 | [diff] [blame] | 59 | MOCK_METHOD2(NotifyNetworkProblemDetected, |
| 60 | void(Technology::Identifier technology_id, int reason)); |
Peter Qiu | f18e771 | 2014-05-20 09:59:46 -0700 | [diff] [blame] | 61 | MOCK_METHOD2(NotifyFallbackDNSTestResult, |
| 62 | void(Technology::Identifier technology_id, int result)); |
Peter Qiu | 700de64 | 2014-07-14 16:31:30 -0700 | [diff] [blame] | 63 | MOCK_METHOD1(NotifyDeviceConnectionStatus, |
| 64 | void(Metrics::ConnectionStatus status)); |
Paul Stewart | 3bdf1ab | 2014-07-17 19:22:26 -0700 | [diff] [blame] | 65 | MOCK_METHOD1(NotifyDhcpClientStatus, void(Metrics::DhcpClientStatus status)); |
Peter Qiu | 300769e | 2014-08-27 11:48:45 -0700 | [diff] [blame] | 66 | 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 Qiu | 94d18af | 2014-09-11 15:54:15 -0700 | [diff] [blame] | 71 | MOCK_METHOD2(NotifyDevicePresenceStatus, |
| 72 | void(Technology::Identifier technology_id, bool status)); |
Peter Qiu | a057203 | 2014-09-26 10:07:37 -0700 | [diff] [blame] | 73 | MOCK_METHOD2(NotifyUnreliableLinkSignalStrength, |
| 74 | void(Technology::Identifier technology_id, int signal_strength)); |
Samuel Tan | f144d5d | 2014-11-25 18:18:01 -0800 | [diff] [blame] | 75 | MOCK_METHOD1(NotifyVerifyWakeOnWiFiSettingsResult, |
| 76 | void(VerifyWakeOnWiFiSettingsResult result)); |
Samuel Tan | 1964b5d | 2014-12-02 10:11:21 -0800 | [diff] [blame] | 77 | MOCK_METHOD1(NotifyConnectedToServiceAfterWake, |
| 78 | void(WiFiConnectionStatusAfterWake status)); |
Samuel Tan | c36b410 | 2015-01-26 19:34:35 -0800 | [diff] [blame] | 79 | MOCK_METHOD0(NotifyWakeOnWiFiThrottled, void()); |
| 80 | MOCK_METHOD0(NotifySuspendWithWakeOnWiFiEnabledDone, void()); |
Samuel Tan | 6d61faf | 2015-02-06 11:57:27 -0800 | [diff] [blame] | 81 | MOCK_METHOD0(NotifyDarkResumeInitiateScan, void()); |
Samuel Tan | a493343 | 2015-02-06 18:20:41 -0800 | [diff] [blame] | 82 | MOCK_METHOD0(NotifyWakeupReasonReceived, void()); |
Peter Qiu | 1a72f54 | 2015-04-14 16:31:36 -0700 | [diff] [blame] | 83 | #if !defined(DISABLE_WIFI) |
Samuel Tan | a493343 | 2015-02-06 18:20:41 -0800 | [diff] [blame] | 84 | MOCK_METHOD1(NotifyWakeOnWiFiOnDarkResume, |
| 85 | void(WakeOnWiFi::WakeOnWiFiTrigger reason)); |
Peter Qiu | 1a72f54 | 2015-04-14 16:31:36 -0700 | [diff] [blame] | 86 | #endif // DISABLE_WIFI |
Samuel Tan | d1bec5d | 2015-03-06 12:49:02 -0800 | [diff] [blame] | 87 | MOCK_METHOD1(NotifyScanStartedInDarkResume, void(bool is_active_scan)); |
Samuel Tan | 029feac | 2015-03-27 16:53:01 -0700 | [diff] [blame] | 88 | MOCK_METHOD0(NotifyDarkResumeScanRetry, void()); |
| 89 | MOCK_METHOD2(NotifyBeforeSuspendActions, |
| 90 | void(bool is_connected, bool in_dark_resume)); |
Thieu Le | a20cbc2 | 2012-01-09 22:01:43 +0000 | [diff] [blame] | 91 | |
Thieu Le | 3426c8f | 2012-01-11 17:35:11 -0800 | [diff] [blame] | 92 | private: |
| 93 | DISALLOW_COPY_AND_ASSIGN(MockMetrics); |
| 94 | }; |
| 95 | |
Wade Guthrie | 5a4e2ef | 2013-04-30 12:51:39 -0700 | [diff] [blame] | 96 | } // namespace shill |
Thieu Le | 3426c8f | 2012-01-11 17:35:11 -0800 | [diff] [blame] | 97 | |
Ben Chan | c45688b | 2014-07-02 23:50:45 -0700 | [diff] [blame] | 98 | #endif // SHILL_MOCK_METRICS_H_ |