Code review comment for lp://qastaging/~azzar1/unity/fix-778499

Revision history for this message
Andrea Azzarone (azzar1) wrote :

> Unity code looks good to me.
>
> The test needs some tuning:
>
> 111 + desktop_file = self.KNOWN_APPS['Calculator']['desktop-file']
> 112 + if self.launcher.model.get_icon_by_desktop_id(desktop_file)
> != None:
> 113 + self.skip("Calculator icon is already on the launcher.")
> 114 +
> 115 + self.start_app('Calculator')
> 116 + icon =
> self.launcher.model.get_icon_by_desktop_id(desktop_file)
> 117 + self.assertThat(icon.shortcut, GreaterThan(0))
>
> Instead of skipping the test when the calculator is already opened, just close
> it and you can just do:
>
> self.close_all_app('Calculator')
> calc = self.start_app('Calculator')
> icon = self.launcher.model.get_icon_by_desktop_id(calc.desktop_file)
> self.assertThat(icon.shortcut, Eventually(GreaterThan(0)))
>
> (using eventually to avoid false-negatives)

If the Calculator is pinned, closing it will not remove the icon from the launcher.

« Back to merge proposal