Merge lp:~mandel/unity/no-global-search-previews into lp:unity

Proposed by Manuel de la Peña
Status: Rejected
Rejected by: Brandon Schaefer
Proposed branch: lp:~mandel/unity/no-global-search-previews
Merge into: lp:unity
Diff against target: 38 lines (+16/-1)
2 files modified
dash/DashView.cpp (+1/-1)
tests/autopilot/unity/tests/test_dash.py (+15/-0)
To merge this branch: bzr merge lp:~mandel/unity/no-global-search-previews
Reviewer Review Type Date Requested Status
Brandon Schaefer (community) Approve
Review via email: mp+124452@code.launchpad.net

Commit message

- Check that the previews are not shown when stealing input (LP:1050967).

Description of the change

- Check that the previews are not shown when stealing input (LP:1050967).

To test you can do the following:

Launch dash
Show Music preview
Type like crazy
ESC -> search bar should have no input.

To post a comment you must log in.
Revision history for this message
Brandon Schaefer (brandontschaefer) wrote :

The code looks good but this would be very easy to add a test. Here is what an AP test for this, please add it and Ill re-review it :).

http://paste.ubuntu.com/1205779/

Add it under:
unity/tests/autopilot/unity/tests/test_dash.py

Under the class PreviewInvocationTests(DashTestCase):

review: Needs Fixing
2694. By Manuel de la Peña

Added tests for the new functionality.

2695. By Manuel de la Peña

Merged with trunk.

Revision history for this message
Manuel de la Peña (mandel) wrote :

> The code looks good but this would be very easy to add a test. Here is what an
> AP test for this, please add it and Ill re-review it :).
>
> http://paste.ubuntu.com/1205779/
>
> Add it under:
> unity/tests/autopilot/unity/tests/test_dash.py
>
> Under the class PreviewInvocationTests(DashTestCase):

Thx, I have added the test you suggested, next branch I propose will already have them :)

Revision history for this message
Brandon Schaefer (brandontschaefer) wrote :

No problem, but some a little problem.

The tab spaces for the AP are 4 not 2 ( I should have mentioned that)

The other problem is you have the test under the class DashCrossMonitorsTests, which means it will get skipped if the testing machine doesn't have more then 1 monitor. (So moving the test under the class PreviewInvocationTests(DashTestCase): would fix that problem) :)

review: Needs Fixing
Revision history for this message
Brandon Schaefer (brandontschaefer) wrote :

No problem, but some a little problem.

*No problem, but still a little problem.

2696. By Manuel de la Peña

Place the test in the correct test case.

Revision history for this message
Manuel de la Peña (mandel) wrote :

> No problem, but some a little problem.
>
> The tab spaces for the AP are 4 not 2 ( I should have mentioned that)

All the python code I added is using tabspaces to 4 unless vim is lying (ts=4; expandtab; retab)

>
> The other problem is you have the test under the class DashCrossMonitorsTests,
> which means it will get skipped if the testing machine doesn't have more then
> 1 monitor. (So moving the test under the class
> PreviewInvocationTests(DashTestCase): would fix that problem) :)

I'm stupid, I just appended the test to the last test case.

Revision history for this message
Brandon Schaefer (brandontschaefer) wrote :

Sorry, I must have been blind! Looks good :) +1

review: Approve
Revision history for this message
Brandon Schaefer (brandontschaefer) wrote :

Well this seems to be fixed in trunk now...(Im not sure when that happened...)

Revision history for this message
Manuel de la Peña (mandel) wrote :

I think niel or didier where talking about it and pushed it to trunk (reading the irc backlog). No a problem :)

Unmerged revisions

2696. By Manuel de la Peña

Place the test in the correct test case.

2695. By Manuel de la Peña

Merged with trunk.

2694. By Manuel de la Peña

Added tests for the new functionality.

2693. By Manuel de la Peña

Check that the previews are not displayed when we still the input.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'dash/DashView.cpp'
2--- dash/DashView.cpp 2012-09-17 10:00:38 +0000
3+++ dash/DashView.cpp 2012-09-18 09:11:20 +0000
4@@ -1046,7 +1046,7 @@
5 }
6 }
7
8- if (search_key || search_bar_->im_preedit)
9+ if (!preview_displaying_ && (search_key || search_bar_->im_preedit))
10 {
11 // then send the event to the search entry
12 return search_bar_->text_entry();
13
14=== modified file 'tests/autopilot/unity/tests/test_dash.py'
15--- tests/autopilot/unity/tests/test_dash.py 2012-09-18 01:41:46 +0000
16+++ tests/autopilot/unity/tests/test_dash.py 2012-09-18 09:11:20 +0000
17@@ -726,6 +726,21 @@
18
19 self.assertThat(self.dash.preview_displaying, Eventually(Equals(False)))
20
21+ def test_dash_searchbar_loses_keyfocus_in_preview(self):
22+ """When in preview mode the SearchBar must not have focus."""
23+ lens = self.dash.reveal_file_lens()
24+ self.addCleanup(self.dash.ensure_hidden)
25+
26+ category = lens.get_category_by_name("Folders")
27+ results = category.get_results()
28+ result = results[0]
29+ # result.preview handles finding xy co-ords and right mouse-click
30+ result.preview()
31+ self.assertThat(self.dash.preview_displaying, Eventually(Equals(True)))
32+ self.keyboard.type("NoFocus")
33+ self.keyboard.press_and_release("Escape")
34+ self.assertThat(self.dash.search_string, Equals(""))
35+
36
37 class PreviewNavigateTests(DashTestCase):
38 """Tests that mouse navigation works with previews."""