~abreu-alexandre/unity-webapps-qml/fail-safe-content-hub-bindings

« back to all changes in this revision

Viewing changes to tests/autopilot/qml/FullWebViewApp.qml

Add bidirectional callback support between js <-> qml, 

Show diffs side-by-side

added added

removed removed

Lines of Context:
51
51
 
52
52
    property bool useOxide: false
53
53
    property string url: ""
 
54
 
 
55
    property string apiBackendQmlFileUrl: ""
 
56
    property string clientApiFileUrl: ""
 
57
 
54
58
    property string webappName: ""
55
59
    property string webappSearchPath: ""
56
60
    property string webappHomepage: ""
82
86
    }
83
87
 
84
88
    Loader {
 
89
        id: apiBackendQmlFileLoader
 
90
        source: apiBackendQmlFileUrl.length !== 0 ? apiBackendQmlFileUrl : ""
 
91
    }
 
92
 
 
93
    Loader {
85
94
        id: unityWebappsComponentLoader
86
95
        anchors.fill: parent
87
 
        sourceComponent: webView !== null && webappName.length !== 0 ? unityWebappsComponent : null
 
96
        sourceComponent: (webView !== null && webappName.length !== 0) ?
 
97
                    (apiBackendQmlFileUrl.length !== 0 ?
 
98
                      (apiBackendQmlFileLoader.item ? unityWebappsComponent : undefined)
 
99
                      : unityWebappsComponent)
 
100
                    : null
88
101
    }
89
102
 
90
103
    UnityWebappsAppModel {
100
113
            objectName: "webappsContainer"
101
114
            actionsContext: webappsActionsContext
102
115
            name: root.webappName
 
116
            injectExtraUbuntuApis: true
 
117
            customBackendProxies: apiBackendQmlFileLoader.item
 
118
                                 ? apiBackendQmlFileLoader.item.buildapi()
 
119
                                 : undefined
 
120
            customClientApiFileUrl: root.clientApiFileUrl
103
121
            bindee: webView
104
122
            _opt_homepage: root.webappHomepage
105
123
            model: webappModel
106
124
        }
107
125
    }
108
126
}
 
127