~tpeeters/ubuntu-ui-toolkit/toolbarActions-hide

« back to all changes in this revision

Viewing changes to tests/unit/tst_components/tst_mainview.qml

  • Committer: Kaleo
  • Date: 2013-07-12 05:22:28 UTC
  • mfrom: (618 trunk)
  • mto: This revision was merged to the branch mainline in revision 621.
  • Revision ID: florian.boucault@canonical.com-20130712052228-9xb64arord222hmu
Merged trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright 2013 Canonical Ltd.
 
3
 *
 
4
 * This program is free software; you can redistribute it and/or modify
 
5
 * it under the terms of the GNU Lesser General Public License as published by
 
6
 * the Free Software Foundation; version 3.
 
7
 *
 
8
 * This program is distributed in the hope that it will be useful,
 
9
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
10
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
11
 * GNU Lesser General Public License for more details.
 
12
 *
 
13
 * You should have received a copy of the GNU Lesser General Public License
 
14
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
15
 */
 
16
 
 
17
import QtQuick 2.0
 
18
import QtTest 1.0
 
19
import Ubuntu.Components 0.1
 
20
 
 
21
TestCase {
 
22
    name: "MainViewAPI"
 
23
 
 
24
    MainView {
 
25
        id: mainView
 
26
    }
 
27
 
 
28
    function initTestCase() {
 
29
        compare(mainView.active, true, "MainView always active.");
 
30
        compare(mainView.automaticOrientation, false, "Automatic orientation off by default.");
 
31
        compare(mainView.applicationName, "", "Application name is empty string by default.");
 
32
    }
 
33
 
 
34
    function test_automaticOrientation() {
 
35
        mainView.automaticOrientation = true;
 
36
        compare(mainView.automaticOrientation, true, "Automatic orientation can be enabled.");
 
37
        mainView.automaticOrientation = false;
 
38
        compare(mainView.automaticOrientation, false, "Automaic orientation can be disabled.");
 
39
    }
 
40
 
 
41
    function test_applicationName() {
 
42
        var appName = "testAppName";
 
43
        mainView.applicationName = appName;
 
44
        compare(mainView.applicationName, appName, "Applicatin name can be set.");
 
45
        mainView.applicationName = "";
 
46
        compare(mainView.applicationName, "", "Application name can be unset.");
 
47
    }
 
48
}