25
25
struct MockProvider : public location::Provider
27
MockProvider() : location::Provider()
31
MOCK_METHOD1(matches_criteria, bool(const location::Criteria&));
33
MOCK_CONST_METHOD1(supports, bool(const location::Provider::Features&));
34
MOCK_CONST_METHOD1(requires, bool(const location::Provider::Requirements&));
36
// Called by the engine whenever the wifi and cell ID reporting state changes.
37
MOCK_METHOD1(on_wifi_and_cell_reporting_state_changed, void(location::WifiAndCellIdReportingState state));
39
// Called by the engine whenever the reference location changed.
40
MOCK_METHOD1(on_reference_location_updated, void(const location::Update<location::Position>& position));
42
// Called by the engine whenever the reference velocity changed.
43
MOCK_METHOD1(on_reference_velocity_updated, void(const location::Update<location::Velocity>& velocity));
45
// Called by the engine whenever the reference heading changed.
46
MOCK_METHOD1(on_reference_heading_updated, void(const location::Update<location::Heading>& heading));
48
MOCK_METHOD0(start_position_updates, void());
49
MOCK_METHOD0(stop_position_updates, void());
51
MOCK_METHOD0(start_heading_updates, void());
52
MOCK_METHOD0(stop_heading_updates, void());
54
MOCK_METHOD0(start_velocity_updates, void());
55
MOCK_METHOD0(stop_velocity_updates, void());
27
MOCK_METHOD1(on_new_event, void(const location::Event&));
28
MOCK_METHOD0(enable, void());
29
MOCK_METHOD0(disable, void());
30
MOCK_METHOD0(activate, void());
31
MOCK_METHOD0(deactivate, void());
33
MOCK_CONST_METHOD0(requirements, Requirements());
34
MOCK_METHOD1(satisfies, bool(const location::Criteria&));
35
MOCK_CONST_METHOD0(position_updates, const core::Signal<location::Update<location::Position>>&());
36
MOCK_CONST_METHOD0(heading_updates, const core::Signal<location::Update<location::Heading>>&());
37
MOCK_CONST_METHOD0(velocity_updates, const core::Signal<location::Update<location::Velocity>>&());
57
39
// Inject a position update from the outside.
58
40
void inject_update(const location::Update<location::Position>& update)
60
mutable_updates().position(update);
42
updates.position(update);
63
45
// Inject a velocity update from the outside.
64
46
void inject_update(const location::Update<location::Velocity>& update)
66
mutable_updates().velocity(update);
48
updates.velocity(update);
69
51
// Inject a heading update from the outside.
70
52
void inject_update(const location::Update<location::Heading>& update)
72
mutable_updates().heading(update);
54
updates.heading(update);
59
core::Signal<location::Update<location::Position>> position;
60
core::Signal<location::Update<location::Heading>> heading;
61
core::Signal<location::Update<location::Velocity>> velocity;
76
65
#endif // MOCK_PROVIDER_H_