[SailfishDevel] __silica_applicationwindow_instance and Silica testability. Reliably faking it or making sure it works fine
Artem Marchenko
artem.marchenko at gmail.com
Sat Dec 14 17:49:47 UTC 2013
Hi there
*You can see all the mentioned things in HelloWorld Pro code
at https://github.com/amarchen/helloworld-pro-sailfish
<https://github.com/amarchen/helloworld-pro-sailfish>*
After the Alpha 3 SDK update, QtQuick tests work, but started producing
tons of warnings such
as file:///usr/lib/qt5/qml/Sailfish/Silica/Page.qml:130: ReferenceError:
__silica_applicationwindow_instance is not defined
Investigation showed that orientation, colors, etc are now fetched from
this window instance. Right now failed orientation info fetch doesn't cause
problems, but earlier or later it will bite back. Hence several questions:
1. How does Jolla test its Silica components? Some additions to standard
QtQuickTest setup?
2. Is it really wise to bind to __silica_applicationwindow_instance as it
injects quite a lot of expected context to the whole component library?
Shall code get it via some factory function or at least check the app
window instance existence?
3. One of my tests is wrapped into ApplicationWindow, so
__silica_applicationwindow_instance should be present. any hints on why the
warnings are still given?
3.1 Any ideas on how to fake __silica_applicationwindow_instance reliably?
https://github.com/amarchen/helloworld-pro-sailfish/blob/master/tests/tst_RealUiTest.qml
ApplicationWindow { <-- defines this instance var
id: wholeApp
initialPage: SailCalc { <-- yet SailCalc can't see it
id: bigCalc
}
TestCase {
Best regards,
Artem.
--
Artem Marchenko
http://agilesoftwaredevelopment.com
http://twitter.com/AgileArtem
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.sailfishos.org/pipermail/devel/attachments/20131214/fc45669b/attachment.html>
More information about the Devel
mailing list