~michael-sheldon/content-hub/qdoc-import-fix

« back to all changes in this revision

Viewing changes to tests/qml-tests/tst_ContentHub.qml

  • Committer: Tarmac
  • Author(s): Guenter Schwann
  • Date: 2013-08-23 16:32:24 UTC
  • mfrom: (13.1.5 content-qml-import)
  • Revision ID: tarmac-20130823163224-z8g2274zh0zltr3q
Handle import and export requests from hub for QML.

Approved by PS Jenkins bot, Ken VanDine.

Show diffs side-by-side

added added

removed removed

Lines of Context:
33
33
        verify(transfer !== null, "No transer Object returned")
34
34
    }
35
35
 
 
36
//    function test_import_request() {
 
37
//        test.numImports = 0
 
38
//        // trigger import somehow
 
39
//        compare(test.numImports, 1, "No import handled")
 
40
//    }
 
41
 
36
42
    function test_export_request() {
37
43
        var transfer = ContentHub.importContent(ContentType.Pictures)
38
 
        ContentHub.exportRequested(transfer)
 
44
        ContentHub.exportRequested(transfer) // FIXME find better way to simulate the export request
39
45
        compare(test.exportTransfer, transfer, "Transfer object not correcty copied")
40
46
    }
41
47
 
42
48
    Item {
43
49
        id: test
44
50
        property variant exportTransfer
 
51
        property int numImports: 0
45
52
        Connections {
46
53
            target: ContentHub
47
54
            onExportRequested: {
48
 
                test.exportTransfer = transfer
 
55
                test.exportTransfer = transfer;
 
56
            }
 
57
            onFinishedImportsChanged: {
 
58
                test.numImports++;
49
59
            }
50
60
        }
51
61
    }