if (layout_manager && layout_manager->is_animating()) {
views::test::WaitForAnimatingLayoutManager(layout_manager);
}This is to ensure no animations are running before the test actually starts 👍
SidePanelUI* const side_panel_ui =
browser()->browser_window_features()->side_panel_ui();
side_panel_ui->SetNoDelaysForTesting(true);This is to help reduce test timeouts (I was experiencing this quite a bit locally).
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
if (side_panel_trigger >=
static_cast<std::underlying_type_t<SidePanelOpenTrigger>>(
SidePanelOpenTrigger::kMinValue) &&
side_panel_trigger <=
static_cast<std::underlying_type_t<SidePanelOpenTrigger>>(
SidePanelOpenTrigger::kMaxValue)) {
mapped_trigger = SidePanelToReadAnythingOpenTrigger(
static_cast<SidePanelOpenTrigger>(side_panel_trigger));
}why is this extra check needed? shouldn't this always be true?
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
if (side_panel_trigger >=
static_cast<std::underlying_type_t<SidePanelOpenTrigger>>(
SidePanelOpenTrigger::kMinValue) &&
side_panel_trigger <=
static_cast<std::underlying_type_t<SidePanelOpenTrigger>>(
SidePanelOpenTrigger::kMaxValue)) {
mapped_trigger = SidePanelToReadAnythingOpenTrigger(
static_cast<SidePanelOpenTrigger>(side_panel_trigger));
}why is this extra check needed? shouldn't this always be true?
Good point - it shouldn't be needed and now that I look closer maybe the top path is also not needed?
Updating this or at least can be consolidated
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
if (side_panel_trigger >=
static_cast<std::underlying_type_t<SidePanelOpenTrigger>>(
SidePanelOpenTrigger::kMinValue) &&
side_panel_trigger <=
static_cast<std::underlying_type_t<SidePanelOpenTrigger>>(
SidePanelOpenTrigger::kMaxValue)) {
mapped_trigger = SidePanelToReadAnythingOpenTrigger(
static_cast<SidePanelOpenTrigger>(side_panel_trigger));
}Darryl Jameswhy is this extra check needed? shouldn't this always be true?
Good point - it shouldn't be needed and now that I look closer maybe the top path is also not needed?
Updating this or at least can be consolidated
Nice. Can we still return early though if the trigger doesn't map to anything?
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
if (side_panel_trigger >=
static_cast<std::underlying_type_t<SidePanelOpenTrigger>>(
SidePanelOpenTrigger::kMinValue) &&
side_panel_trigger <=
static_cast<std::underlying_type_t<SidePanelOpenTrigger>>(
SidePanelOpenTrigger::kMaxValue)) {
mapped_trigger = SidePanelToReadAnythingOpenTrigger(
static_cast<SidePanelOpenTrigger>(side_panel_trigger));
}Darryl Jameswhy is this extra check needed? shouldn't this always be true?
Kristi SaneyGood point - it shouldn't be needed and now that I look closer maybe the top path is also not needed?
Updating this or at least can be consolidated
Nice. Can we still return early though if the trigger doesn't map to anything?
Yes! Before that I am double checking the implemetation of `SidePanelToReadAnythingOpenTrigger` since it seems to be missing some values?
Not clear if that is intentional yet - need to run the tests locally first 👍
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
if (side_panel_trigger >=
static_cast<std::underlying_type_t<SidePanelOpenTrigger>>(
SidePanelOpenTrigger::kMinValue) &&
side_panel_trigger <=
static_cast<std::underlying_type_t<SidePanelOpenTrigger>>(
SidePanelOpenTrigger::kMaxValue)) {
mapped_trigger = SidePanelToReadAnythingOpenTrigger(
static_cast<SidePanelOpenTrigger>(side_panel_trigger));
}Darryl Jameswhy is this extra check needed? shouldn't this always be true?
Kristi SaneyGood point - it shouldn't be needed and now that I look closer maybe the top path is also not needed?
Updating this or at least can be consolidated
Darryl JamesNice. Can we still return early though if the trigger doesn't map to anything?
Yes! Before that I am double checking the implemetation of `SidePanelToReadAnythingOpenTrigger` since it seems to be missing some values?
Not clear if that is intentional yet - need to run the tests locally first 👍
Okay so I think as part of a separate CL we can update the logic in the `SidePanelToReadAnythingOpenTrigger` to return unknown for unhandled cases, and remove the std::optional<> return type. This way all of the values in the enum must be handled otherwise we get a compile error.
I'll do that in a followup since that will likely affect other usages of the function, let me know if that is okay / not okay 🙏
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
if (side_panel_trigger >=
static_cast<std::underlying_type_t<SidePanelOpenTrigger>>(
SidePanelOpenTrigger::kMinValue) &&
side_panel_trigger <=
static_cast<std::underlying_type_t<SidePanelOpenTrigger>>(
SidePanelOpenTrigger::kMaxValue)) {
mapped_trigger = SidePanelToReadAnythingOpenTrigger(
static_cast<SidePanelOpenTrigger>(side_panel_trigger));
}Darryl Jameswhy is this extra check needed? shouldn't this always be true?
Kristi SaneyGood point - it shouldn't be needed and now that I look closer maybe the top path is also not needed?
Updating this or at least can be consolidated
Darryl JamesNice. Can we still return early though if the trigger doesn't map to anything?
Darryl JamesYes! Before that I am double checking the implemetation of `SidePanelToReadAnythingOpenTrigger` since it seems to be missing some values?
Not clear if that is intentional yet - need to run the tests locally first 👍
Okay so I think as part of a separate CL we can update the logic in the `SidePanelToReadAnythingOpenTrigger` to return unknown for unhandled cases, and remove the std::optional<> return type. This way all of the values in the enum must be handled otherwise we get a compile error.
I'll do that in a followup since that will likely affect other usages of the function, let me know if that is okay / not okay 🙏
I'll go ahead and spin that up actually just in case, thanks for catching this!
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |