@@ -73,6 +73,32 @@ Row {
80+ function invokeAction(actionId) {
81+ mockNotificationsModel.actionInvoked(actionId)
87+ id: mockNotificationsModel
89+ signal actionInvoked(string actionId)
91+ function getRaw(id) {
92+ return mockNotification.createObject(mockNotificationsModel)
96+ if(actionId == "ok_id") {
97+ mockNotificationsModel.clear()
76 Rectangle {
102 Rectangle {
77 color: "white"
103 color: "white"
78 width: units.gu(30)
104 width: units.gu(30)
@@ -115,6 +141,12 @@ Row {
115 signalName: "unlockingAllModems"
141 signalName: "unlockingAllModems"
145+ id: notificationActionSpy
146+ target: mockNotificationsModel
147+ signalName: "actionInvoked"
118 Telephony.CallEntry {
150 Telephony.CallEntry {
119 id: phoneCall
151 id: phoneCall
120 phoneNumber: "+447812221111"
152 phoneNumber: "+447812221111"
@@ -169,37 +201,10 @@ Row {
169 compare(ApplicationManager.count, 1)
201 compare(ApplicationManager.count, 1)
173− id: mockNotification
176− function invokeAction(actionId) {
177− mockNotificationsModel.actionInvoked(actionId)
183− id: mockNotificationsModel
185− signal actionInvoked(string actionId)
187− function getRaw(id) {
188− return mockNotification.createObject(mockNotificationsModel)
193− id: notificationActionSpy
195− target: mockNotificationsModel
196− signalName: "actionInvoked"
199 function test_snapDecisionDismissalReturnsFocus() {
204 function test_snapDecisionDismissalReturnsFocus() {
200 var notifications = findChild(shell, "notificationList");
205 var notifications = findChild(shell, "notificationList");
201 var app = ApplicationManager.startApplication("camera-app");
206 var app = ApplicationManager.startApplication("camera-app");
202−
207+ var stage = findChild(shell, "stage")
203 // Open an application and focus
208 // Open an application and focus
204 waitUntilApplicationWindowIsFullyVisible(app);
209 waitUntilApplicationWindowIsFullyVisible(app);
205 ApplicationManager.focusApplication(app);
210 ApplicationManager.focusApplication(app);
@@ -218,14 +223,24 @@ Row {
218 var buttonAccept = findChild(buttonRow, "notify_button0");
223 var buttonAccept = findChild(buttonRow, "notify_button0");
219 verify(buttonAccept !== undefined, "notification accept button wasn't found");
224 verify(buttonAccept !== undefined, "notification accept button wasn't found");
226+ var buttonCancel = findChild(buttonRow, "notify_button1");
227+ verify(buttonCancel !== undefined, "notification cancel button wasn't found");
221 // Pressing the button should give focus to the notification
230 // Pressing the button should give focus to the notification
231+ // The cancel button is pressed, as pressing Ok would cause
232+ // the notification to close. This is only due to the mock object
222− mousePress(buttonAccept, 0, 0);
233+ mousePress(buttonCancel, 0, 0);
234+ stage.interactive = false;
223 compare(app.session.surface.activeFocus, false, "Notification didn't take active focus");
235 compare(app.session.surface.activeFocus, false, "Notification didn't take active focus");
224− mouseRelease(buttonAccept);
236+ mouseRelease(buttonCancel);
237+ compare(stage.interactive, false, "the stage is interactive with a notification showing")
226 // Clicking the button should dismiss the notification and return focus
239 // Clicking the button should dismiss the notification and return focus
227− mouseClick(buttonAccept, buttonAccept.width / 2, buttonAccept.height / 2);
240+ mouseClick(buttonAccept, 0, 0);
241+ ApplicationManager.focusApplication(app);
242+ stage.interactive = true;
228− //compare(app.session.surface.activeFocus, true, "App didn't take active focus after snap notification was dismissed");
243+ compare(app.session.surface.activeFocus, true, "App didn't take active focus after snap notification was dismissed");
231 function addSnapDecisionNotification() {
246 function addSnapDecisionNotification() {
@@ -256,7 +271,7 @@ Row {
259− /*function test_leftEdgeDrag(data) {
274+ function test_leftEdgeDrag(data) {
260 dragLauncherIntoView();
275 dragLauncherIntoView();
261 tapOnAppIconInLauncher();
276 tapOnAppIconInLauncher();
262 waitUntilApplicationWindowIsFullyVisible();
277 waitUntilApplicationWindowIsFullyVisible();
@@ -280,9 +295,9 @@ Row {
280 // Make sure the helper for sliding out the launcher wasn't touched. We want to fade it out here.
295 // Make sure the helper for sliding out the launcher wasn't touched. We want to fade it out here.
281 var animateTimer = findInvisibleChild(shell, "animateTimer");
296 var animateTimer = findInvisibleChild(shell, "animateTimer");
282 compare(animateTimer.nextState, "visible");
297 compare(animateTimer.nextState, "visible");
285− /*function test_suspend() {
300+ function test_suspend() {
286 var greeter = findChild(shell, "greeter");
301 var greeter = findChild(shell, "greeter");
288 // Launch an app from the launcher
303 // Launch an app from the launcher
@@ -319,7 +334,7 @@ Row {
319 tryCompare(ApplicationManager, "suspended", false);
334 tryCompare(ApplicationManager, "suspended", false);
320 compare(mainApp.state, ApplicationInfoInterface.Running);
335 compare(mainApp.state, ApplicationInfoInterface.Running);
321 tryCompare(ApplicationManager, "focusedApplicationId", mainAppId);
336 tryCompare(ApplicationManager, "focusedApplicationId", mainAppId);
324 function swipeAwayGreeter() {
339 function swipeAwayGreeter() {
325 var greeter = findChild(shell, "greeter");
340 var greeter = findChild(shell, "greeter");
@@ -345,7 +360,7 @@ Row {
345 - perform long left edge swipe to go minimize the app and go back to the dash.
360 - perform long left edge swipe to go minimize the app and go back to the dash.
346 - verify the setCurrentScope() D-Bus call to the dash has been called for the correct scope id.
361 - verify the setCurrentScope() D-Bus call to the dash has been called for the correct scope id.
348− /*function test_minimizingAppTakesToDashApps() {
363+ function test_minimizingAppTakesToDashApps() {
349 dragLauncherIntoView();
364 dragLauncherIntoView();
351 // Launch an app from the launcher
366 // Launch an app from the launcher
@@ -363,9 +378,9 @@ Row {
364 compare(dashCommunicatorSpy.count, 1);
379 compare(dashCommunicatorSpy.count, 1);
365 compare(dashCommunicatorSpy.signalArguments[0][0], "clickscope");
380 compare(dashCommunicatorSpy.signalArguments[0][0], "clickscope");
368− /*function test_showInputMethod() {
383+ function test_showInputMethod() {
369 var item = findChild(shell, "inputMethod");
384 var item = findChild(shell, "inputMethod");
370 var surface = SurfaceManager.inputMethodSurface();
385 var surface = SurfaceManager.inputMethodSurface();
@@ -383,7 +398,7 @@ Row {
384 surface.setState(MirSurfaceItem.Minimized);
399 surface.setState(MirSurfaceItem.Minimized);
385 tryCompare(item, "visible", false);
400 tryCompare(item, "visible", false);
388 // wait until any transition animation has finished
403 // wait until any transition animation has finished
389 function waitUntilTransitionsEnd(stateGroup) {
404 function waitUntilTransitionsEnd(stateGroup) {
@@ -524,7 +539,7 @@ Row {
524 && itemRectInShell.y + itemRectInShell.height <= shell.height;
539 && itemRectInShell.y + itemRectInShell.height <= shell.height;
527− /*function test_focusRequestedHidesGreeter() {
542+ function test_focusRequestedHidesGreeter() {
528 var greeter = findChild(shell, "greeter");
543 var greeter = findChild(shell, "greeter");
530 var app = ApplicationManager.startApplication("dialer-app");
545 var app = ApplicationManager.startApplication("dialer-app");
@@ -543,9 +558,9 @@ Row {
543 ApplicationManager.requestFocusApplication("dialer-app");
558 ApplicationManager.requestFocusApplication("dialer-app");
544 tryCompare(greeter, "showProgress", 0);
559 tryCompare(greeter, "showProgress", 0);
545 waitForRendering(greeter);
560 waitForRendering(greeter);
548− /*function test_focusRequestedHidesIndicators() {
563+ function test_focusRequestedHidesIndicators() {
549 var indicators = findChild(shell, "indicators");
564 var indicators = findChild(shell, "indicators");
551 showIndicators();
566 showIndicators();
@@ -555,9 +570,9 @@ Row {
555 tryCompare(ApplicationManager, "count", oldCount + 1);
570 tryCompare(ApplicationManager, "count", oldCount + 1);
557 tryCompare(indicators, "fullyClosed", true);
572 tryCompare(indicators, "fullyClosed", true);
560− /*function test_showAndHideGreeterDBusCalls() {
575+ function test_showAndHideGreeterDBusCalls() {
561 var greeter = findChild(shell, "greeter")
576 var greeter = findChild(shell, "greeter")
562 tryCompare(greeter, "showProgress", 0)
577 tryCompare(greeter, "showProgress", 0)
563 waitForRendering(greeter);
578 waitForRendering(greeter);
@@ -565,9 +580,9 @@ Row {
565 tryCompare(greeter, "showProgress", 1)
580 tryCompare(greeter, "showProgress", 1)
566 LightDM.Greeter.hideGreeter()
581 LightDM.Greeter.hideGreeter()
567 tryCompare(greeter, "showProgress", 0)
582 tryCompare(greeter, "showProgress", 0)
570− /*function test_login() {
585+ function test_login() {
571 sessionSpy.clear()
586 sessionSpy.clear()
573 var greeter = findChild(shell, "greeter")
588 var greeter = findChild(shell, "greeter")
@@ -578,9 +593,9 @@ Row {
578 tryCompare(sessionSpy, "count", 0)
593 tryCompare(sessionSpy, "count", 0)
579 swipeAwayGreeter()
594 swipeAwayGreeter()
580 tryCompare(sessionSpy, "count", 1)
595 tryCompare(sessionSpy, "count", 1)
583− /*function test_fullscreen() {
598+ function test_fullscreen() {
584 var panel = findChild(shell, "panel");
599 var panel = findChild(shell, "panel");
585 compare(panel.fullscreenMode, false);
600 compare(panel.fullscreenMode, false);
586 ApplicationManager.startApplication("camera-app");
601 ApplicationManager.startApplication("camera-app");
@@ -591,9 +606,9 @@ Row {
591 tryCompare(panel, "fullscreenMode", true);
606 tryCompare(panel, "fullscreenMode", true);
592 ApplicationManager.requestFocusApplication("dialer-app");
607 ApplicationManager.requestFocusApplication("dialer-app");
593 tryCompare(panel, "fullscreenMode", false);
608 tryCompare(panel, "fullscreenMode", false);
596− /*function test_leftEdgeDragFullscreen() {
611+ function test_leftEdgeDragFullscreen() {
597 var panel = findChild(shell, "panel");
612 var panel = findChild(shell, "panel");
598 tryCompare(panel, "fullscreenMode", false)
613 tryCompare(panel, "fullscreenMode", false)
@@ -612,9 +627,9 @@ Row {
612 tryCompare(panel, "fullscreenMode", false);
627 tryCompare(panel, "fullscreenMode", false);
614 touchRelease(shell);
629 touchRelease(shell);
617− /*function test_unlockedProperties() {
632+ function test_unlockedProperties() {
618 // Confirm that various properties have the correct values when unlocked
633 // Confirm that various properties have the correct values when unlocked
619 tryCompare(shell, "locked", false)
634 tryCompare(shell, "locked", false)
@@ -623,22 +638,22 @@ Row {
624 var indicators = findChild(shell, "indicators")
639 var indicators = findChild(shell, "indicators")
625 tryCompare(indicators, "available", true)
640 tryCompare(indicators, "available", true)
628− /*function test_unlockAllModemsOnBoot() {
643+ function test_unlockAllModemsOnBoot() {
629 // TODO reenable when service ready (LP: #1361074)
644 // TODO reenable when service ready (LP: #1361074)
630 expectFail("", "Unlock on boot temporarily disabled");
645 expectFail("", "Unlock on boot temporarily disabled");
631 tryCompare(unlockAllModemsSpy, "count", 1)
646 tryCompare(unlockAllModemsSpy, "count", 1)
634− /*function test_leftEdgeDragOnGreeter_data() {
649+ function test_leftEdgeDragOnGreeter_data() {
636 {tag: "short swipe", targetX: shell.width / 3, unlocked: false},
651 {tag: "short swipe", targetX: shell.width / 3, unlocked: false},
637 {tag: "long swipe", targetX: shell.width / 3 * 2, unlocked: true}
652 {tag: "long swipe", targetX: shell.width / 3 * 2, unlocked: true}
641− /*function test_leftEdgeDragOnGreeter(data) {
656+ function test_leftEdgeDragOnGreeter(data) {
642 var greeter = findChild(shell, "greeter");
657 var greeter = findChild(shell, "greeter");
643 greeter.show();
658 greeter.show();
644 tryCompare(greeter, "showProgress", 1);
659 tryCompare(greeter, "showProgress", 1);
@@ -648,6 +663,6 @@ Row {
648 touchFlick(shell, touchStartX, touchStartY, data.targetX, touchStartY);
663 touchFlick(shell, touchStartX, touchStartY, data.targetX, touchStartY);
650 tryCompare(greeter, "showProgress", data.unlocked ? 0 : 1);
665 tryCompare(greeter, "showProgress", data.unlocked ? 0 : 1);