385
408
tryCompare(spreadView, "phase", 2);
411
function test_threeFingerTapOpensSideStage_data() {
413
{ tag: "1 finger", touchIds: [0], result: false },
414
{ tag: "2 finger", touchIds: [0, 1], result: false },
415
{ tag: "3 finger", touchIds: [0, 1, 2], result: true },
416
{ tag: "4 finger", touchIds: [0, 1, 2, 3], result: false },
420
function test_threeFingerTapOpensSideStage(data) {
421
multiTouchTap(data.touchIds, tabletStage, tabletStage.width / 2, tabletStage.height / 2);
423
tryCompare(sideStage, "shown", data.result);
427
function test_threeFingerTapClosesSideStage_data() {
429
{ tag: "1 finger", touchIds: [0], result: true },
430
{ tag: "2 finger", touchIds: [0, 1], result: true },
431
{ tag: "3 finger", touchIds: [0, 1, 2], result: false },
432
{ tag: "4 finger", touchIds: [0, 1, 2, 3], result: true },
436
function test_threeFingerTapClosesSideStage(data) {
439
multiTouchTap(data.touchIds, tabletStage, tabletStage.width / 2, tabletStage.height / 2);
441
tryCompare(sideStage, "shown", data.result);
444
function test_threeFingerDragOpensSidestage() {
445
multiTouchDragUntil([0,1,2],
447
tabletStage.width / 4,
448
tabletStage.height / 4,
451
function() { return sideStage.shown; });
454
function test_applicationLoadsInCorrectStage_data() {
456
{ tag: "MainStage", stage: ApplicationInfoInterface.MainStage, mainStageAppId: "webbrowser-app", sideStageAppId: ""},
457
{ tag: "SideStage", stage: ApplicationInfoInterface.SideStage, mainStageAppId: "unity8-dash", sideStageAppId: "webbrowser-app" },
461
function test_applicationLoadsInCorrectStage(data) {
462
WindowStateStorage.saveStage(webbrowserCheckBox.appId, data.stage)
464
var stagesPriv = findInvisibleChild(tabletStage, "stagesPriv");
467
tryCompare(stagesPriv, "mainStageAppId", "unity8-dash");
468
tryCompare(stagesPriv, "sideStageAppId", "");
470
webbrowserCheckBox.checked = true;
471
waitUntilAppSurfaceShowsUp(webbrowserCheckBox.appId)
473
tryCompare(stagesPriv, "mainStageAppId", data.mainStageAppId);
474
tryCompare(stagesPriv, "sideStageAppId", data.sideStageAppId);
477
function test_loadSideStageByDragginFromMainStage() {
479
webbrowserCheckBox.checked = true;
480
waitUntilAppSurfaceShowsUp(webbrowserCheckBox.appId);
482
var appDelegate = findChild(tabletStage, "tabletSpreadDelegate_" + webbrowserCheckBox.appId);
484
compare(appDelegate.stage, ApplicationInfoInterface.MainStage);
486
var pos = tabletStage.width - sideStage.width - (tabletStage.width - sideStage.width) / 2;
487
var end_pos = tabletStage.width - sideStage.width / 2;
489
multiTouchDragUntil([0,1,2],
492
tabletStage.height / 2,
497
return sideStage.shown && !sideStage.showAnimation.running &&
501
tryCompare(appDelegate, "stage", ApplicationInfoInterface.SideStage);
504
function test_unloadSideStageByDragginFromStageStage() {
506
WindowStateStorage.saveStage(webbrowserCheckBox.appId, ApplicationInfoInterface.SideStage)
507
webbrowserCheckBox.checked = true;
508
waitUntilAppSurfaceShowsUp(webbrowserCheckBox.appId);
510
var appDelegate = findChild(tabletStage, "tabletSpreadDelegate_" + webbrowserCheckBox.appId);
512
compare(appDelegate.stage, ApplicationInfoInterface.SideStage);
514
var pos = tabletStage.width - sideStage.width / 2;
515
var end_pos = tabletStage.width - sideStage.width - (tabletStage.width - sideStage.width) / 2;
517
multiTouchDragUntil([0,1,2],
520
tabletStage.height / 2,
525
return pos <= end_pos;
528
tryCompare(appDelegate, "stage", ApplicationInfoInterface.MainStage);