on xenial help sign in
Add another test
4eee1a2Daniel d'Andrada
qml/Stages/DesktopStage.qml+1
@@ -131,6 +131,7 @@ FocusScope {
131
131
132 DecoratedWindow {
132 DecoratedWindow {
133 id: decoratedWindow
133 id: decoratedWindow
134+ objectName: "decoratedWindow_" + appId
134 anchors.fill: parent
135 anchors.fill: parent
135 application: ApplicationManager.get(index)
136 application: ApplicationManager.get(index)
136 active: ApplicationManager.focusedApplicationId === model.appId
137 active: ApplicationManager.focusedApplicationId === model.appId
qml/Stages/WindowDecoration.qml+1
@@ -55,6 +55,7 @@ Item {
55
55
56 Label {
56 Label {
57 id: titleLabel
57 id: titleLabel
58+ objectName: "windowDecorationTitle"
58 color: "#DFDBD2"
59 color: "#DFDBD2"
59 height: parent.height
60 height: parent.height
60 verticalAlignment: Text.AlignVCenter
61 verticalAlignment: Text.AlignVCenter
tests/qmltests/Stages/tst_DesktopStage.qml+23
@@ -170,5 +170,28 @@ Rectangle {
170 tap(webbrowserWindow);
170 tap(webbrowserWindow);
171 compare(webbrowserWindow.application.session.surface.activeFocus, true);
171 compare(webbrowserWindow.application.session.surface.activeFocus, true);
172 }
172 }
173+
174+ function test_tappingOnWindowTitleChangesFocusedApp() {
175+ webbrowserCheckBox.checked = true;
176+ waitUntilAppSurfaceShowsUp(webbrowserCheckBox.appId);
177+
178+ var webbrowserWindow = findChild(desktopStage, "decoratedWindow_" + webbrowserCheckBox.appId);
179+ verify(webbrowserWindow);
180+ var webbrowserWindowTitle = findChild(webbrowserWindow, "windowDecorationTitle");
181+ verify(webbrowserWindowTitle);
182+ var dashWindow = findChild(desktopStage, "decoratedWindow_unity8-dash");
183+ verify(dashWindow);
184+ var dashWindowTitle = findChild(dashWindow, "windowDecorationTitle");
185+ verify(dashWindowTitle);
186+
187+ // some sanity check
188+ compare(rectsOverlap(dashWindow, webbrowserWindow), false);
189+
190+ tap(dashWindowTitle);
191+ compare(dashWindow.application.session.surface.activeFocus, true);
192+
193+ tap(webbrowserWindowTitle);
194+ compare(webbrowserWindow.application.session.surface.activeFocus, true);
195+ }
173 }
196 }
174}
197}