106
106
enabled: parent.promptSurfaceList !== null && parent.promptSurfaceList.count > 0
107
107
activeFocusOnPress: false
109
onClicked: { parent.promptSurfaceList.get(parent.promptSurfaceList.count - 1).close(); }
109
onClicked: { parent.promptSurfaceList.get(0).close(); }
242
242
surfaceCheckbox.checked = false;
244
console.log("killApps() start");
246
console.log("killApps() end");
248
246
root.fakeApplication = ApplicationManager.add("gallery-app");
249
247
root.fakeApplication.manualSurfaceCreation = true;
449
447
for (i = 0; i < 3; i++) {
450
448
promptSurfaceList.createSurface();
451
449
compare(promptSurfaces.count, i+1);
452
waitUntilSurfaceContainerStopsAnimating(promptSurfaces.itemAt(promptSurfaces.count - 1));
450
waitUntilSurfaceContainerStopsAnimating(promptSurfaces.itemAt(0));
455
for (i = 2; i >= 0; --i) {
456
var promptSurface = promptSurfaceList.get(i);
453
for (i = 3; i > 0; --i) {
454
var promptSurface = promptSurfaceList.get(0);
457
455
compare(promptSurface.activeFocus, true);
459
457
promptSurface.close();
460
tryCompareFunction(function() { return promptSurfaces.count; }, i);
458
promptSurface = null;
459
tryCompareFunction(function() { return promptSurfaces.count; }, i-1);
463
// active focus should have gone to the yongest remaining sibling
464
var previousPromptSurface = promptSurfaceList.get(i-1);
465
tryCompare(previousPromptSurface, "activeFocus", true);
461
if (promptSurfaces.count > 0) {
462
// active focus should have gone to the new head of the list
463
promptSurface = promptSurfaceList.get(0);
464
tryCompare(promptSurface, "activeFocus", true);
467
466
// active focus should have gone to the application surface
468
467
tryCompare(applicationWindow.surface, "activeFocus", true);
498
497
delegate.surface.close();
499
498
tryCompare(promptSurfaces, "count", 0);
501
// Check that the z value of SurfaceContainers for prompt surfaces go from highest
502
// for index 0 to lowest for the last index in the prompt surface list.
503
// Regression test for https://bugs.launchpad.net/bugs/1586219
504
function test_promptSurfacesZOrdering() {
505
var promptSurfaceList = root.fakeApplication.promptSurfaceList;
506
var promptSurfaces = testCase.findChild(applicationWindow, "promptSurfacesRepeater");
508
promptSurfaceList.createSurface();
510
for (var i = 2; i <= 3; i++) {
511
promptSurfaceList.createSurface();
512
tryCompare(promptSurfaces, "count", i);
513
waitUntilSurfaceContainerStopsAnimating(promptSurfaces.itemAt(0));
515
for (var j = 1; j < promptSurfaces.count; j++) {
516
var delegate = promptSurfaces.itemAt(j);
517
var previousDelegate = promptSurfaces.itemAt(j-1);
518
verify(previousDelegate.z > delegate.z);
523
while (promptSurfaceList.count > 0) {
524
var currentCount = promptSurfaceList.count;
525
promptSurfaceList.get(0).close();
526
tryCompare(promptSurfaceList, "count", currentCount - 1);