@@ -31,6 +31,7 @@ Item {
31 anchors { fill: parent; rightMargin: units.gu(30) }
31 anchors { fill: parent; rightMargin: units.gu(30) }
32 dragAreaWidth: units.gu(2)
32 dragAreaWidth: units.gu(2)
33 maximizedAppTopMargin: units.gu(3) + units.dp(2)
33 maximizedAppTopMargin: units.gu(3) + units.dp(2)
@@ -67,6 +68,21 @@ Item {
67 ApplicationManager.get(appList.selectedAppIndex).setState(ApplicationInfo.Stopped);
68 ApplicationManager.get(appList.selectedAppIndex).setState(ApplicationInfo.Stopped);
72+ anchors { left: parent.left; right: parent.right }
73+ text: "Rotate device \u27F2"
75+ if (phoneStage.orientation == Qt.PortraitOrientation) {
76+ phoneStage.orientation = Qt.LandscapeOrientation;
77+ } else if (phoneStage.orientation == Qt.LandscapeOrientation) {
78+ phoneStage.orientation = Qt.InvertedPortraitOrientation;
79+ } else if (phoneStage.orientation == Qt.InvertedPortraitOrientation) {
80+ phoneStage.orientation = Qt.InvertedLandscapeOrientation;
82+ phoneStage.orientation = Qt.PortraitOrientation;
71 ListView {
87 ListView {
72 id: appList
88 id: appList
@@ -256,6 +272,46 @@ Item {
256 compare(ApplicationManager.focusedApplicationId, selectedApp.appId);
272 compare(ApplicationManager.focusedApplicationId, selectedApp.appId);
275+ function test_orientation_change_sent_to_focused_app() {
276+ phoneStage.orientation = Qt.PortraitOrientation;
279+ var spreadView = findChild(phoneStage, "spreadView");
280+ var app = findChild(spreadView, "appDelegate0");
281+ tryCompare(app, "orientation", Qt.PortraitOrientation);
283+ phoneStage.orientation = Qt.LandscapeOrientation;
284+ tryCompare(app, "orientation", Qt.LandscapeOrientation);
287+ function test_orientation_change_not_sent_to_apps_while_spread_open() {
288+ phoneStage.orientation = Qt.PortraitOrientation;
291+ var spreadView = findChild(phoneStage, "spreadView");
292+ var app = findChild(spreadView, "appDelegate0");
293+ tryCompare(app, "orientation", Qt.PortraitOrientation);
296+ phoneStage.orientation = Qt.LandscapeOrientation;
297+ tryCompare(app, "orientation", Qt.PortraitOrientation);
300+ function test_orientation_change_not_sent_to_unfocused_app_until_it_focused() {
301+ phoneStage.orientation = Qt.PortraitOrientation;
304+ var spreadView = findChild(phoneStage, "spreadView");
305+ var app = findChild(spreadView, "appDelegate0");
308+ phoneStage.orientation = Qt.LandscapeOrientation;
309+ tryCompare(app, "orientation", Qt.PortraitOrientation);
311+ phoneStage.select(app.application.appId);
312+ tryCompare(app, "orientation", Qt.LandscapeOrientation);
259 function cleanup() {
315 function cleanup() {
260 while (ApplicationManager.count > 1) {
316 while (ApplicationManager.count > 1) {
261 var oldCount = ApplicationManager.count;
317 var oldCount = ApplicationManager.count;
@@ -263,6 +319,7 @@ Item {
263 ApplicationManager.stopApplication(ApplicationManager.get(closingIndex).appId)
319 ApplicationManager.stopApplication(ApplicationManager.get(closingIndex).appId)
264 tryCompare(ApplicationManager, "count", oldCount - 1)
320 tryCompare(ApplicationManager, "count", oldCount - 1)
322+ phoneStage.orientation = Qt.PortraitOrientation;