summaryrefslogtreecommitdiff
diff options
-rw-r--r--launcher/SwitcherView.cpp2
-rw-r--r--tests/autopilot/unity/tests/test_switcher.py36
-rw-r--r--unity-shared/LayoutSystem.cpp6
-rw-r--r--unity-shared/LayoutSystem.h2
4 files changed, 41 insertions, 5 deletions
diff --git a/launcher/SwitcherView.cpp b/launcher/SwitcherView.cpp
index 708672ffe..ec6fd4a5b 100644
--- a/launcher/SwitcherView.cpp
+++ b/launcher/SwitcherView.cpp
@@ -122,7 +122,7 @@ debug::Introspectable::IntrospectableList SwitcherView::GetIntrospectableChildre
for (auto target : render_targets_)
{
// FIXME When a LayoutWindow is introspectable, it no longer renders :(
- //introspection_results_.push_back(target.get());
+ introspection_results_.push_back(target.get());
}
}
else if (!last_args_.empty())
diff --git a/tests/autopilot/unity/tests/test_switcher.py b/tests/autopilot/unity/tests/test_switcher.py
index 29e86a159..119344b39 100644
--- a/tests/autopilot/unity/tests/test_switcher.py
+++ b/tests/autopilot/unity/tests/test_switcher.py
@@ -569,13 +569,45 @@ class SwitcherDetailsMouseTests(SwitcherTestCase):
self.assertProperty(char_win1, is_focused=True)
def test_mouse_highlights_switcher_deatil_icons_motion(self):
- """ """
+ """
+ Gather the cords of all the detail icons, move the mouse through each
+ asserting the index of each icon we move through.
+ """
self.start_applications("Character Map", "Character Map", "Character Map")
self.unity.switcher.initiate(SwitcherMode.DETAIL)
self.addCleanup(self.unity.switcher.terminate)
- print self.unity.switcher.view.detail_icons
+ offset = self.unity.switcher.view.spread_offset
+ cords = []
+
+ for icon in self.unity.switcher.view.detail_icons:
+ cords.append((icon.x + offset, icon.y + offset))
+
+ index = 0;
+ for cord in cords:
+ self.mouse.move(cord[0], cord[1])
+ self.assertThat(index, Equals(self.unity.switcher.detail_selection_index))
+ index += 1
+ def test_mouse_click_will_activate_detail_icon(self):
+ """
+ Start 2 application of the same type, then click on index 0 in detail mode. This
+ will cause the focus from char_win2 to move to char_win1, showing clicking wokrs.
+ """
+ char_win1, char_win2 = self.start_applications("Character Map", "Character Map")
+ self.assertVisibleWindowStack([char_win2, char_win1])
+
+ self.unity.switcher.initiate(SwitcherMode.DETAIL)
+ self.addCleanup(self.unity.switcher.terminate)
+
+ offset = self.unity.switcher.view.spread_offset
+ x = self.unity.switcher.view.detail_icons[0].x + offset
+ y = self.unity.switcher.view.detail_icons[0].y + offset
+
+ self.mouse.move(x,y)
+ self.mouse.click()
+
+ self.assertProperty(char_win1, is_focused=True)
diff --git a/unity-shared/LayoutSystem.cpp b/unity-shared/LayoutSystem.cpp
index 7a15984bb..2dd8dd035 100644
--- a/unity-shared/LayoutSystem.cpp
+++ b/unity-shared/LayoutSystem.cpp
@@ -19,6 +19,8 @@
#include "LayoutSystem.h"
+#include <UnityCore/Variant.h>
+
namespace unity {
namespace ui {
@@ -293,11 +295,13 @@ LayoutWindow::LayoutWindow(Window xid)
// Introspectable methods
std::string LayoutWindow::GetName() const
{
- return "LayoutSystem";
+ return "LayoutWindow";
}
void LayoutWindow::AddProperties(GVariantBuilder* builder)
{
+ unity::variant::BuilderWrapper(builder)
+ .add(result);
}
}
diff --git a/unity-shared/LayoutSystem.h b/unity-shared/LayoutSystem.h
index c10ba77d9..175074c55 100644
--- a/unity-shared/LayoutSystem.h
+++ b/unity-shared/LayoutSystem.h
@@ -30,7 +30,7 @@
namespace unity {
namespace ui {
-class LayoutWindow //: public debug::Introspectable//: public ui::UnityWindowView
+class LayoutWindow : public debug::Introspectable
{
public:
typedef std::shared_ptr<LayoutWindow> Ptr;