56
// Copied from Shell.qml
57
property bool tablet: false
58
width: tablet ? units.gu(160)
59
: applicationArguments.hasGeometry() ? applicationArguments.width()
61
height: tablet ? units.gu(100)
62
: applicationArguments.hasGeometry() ? applicationArguments.height()
65
property bool itemDestroyed: false
66
sourceComponent: Component {
68
property string indicatorProfile: "phone"
69
Component.onDestruction: {
70
shellLoader.itemDestroyed = true;
60
property bool itemDestroyed: false
61
sourceComponent: Component {
63
property string indicatorProfile: "phone"
65
Component.onDestruction: {
66
shellLoader.itemDestroyed = true;
79
height: shellLoader.height
82
anchors { left: parent.left; right: parent.right; top: parent.top; margins: units.gu(1) }
85
anchors { left: parent.left; right: parent.right }
89
if (shellLoader.status !== Loader.Ready)
92
var greeter = testCase.findChild(shellLoader.item, "greeter");
75
height: shellLoader.height
78
anchors { left: parent.left; right: parent.right; top: parent.top; margins: units.gu(1) }
81
anchors { left: parent.left; right: parent.right }
85
if (shellLoader.status !== Loader.Ready)
88
var greeter = testCase.findChild(shellLoader.item, "greeter");
179
210
compare(ApplicationManager.count, 1)
213
function test_snapDecisionDismissalReturnsFocus() {
214
var notifications = findChild(shell, "notificationList");
215
var app = ApplicationManager.startApplication("camera-app");
216
var stage = findChild(shell, "stage")
217
// Open an application and focus
218
waitUntilApplicationWindowIsFullyVisible(app);
219
ApplicationManager.focusApplication(app);
220
tryCompare(app.session.surface, "activeFocus", true);
222
notifications.model = mockNotificationsModel;
224
// FIXME: Hack: SortFilterProxyModelQML doesn't work with QML ListModels which we use
225
// for mocking here (RoleType can't be found in the QML model). As we only need to show
226
// one SnapDecision lets just disable the filtering and make appear any notification as a
228
var snapDecisionProxyModel = findInvisibleChild(shell, "snapDecisionProxyModel");
229
snapDecisionProxyModel.filterRegExp = RegExp("");
231
// Pop-up a notification
232
addSnapDecisionNotification();
233
waitForRendering(shell);
235
// Make sure the notification really opened
236
var notification = findChild(notifications, "notification" + (mockNotificationsModel.count - 1));
237
verify(notification !== undefined && notification != null, "notification wasn't found");
238
tryCompare(notification, "height", notification.implicitHeight)
239
waitForRendering(notification);
241
// Make sure activeFocus went away from the app window
242
tryCompare(app.session.surface, "activeFocus", false);
243
tryCompare(stage, "interactive", false);
245
// Clicking the button should dismiss the notification and return focus
246
var buttonAccept = findChild(notification, "notify_button0");
247
mouseClick(buttonAccept, buttonAccept.width / 2, buttonAccept.height / 2);
249
// Make sure we're back to normal
250
tryCompare(app.session.surface, "activeFocus", true);
251
compare(stage.interactive, true, "Stages not interactive again after modal notification has closed");
254
function addSnapDecisionNotification() {
256
type: Notification.SnapDecision,
257
hints: {"x-canonical-private-affirmative-tint": "true"},
259
body: "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.",
260
icon: "../graphics/avatars/funky.png",
261
secondaryIcon: "../graphics/applicationIcons/facebook.png",
262
actions: [{ id: "ok_id", label: "Ok"},
263
{ id: "cancel_id", label: "Cancel"},
264
{ id: "notreally_id", label: "Not really"},
265
{ id: "noway_id", label: "messages:No way"},
266
{ id: "nada_id", label: "messages:Nada"}]
269
mockNotificationsModel.append(n)
182
272
function test_leftEdgeDrag_data() {
184
274
{tag: "without launcher", revealLauncher: false, swipeLength: units.gu(27), appHides: true, focusedApp: "dialer-app", launcherHides: true},
346
436
var touchX = shell.width / 2;
347
437
var indicators = findChild(shell, "indicators");
348
438
touchFlick(indicators,
349
touchX /* fromX */, indicators.panelHeight * 0.5 /* fromY */,
439
touchX /* fromX */, indicators.minimizedPanelHeight * 0.5 /* fromY */,
350
440
touchX /* toX */, shell.height * 0.5 /* toY */,
351
441
true /* beginTouch */, false /* endTouch */);
352
442
verify(indicators.partiallyOpened);