@@ -0,0 +1,76 @@
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 Ubuntu.Components 0.1
20+import "../../../../qml/Dash/Previews"
21+import Unity.Test 0.1 as UT
22+import QtMultimedia 5.0
28+ color: Theme.palette.selected.background
30+ PreviewWidgetFactory {
37+ source: Qt.resolvedUrl("MockPreviewWidget.qml")
47+ signalName: "triggered"
51+ name: "PreviewWidgetFactory"
54+ property Item mockWidget: findChild(factory, "mockPreviewWidget")
57+ verify(typeof mockWidget === "object", "Could not find the mock preview widget.");
60+ function test_previewData() {
61+ tryCompare(mockWidget, "widgetData", factory.widgetData);
64+ function test_triggered() {
65+ mockWidget.trigger();
69+ var args = triggeredSpy.signalArguments[0];
71+ compare(args[0], "mockWidget", "Widget id not passed correctly.");
72+ compare(args[1], "mockAction", "Action id not passed correctly.");
73+ compare(args[2]["mock"], "data", "Data not passed correctly.");