forked from organicmaps/organicmaps
[eye][tips] review fixes
This commit is contained in:
parent
2ac5023f78
commit
4c14c4b3fa
4 changed files with 11 additions and 11 deletions
|
@ -29,7 +29,7 @@ public:
|
|||
// TipsApi::Delegate overrides:
|
||||
boost::optional<m2::PointD> GetCurrentPosition() const override
|
||||
{
|
||||
return boost::optional<m2::PointD>();
|
||||
return {};
|
||||
}
|
||||
|
||||
bool IsCountryLoaded(m2::PointD const & pt) const override { return false; }
|
||||
|
@ -65,7 +65,7 @@ boost::optional<eye::Tip::Type> GetTipForTesting(TipsApi::Duration showAnyTipPer
|
|||
[] (eye::Info const & info) { return true; },
|
||||
// Condition for Tips::Type::DiscoverButton type.
|
||||
[] (eye::Info const & info) { return true; },
|
||||
// Condition for Tips::Type::MapsLayers type.
|
||||
// Condition for Tips::Type::PublicTransport type.
|
||||
[] (eye::Info const & info) { return true; }
|
||||
}};
|
||||
return TipsApi::GetTipForTesting(showAnyTipPeriod, showSameTipPeriod, delegate, conditions);
|
||||
|
|
|
@ -159,12 +159,12 @@ TipsApi::TipsApi(Delegate const & delegate)
|
|||
|
||||
return m_delegate.IsCountryLoaded(pos.get());
|
||||
},
|
||||
// Condition for Tips::Type::MapsLayers type.
|
||||
// Condition for Tips::Type::PublicTransport type.
|
||||
[this] (eye::Info const & info)
|
||||
{
|
||||
for (auto const & layer : info.m_layers)
|
||||
{
|
||||
if (layer.m_type == Layer::PublicTransport &&
|
||||
if (layer.m_type == Layer::Type::PublicTransport &&
|
||||
layer.m_lastTimeUsed.time_since_epoch().count() != 0)
|
||||
{
|
||||
return false;
|
||||
|
|
|
@ -110,7 +110,7 @@ struct Discovery
|
|||
|
||||
struct Layer
|
||||
{
|
||||
enum Type
|
||||
enum class Type : uint8_t
|
||||
{
|
||||
TrafficJams,
|
||||
PublicTransport
|
||||
|
@ -135,7 +135,7 @@ struct Tip
|
|||
BookmarksCatalog,
|
||||
BookingHotels,
|
||||
DiscoverButton,
|
||||
MapsLayers,
|
||||
PublicTransport,
|
||||
|
||||
Count
|
||||
};
|
||||
|
@ -181,7 +181,7 @@ inline std::string DebugPrint(Tip::Type const & type)
|
|||
case Tip::Type::BookmarksCatalog: return "BookmarksCatalog";
|
||||
case Tip::Type::BookingHotels: return "BookingHotels";
|
||||
case Tip::Type::DiscoverButton: return "DiscoverButton";
|
||||
case Tip::Type::MapsLayers: return "MapsLayers";
|
||||
case Tip::Type::PublicTransport: return "PublicTransport";
|
||||
case Tip::Type::Count: return "Count";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -118,7 +118,7 @@ UNIT_CLASS_TEST(ScopedEyeForTesting, AppendTipTest)
|
|||
|
||||
Time prevShowTime;
|
||||
{
|
||||
EyeForTesting::AppendTip(Tip::Type::MapsLayers, Tip::Event::ActionClicked);
|
||||
EyeForTesting::AppendTip(Tip::Type::PublicTransport, Tip::Event::ActionClicked);
|
||||
|
||||
auto const info = Eye::Instance().GetInfo();
|
||||
auto const & tips = info->m_tips;
|
||||
|
@ -126,7 +126,7 @@ UNIT_CLASS_TEST(ScopedEyeForTesting, AppendTipTest)
|
|||
|
||||
TEST_EQUAL(tips.size(), 2, ());
|
||||
TEST_NOT_EQUAL(tips[1].m_lastShownTime.time_since_epoch().count(), 0, ());
|
||||
TEST_EQUAL(tips[1].m_type, Tip::Type::MapsLayers, ());
|
||||
TEST_EQUAL(tips[1].m_type, Tip::Type::PublicTransport, ());
|
||||
TEST_EQUAL(tips[1].m_eventCounters.Get(Tip::Event::GotitClicked), 0, ());
|
||||
TEST_EQUAL(tips[1].m_eventCounters.Get(Tip::Event::ActionClicked), 1, ());
|
||||
TEST_NOT_EQUAL(lastShownTipTime.time_since_epoch().count(), 0, ());
|
||||
|
@ -135,7 +135,7 @@ UNIT_CLASS_TEST(ScopedEyeForTesting, AppendTipTest)
|
|||
prevShowTime = lastShownTipTime;
|
||||
}
|
||||
{
|
||||
EyeForTesting::AppendTip(Tip::Type::MapsLayers, Tip::Event::GotitClicked);
|
||||
EyeForTesting::AppendTip(Tip::Type::PublicTransport, Tip::Event::GotitClicked);
|
||||
|
||||
auto const info = Eye::Instance().GetInfo();
|
||||
auto const & tips = info->m_tips;
|
||||
|
@ -143,7 +143,7 @@ UNIT_CLASS_TEST(ScopedEyeForTesting, AppendTipTest)
|
|||
|
||||
TEST_EQUAL(tips.size(), 2, ());
|
||||
TEST_NOT_EQUAL(tips[1].m_lastShownTime.time_since_epoch().count(), 0, ());
|
||||
TEST_EQUAL(tips[1].m_type, Tip::Type::MapsLayers, ());
|
||||
TEST_EQUAL(tips[1].m_type, Tip::Type::PublicTransport, ());
|
||||
TEST_EQUAL(tips[1].m_eventCounters.Get(Tip::Event::GotitClicked), 1, ());
|
||||
TEST_EQUAL(tips[1].m_eventCounters.Get(Tip::Event::ActionClicked), 1, ());
|
||||
TEST_NOT_EQUAL(lastShownTipTime.time_since_epoch().count(), 0, ());
|
||||
|
|
Loading…
Add table
Reference in a new issue