~mterry/unity8/greeter-arrangement

« back to all changes in this revision

Viewing changes to tests/qmltests/tst_Shell.qml

  • Committer: Michael Terry
  • Date: 2016-08-30 14:06:47 UTC
  • Revision ID: michael.terry@canonical.com-20160830140647-0gmw15jq769d2g1q
Use the default system wallpaper instead of our custom one.

Show diffs side-by-side

added added

removed removed

Lines of Context:
549
549
 
550
550
            AccountsService.demoEdges = false;
551
551
            AccountsService.demoEdgesCompleted = [];
 
552
            AccountsService.backgroundFile = "";
552
553
            Wizard.System.wizardEnabled = false;
553
554
            shellLoader.mode = "full-greeter";
554
555
 
563
564
            broadcastHomeSpy.clear();
564
565
 
565
566
            GSettingsController.setLifecycleExemptAppids([]);
 
567
            GSettingsController.setPictureUri("");
566
568
 
567
569
            // there should be only unity8-dash window over there
568
570
            tryCompare(ApplicationManager, "count", 1);
1334
1336
            tryCompare(tutorial, "paused", false);
1335
1337
        }
1336
1338
 
 
1339
        function test_customBackground() {
 
1340
            loadShell("desktop");
 
1341
            shell.usageScenario = "desktop";
 
1342
            waitForRendering(shell);
 
1343
 
 
1344
            var wallpaperResolver = findInvisibleChild(shell, "wallpaperResolver");
 
1345
            var greeter = findChild(shell, "greeter");
 
1346
            verify(!greeter.hasCustomBackground);
 
1347
            compare(greeter.background, wallpaperResolver.defaultBackground);
 
1348
 
 
1349
            AccountsService.backgroundFile = Qt.resolvedUrl("../graphics/applicationIcons/dash.png");
 
1350
            tryCompare(greeter, "hasCustomBackground", true);
 
1351
            compare(greeter.background, AccountsService.backgroundFile);
 
1352
        }
 
1353
 
 
1354
        function test_cachedDefaultBackground() {
 
1355
            loadShell("desktop");
 
1356
            shell.usageScenario = "desktop";
 
1357
            waitForRendering(shell);
 
1358
 
 
1359
            var greeter = findChild(shell, "greeter");
 
1360
            verify(!greeter.hasCustomBackground);
 
1361
            compare(greeter.background.toString().indexOf("image://thumbnailer/file:///"), 0);
 
1362
        }
 
1363
 
1337
1364
        function test_tapOnRightEdgeReachesApplicationSurface() {
1338
1365
            loadShell("phone");
1339
1366
            swipeAwayGreeter();
2435
2462
            compare(topmostSurfaceItem.touchReleaseCount, 2);
2436
2463
        }
2437
2464
 
 
2465
        function test_background_data() {
 
2466
            return [
 
2467
                {tag: "color",
 
2468
                 accounts: Qt.resolvedUrl("data:image/svg+xml,<svg><rect width='100%' height='100%' fill='#dd4814'/></svg>"),
 
2469
                 gsettings: "",
 
2470
                 output: Qt.resolvedUrl("data:image/svg+xml,<svg><rect width='100%' height='100%' fill='#dd4814'/></svg>")},
 
2471
 
 
2472
                {tag: "empty", accounts: "", gsettings: "", output: "defaultBackground"},
 
2473
 
 
2474
                {tag: "as-specified",
 
2475
                 accounts: Qt.resolvedUrl("../data/unity/backgrounds/blue.png"),
 
2476
                 gsettings: "",
 
2477
                 output: Qt.resolvedUrl("../data/unity/backgrounds/blue.png")},
 
2478
 
 
2479
                {tag: "gs-specified",
 
2480
                 accounts: "",
 
2481
                 gsettings: Qt.resolvedUrl("../data/unity/backgrounds/red.png"),
 
2482
                 output: Qt.resolvedUrl("../data/unity/backgrounds/red.png")},
 
2483
 
 
2484
                {tag: "both-specified",
 
2485
                 accounts: Qt.resolvedUrl("../data/unity/backgrounds/blue.png"),
 
2486
                 gsettings: Qt.resolvedUrl("../data/unity/backgrounds/red.png"),
 
2487
                 output: Qt.resolvedUrl("../data/unity/backgrounds/blue.png")},
 
2488
 
 
2489
                {tag: "invalid-as",
 
2490
                 accounts: Qt.resolvedUrl("../data/unity/backgrounds/nope.png"),
 
2491
                 gsettings: Qt.resolvedUrl("../data/unity/backgrounds/red.png"),
 
2492
                 output: Qt.resolvedUrl("../data/unity/backgrounds/red.png")},
 
2493
 
 
2494
                {tag: "invalid-both",
 
2495
                 accounts: Qt.resolvedUrl("../data/unity/backgrounds/nope.png"),
 
2496
                 gsettings: Qt.resolvedUrl("../data/unity/backgrounds/stillnope.png"),
 
2497
                 output: "defaultBackground"},
 
2498
            ]
 
2499
        }
 
2500
        function test_background(data) {
 
2501
            loadShell("phone");
 
2502
            shell.usageScenario = "phone";
 
2503
            waitForRendering(shell);
 
2504
 
 
2505
            AccountsService.backgroundFile = data.accounts;
 
2506
            GSettingsController.setPictureUri(data.gsettings);
 
2507
 
 
2508
            var wallpaperResolver = findChild(shell, "wallpaperResolver");
 
2509
            if (data.output === "defaultBackground") {
 
2510
                tryCompare(wallpaperResolver, "background", wallpaperResolver.defaultBackground);
 
2511
                verify(!wallpaperResolver.hasCustomBackground);
 
2512
            } else {
 
2513
                tryCompare(wallpaperResolver, "background", data.output);
 
2514
                verify(wallpaperResolver.hasCustomBackground);
 
2515
            }
 
2516
        }
 
2517
 
2438
2518
        function test_greeterModeBroadcastsApp() {
2439
2519
            setLightDMMockMode("single-pin");
2440
2520
            shellLoader.mode = "greeter";