@@ -1,5 +1,5 @@
2− * Copyright 2014 Canonical Ltd.
2+ * Copyright 2014-2015 Canonical Ltd.
4 * This program is free software; you can redistribute it and/or modify
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
5 * it under the terms of the GNU General Public License as published by
@@ -16,7 +16,7 @@
17import QtQuick 2.0
17import QtQuick 2.0
18import QtTest 1.0
18import QtTest 1.0
19−import Unity.Test 0.1 as UT
19+import Unity.Test 0.1
20import ".."
20import ".."
21import "../../../qml/Stages"
21import "../../../qml/Stages"
22import Ubuntu.Components 0.1
22import Ubuntu.Components 0.1
@@ -32,6 +32,8 @@ Rectangle {
32 id: surfaceContainerComponent
32 id: surfaceContainerComponent
33 SurfaceContainer {
33 SurfaceContainer {
34 anchors.fill: parent
34 anchors.fill: parent
35+ orientation: Qt.PortraitOrientation
36+ interactive: interactiveCheckbox.checked
@@ -85,6 +87,11 @@ Rectangle {
85 CheckBox {id: fullscreenCheckbox; checked: true; }
87 CheckBox {id: fullscreenCheckbox; checked: true; }
86 Label { text: "fullscreen" }
88 Label { text: "fullscreen" }
91+ anchors { left: parent.left; right: parent.right }
92+ CheckBox {id: interactiveCheckbox; checked: true; }
93+ Label { text: "interactive" }
@@ -94,7 +101,7 @@ Rectangle {
94 signalName: "surfaceDestroyed"
101 signalName: "surfaceDestroyed"
97− UT.UnityTestCase {
104+ UnityTestCase {
98 id: testCase
105 id: testCase
99 name: "SurfaceContainer"
106 name: "SurfaceContainer"
100 when: windowShown
107 when: windowShown
@@ -110,6 +117,8 @@ Rectangle {
111 tryCompare(surfaceContainerLoader.item, "surface", null);
118 tryCompare(surfaceContainerLoader.item, "surface", null);
112 surfaceSpy.clear();
119 surfaceSpy.clear();
121+ interactiveCheckbox.checked = true;
@@ -145,14 +154,13 @@ Rectangle {
145 surfaceContainer.surface.touchPressCount = 0;
154 surfaceContainer.surface.touchPressCount = 0;
146 surfaceContainer.surface.touchReleaseCount = 0;
155 surfaceContainer.surface.touchReleaseCount = 0;
148− surfaceContainer.interactive = true;
149 tap(surfaceContainer, surfaceContainer.width / 2, surfaceContainer.height / 2);
157 tap(surfaceContainer, surfaceContainer.width / 2, surfaceContainer.height / 2);
151 // surface got touches as the surfaceContainer is interactive
159 // surface got touches as the surfaceContainer is interactive
152 compare(surfaceContainer.surface.touchPressCount, 1)
160 compare(surfaceContainer.surface.touchPressCount, 1)
153 compare(surfaceContainer.surface.touchReleaseCount, 1);
161 compare(surfaceContainer.surface.touchReleaseCount, 1);
155− surfaceContainer.interactive = false;
163+ interactiveCheckbox.checked = false;
156 tap(surfaceContainer, surfaceContainer.width / 2, surfaceContainer.height / 2);
164 tap(surfaceContainer, surfaceContainer.width / 2, surfaceContainer.height / 2);
158 // surface shouldn't get the touches from the second tap as the surfaceContainer
166 // surface shouldn't get the touches from the second tap as the surfaceContainer