@@ -78,92 +78,56 @@ Item {
78 return panel.mapFromItem(indicator_item, indicator_item.width/2, indicator_item.height/2);
78 return panel.mapFromItem(indicator_item, indicator_item.width/2, indicator_item.height/2);
81− function test_hint_data() { return get_window_data() }
83 // Pressing on the indicator panel should activate the indicator hints
81 // Pressing on the indicator panel should activate the indicator hints
84 // and expose a portion of the conent.
82 // and expose a portion of the conent.
85− function test_hint(data) {
83+ function test_hint() {
86− panel.fullscreenMode = data.fullscreenFlag;
84+ panel.fullscreenMode = false;
87−
85+ // Wait for the indicators to get into position.
88− var indicator_item_coord = get_indicator_item_position(0);
86+ // (switches between normal and fullscreen modes are animated)
89− var indicator_revealer = findChild(panel, "indicatorRevealer");
87+ tryCompare(panel.indicators, "y", 0)
90− verify(indicator_revealer != undefined)
93− indicator_item_coord.x, panel.panelHeight/2,
94− Qt.LeftButton, Qt.NoModifier , 0);
96− if (!panel.fullscreenMode)
98− compare(indicator_revealer.hintingAnimation.running, true, "Indicator revealer hint animation should be running after mouse press on indicator panel in pinned mode");
99− tryCompare(indicator_revealer.hintingAnimation, "running", false);
100− tryCompare(panel.indicators, "partiallyOpened", true);
104− // nothing should happen
105− compare(indicator_revealer.hintingAnimation.running, false, "Indicator revealer hint animation should not be running after mouse press on indicator panel in fullscreen mode");
106− compare(panel.indicators.partiallyOpened, false, "Indicator should not be partially opened when panel is pressed in fullscreenmode");
107− compare(panel.indicators.fullyOpened, false, "Indicator should not be partially opened when panel is pressed in fullscreenmode");
111− indicator_item_coord.x, panel.panelHeight/2,
112− Qt.LeftButton, Qt.NoModifier , 0);
115− function test_show_click_data() { return get_window_data() }
117− // Clicking the indicator panel should fully open the inidicators
118− function test_show_click(data) {
119− panel.fullscreenMode = data.fullscreenFlag;
121 var indicator_item_coord = get_indicator_item_position(0);
89 var indicator_item_coord = get_indicator_item_position(0);
124− indicator_item_coord.x, panel.panelHeight/2,
91+ touchPress(panel, indicator_item_coord.x, panel.panelHeight / 2)
125− Qt.LeftButton, Qt.NoModifier , 0);
127− if (!panel.fullscreenMode)
93+ // hint animation should be run, meaning that indicators will move downwards
128− {
94+ // by hintValue pixels without any drag taking place
129− compare(panel.indicators.showAnimation.running, true, "Show animation should run after panel is clicked in pinned mode.");
95+ tryCompare(panel.indicators, "height",
96+ panel.indicators.panelHeight + panel.indicators.hintValue);
97+ tryCompare(panel.indicators, "partiallyOpened", true);
130− tryCompare(panel.indicators, "fullyOpened", true);
98+ tryCompare(panel.indicators, "fullyOpened", false);
132− // click will activate device overview.
100+ touchRelease(panel, indicator_item_coord.x, panel.panelHeight/2)
133− compare(findChild(panel.indicators, "indicatorRow").overviewActive, true, "Overview indicator should be avtive when indicators clicked.")
137− compare(panel.indicators.showAnimation.running, false, "Indicators should not open when panel is clicked in pinned mode.");
141− function test_show_press_release_data() { return get_window_data() }
103+ // Pressing on the top edge of the screen should have no effect if the panel
142−
104+ // is hidden (!pinned), which is the case when a fullscreen app is being shown
143− // Pressing and releasing on the indicator panel will fully open the indicators
105+ function test_noHintOnFullscreenMode() {
144− function test_show_press_release(data) {
145− panel.fullscreenMode = data.fullscreenFlag;
106+ panel.fullscreenMode = true;
107+ // Wait for the indicators to get into position.
108+ // (switches between normal and fullscreen modes are animated)
109+ tryCompare(panel.indicators, "y", -panel.panelHeight)
147 var indicator_item_coord = get_indicator_item_position(0);
111 var indicator_item_coord = get_indicator_item_position(0);
150− indicator_item_coord.x, panel.panelHeight/2,
113+ touchPress(panel, indicator_item_coord.x, panel.panelHeight / 2)
151− Qt.LeftButton, Qt.NoModifier , 0);
153− mouseRelease(panel,
115+ // Give some time for a hint animation to change things, if any
154− indicator_item_coord.x, panel.panelHeight/2,
116+ wait(500)
155− Qt.LeftButton, Qt.NoModifier , 0);
157− if (!panel.fullscreenMode)
118+ // no hint animation when fullscreen
158− {
119+ compare(panel.indicators.y, -panel.panelHeight)
159− compare(panel.indicators.showAnimation.running, true, "Show animation should run after panel is clicked in pinned mode.");
120+ var indicatorRow = findChild(panel.indicators, "indicatorRow");
160− tryCompare(panel.indicators, "fullyOpened", true);
121+ verify(indicatorRow != undefined)
161− }
122+ compare(indicatorRow.y, 0)
162− else
123+ compare(panel.indicators.height, panel.indicators.panelHeight)
163− {
124+ compare(panel.indicators.partiallyOpened, false,
164− // nothing should happen.
125+ "Indicator should not be partially opened when panel is pressed in" +
165− compare(panel.indicators.showAnimation.running, false, "Indicators should not open when panel is clicked in pinned mode.");
126+ " fullscreenmode")
166− }
127+ compare(panel.indicators.fullyOpened, false, "Indicator should not be partially" +
128+ " opened when panel is pressed in fullscreenmode")
130+ touchRelease(panel, indicator_item_coord.x, panel.panelHeight/2)
169 function test_drag_show_data() { return get_window_data() }
133 function test_drag_show_data() { return get_window_data() }
@@ -174,9 +138,6 @@ Item {
174 function test_drag_show(data) {
138 function test_drag_show(data) {
175 panel.fullscreenMode = data.fullscreenFlag;
139 panel.fullscreenMode = data.fullscreenFlag;
177− var indicator_revealer = findChild(panel, "indicatorRevealer");
178− verify(indicator_revealer != undefined)
180 var indicator_row = findChild(panel.indicators, "indicatorRow");
141 var indicator_row = findChild(panel.indicators, "indicatorRow");
181 verify(indicator_row != undefined)
142 verify(indicator_row != undefined)
@@ -186,6 +147,14 @@ Item {
186 var menu_content = findChild(panel.indicators, "menuContent");
147 var menu_content = findChild(panel.indicators, "menuContent");
187 verify(indicator_row != undefined)
148 verify(indicator_row != undefined)
150+ // Wait for the indicators to get into position.
151+ // (switches between normal and fullscreen modes are animated)
152+ if (data.fullscreenFlag) {
153+ tryCompare(panel.indicators, "y", -panel.panelHeight)
155+ tryCompare(panel.indicators, "y", 0)
189 // do this for each indicator item
158 // do this for each indicator item
190 for (var i = 0; i < row_repeater.count; i++) {
159 for (var i = 0; i < row_repeater.count; i++) {
@@ -194,40 +163,25 @@ Item {
195 var indicator_item_coord = get_indicator_item_position(i);
164 var indicator_item_coord = get_indicator_item_position(i);
197− // 1) Press on the panel
166+ touchPress(panel,
199− indicator_item_coord.x, panel.panelHeight/2,
167+ indicator_item_coord.x, panel.panelHeight / 2)
200− Qt.LeftButton, Qt.NoModifier , 0);
202− if (!panel.fullscreenMode)
204− // hint animation should be run, and panel will end in partiallyOpened state.
205− compare(indicator_revealer.hintingAnimation.running, true, "Indicator revealer hint animation should be running after mouse press on indicator panel");
206− tryCompare(indicator_revealer.hintingAnimation, "running", false);
207− tryCompare(panel.indicators, "partiallyOpened", true);
210− // 2) Drag the mouse down
211− var old_progress = panel.indicators.progress
213− indicator_item_coord.x, old_progress + (panel.height - old_progress)/2,
216− // progress should increase.
217− var progress_increases = panel.indicators.progress > old_progress;
218− compare(progress_increases, true, "Progress has not increased on dragging indicator.");
220− mouseMove(panel,
169+ // 1) Drag the mouse down
221− indicator_item_coord.x, shell.y + shell.height,
171+ indicator_item_coord.x, panel.panelHeight / 2,
222− 0, Qt.LeftButton);
172+ indicator_item_coord.x, panel.height * 0.8,
173+ false /* beginTouch */, false /* endTouch */)
224− tryCompare(panel.indicators, "fullyOpened", true);
175+ // Indicators height should follow the drag, and therefore increase accordingly.
176+ // They should be at least half-way through the screen
178+ function() {return panel.indicators.height >= panel.height * 0.5},
227− indicator_item_coord.x, indicator_item_coord.y + panel.height/2,
181+ touchRelease(panel, indicator_item_coord.x, panel.height * 0.8)
228− Qt.LeftButton, Qt.NoModifier , 0);
230− compare(indicator_row.currentItem, indicator_item, "Incorrect item activated at position " + i);
183+ compare(indicator_row.currentItem, indicator_item,
184+ "Incorrect item activated at position " + i)
231 compare(menu_content.__shown, true, "Menu conetent should be enabled for item at position " + i);
185 compare(menu_content.__shown, true, "Menu conetent should be enabled for item at position " + i);
233 // init for next indicator_item
187 // init for next indicator_item
@@ -242,11 +196,10 @@ Item {
242 var search_indicator = findChild(panel, "search");
196 var search_indicator = findChild(panel, "search");
243 verify(search_indicator != undefined);
197 verify(search_indicator != undefined);
245− mouseClick(search_indicator,
199+ tap(search_indicator, 1, 1)
247− Qt.LeftButton, Qt.NoModifier , 0);
201+ compare(search_clicked, true,
249− compare(search_clicked, true, "Clicking search indicator while it was enabled did not emit searchClicked signal")
202+ "Tapping search indicator while it was enabled did not emit searchClicked signal")
252 function test_search_click_when_not_visible() {
205 function test_search_click_when_not_visible() {
@@ -256,11 +209,10 @@ Item {
256 var search_indicator = findChild(panel, "search");
209 var search_indicator = findChild(panel, "search");
257 verify(search_indicator != undefined);
210 verify(search_indicator != undefined);
259− mouseClick(search_indicator,
212+ tap(search_indicator, 1, 1)
261− Qt.LeftButton, Qt.NoModifier , 0);
214+ compare(search_clicked, false,
263− compare(search_clicked, false, "Clicking search indicator while it was not visible emitted searchClicked signal")
215+ "Tapping search indicator while it was not visible emitted searchClicked signal")