~mterry/unity8/oobe-revert-geonames

« back to all changes in this revision

Viewing changes to tests/qmltests/tst_DeviceConfiguration.qml

  • Committer: Michael Terry
  • Date: 2016-03-11 17:51:18 UTC
  • mfrom: (1821.227.75 unity8)
  • Revision ID: michael.terry@canonical.com-20160311175118-6za2cj41c21d88ha
Merge silo 64 (soon to be trunk)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright (C) 2016 Canonical, Ltd.
 
3
 *
 
4
 * This program is free software; you can redistribute it and/or modify
 
5
 * it under the terms of the GNU 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 General Public License for more details.
 
12
 *
 
13
 * You should have received a copy of the GNU General Public License
 
14
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
15
 */
 
16
 
 
17
import QtQuick 2.4
 
18
import QtTest 1.0
 
19
import Unity.Test 0.1
 
20
import "../../qml"
 
21
 
 
22
Item {
 
23
    id: root
 
24
    width: units.gu(40)
 
25
    height: units.gu(70)
 
26
 
 
27
    DeviceConfiguration {
 
28
        id: deviceConfiguration
 
29
    }
 
30
 
 
31
    UnityTestCase {
 
32
        id: testCase
 
33
        name: "DeviceConfiguration"
 
34
        when: windowShown
 
35
 
 
36
        function test_defaults() {
 
37
            deviceConfiguration.name = "nonexisting"
 
38
            compare(deviceConfiguration.primaryOrientation, -1)
 
39
            compare(deviceConfiguration.landscapeOrientation, Qt.LandscapeOrientation)
 
40
            compare(deviceConfiguration.portraitOrientation, Qt.PortraitOrientation)
 
41
            compare(deviceConfiguration.invertedLandscapeOrientation, Qt.InvertedLandscapeOrientation)
 
42
            compare(deviceConfiguration.invertedPortraitOrientation, Qt.InvertedPortraitOrientation)
 
43
            compare(deviceConfiguration.supportedOrientations, Qt.PortraitOrientation
 
44
                    | Qt.InvertedPortraitOrientation
 
45
                    | Qt.LandscapeOrientation
 
46
                    | Qt.InvertedLandscapeOrientation)
 
47
        }
 
48
    }
 
49
}