blob: 974493a68e65caa4b964071dde2b658b0e21a33f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
// Copyright (C) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
import QtQuick
import QtTest
import QtLocation
import "utils.js" as Utils
TestCase {
id: testCase
name: "Icon"
property icon emptyIcon
function test_empty() {
compare(emptyIcon.parameters, {})
}
property icon qmlIconSingleUrl: ({ parameters: { singleUrl: "http://example.com/icon.png" }})
function test_qmlSingleUrlIcon() {
var u = qmlIconSingleUrl.url(Qt.size(64, 64));
compare(u, "http://example.com/icon.png");
u = qmlIconSingleUrl.url(Qt.size(20, 20));
compare(u, "http://example.com/icon.png");
var params = qmlIconSingleUrl.parameters
params.singleUrl = "/home/user/icon.png"
qmlIconSingleUrl.parameters = params
u = qmlIconSingleUrl.url(Qt.size(20, 20));
compare(u, "file:///home/user/icon.png");
}
}
|