diff options
| author | Brandon Schaefer <brandontschaefer@gmail.com> | 2012-06-25 09:32:30 -0700 |
|---|---|---|
| committer | Brandon Schaefer <brandontschaefer@gmail.com> | 2012-06-25 09:32:30 -0700 |
| commit | 5514599819f5ed20b7235669c040f76cffda5fe8 (patch) | |
| tree | a19fc00c6c5085da68e97c686ec88ca8101bff52 | |
| parent | 16e9bfcdcc0a6b99e6aaa468eecbdb505271fc2b (diff) | |
* Copy the entire content_geo now
* Fixed the ap test (bzr r2438.4.1)
| -rw-r--r-- | hud/HudView.cpp | 3 | ||||
| -rw-r--r-- | tests/autopilot/unity/tests/test_hud.py | 14 |
2 files changed, 11 insertions, 6 deletions
diff --git a/hud/HudView.cpp b/hud/HudView.cpp index 0a30442cc..b8dcbfc3d 100644 --- a/hud/HudView.cpp +++ b/hud/HudView.cpp @@ -417,7 +417,8 @@ void View::OnKeyDown (unsigned long event_type, unsigned long keysym, void View::OnMouseButtonDown(int x, int y, unsigned long button, unsigned long key) { - nux::Geometry current_geo(0, 0, content_geo_.width, current_height_); + nux::Geometry current_geo(content_geo_); + current_geo.height = current_height_; if (!current_geo.IsPointInside(x, y)) { ubus.SendMessage(UBUS_HUD_CLOSE_REQUEST); diff --git a/tests/autopilot/unity/tests/test_hud.py b/tests/autopilot/unity/tests/test_hud.py index ecfcee438..e783453c0 100644 --- a/tests/autopilot/unity/tests/test_hud.py +++ b/tests/autopilot/unity/tests/test_hud.py @@ -245,23 +245,27 @@ class HudBehaviorTests(HudTestsBase): self.assertThat(self.hud.visible, Eventually(Equals(False))) def test_hud_closes_click_outside_geo_shrunk(self): - """When the hud is shrunk clicking outside of its geo should close it.""" + """ + Clicking outside the hud when it is shurnk will make it close. + Shurnk is when the hud has no results and is much smaller then normal. + """ self.hud.ensure_visible() - geo = self.hud.view.geometry - self.mouse.move(geo[2]/2, geo[3]-50,True,100,0.01) + (x,y,w,h) = self.hud.view.geometry + self.mouse.move(w/2, h-50,True) self.mouse.click() self.assertThat(self.hud.visible, Eventually(Equals(False))) def test_hud_closes_click_outside_geo(self): - """Clicking outside of its geo should close it.""" + """Clicking outside of the hud will make close it.""" self.hud.ensure_visible() self.keyboard.type("Test") geo = self.hud.view.geometry - self.mouse.move(geo[2]/2, geo[3]+50,True,100,0.01) + (x,y,w,h) = self.hud.view.geometry + self.mouse.move(w/2, h+50,True) self.mouse.click() self.assertThat(self.hud.visible, Eventually(Equals(False))) |
