@@ -0,0 +1,84 @@
2+ * Copyright 2014 Canonical Ltd.
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.
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.
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/>.
19+import "../../../../qml/Dash/Previews"
20+import Unity.Test 0.1 as UT
21+import Ubuntu.Components 0.1
28+ property var progressjson: {
30+ "source": { "dbus-name" : "somename", "dbus-object": "somestring" }
33+ property var progressjsonFinish: {
35+ "source": { "dbus-name" : "somename", "dbus-object": "finish" }
38+ property var progressjsonError: {
40+ "source": { "dbus-name" : "somename", "dbus-object": "error" }
45+ signalName: "triggered"
51+ widgetId: "previewProgress"
52+ widgetData: progressjson
63+ name: "PreviewHeaderTest"
66+ function test_json() {
67+ spy.target = previewProgress
69+ previewProgress.widgetData = progressjsonFinish;
70+ compare(spy.count, 1);
71+ var args = spy.signalArguments[0];
72+ compare(args[0], "previewProgress");
73+ compare(args[1], "finished");
74+ compare(args[2], progressjsonFinish);
76+ previewProgress.widgetData = progressjsonError;
77+ compare(spy.count, 2);
78+ var args = spy.signalArguments[1];
79+ compare(args[0], "previewProgress");
80+ compare(args[1], "failed");
81+ compare(args[2], progressjsonError);