Some test refinements
- Fix MirSurfaceItem mock. Its qml child was not getting resized
along with its parent
- Add the panel height to tst_PhoneStage so that you can see
the difference between fullscreen and normal surfaces
commite246ecd0d740c0bcea9a766e7a7c126e1900b5b1
authorDaniel d'Andrada <daniel.dandrada@canonical.com>
dateMon 18 Aug 2014, 13:59 (12 years ago)
parent2c397d3
tests/mocks/Unity/Application/ApplicationManager.cpp+1
@@ -372,6 +372,7 @@ void ApplicationManager::buildListOfAvailableApplications()
372372 application->setName("Gallery");
373373 application->setScreenshotId("gallery");
374374 application->setIconId("gallery");
375+ application->setFullscreen(true);
375376 m_availableApplications.append(application);
376377
377378 application = new ApplicationInfo(this);
tests/mocks/Unity/Application/MirSurfaceItem.cpp+2−2
@@ -233,8 +233,8 @@ void MirSurfaceItem::createQmlContentItem()
233233 m_qmlItem = qobject_cast<QQuickItem*>(m_qmlContentComponent->create());
234234 m_qmlItem->setParentItem(this);
235235
236− setImplicitWidth(m_qmlItem->width());
237− setImplicitHeight(m_qmlItem->height());
236+ setImplicitWidth(m_qmlItem->implicitWidth());
237+ setImplicitHeight(m_qmlItem->implicitHeight());
238238
239239 {
240240 QQmlProperty screenshotSource(m_qmlItem, "screenshotSource");
tests/mocks/Unity/Application/MirSurfaceItem.qml+6−3
@@ -19,10 +19,12 @@ import QtQuick 2.0
1919Rectangle {
2020 objectName: "fakeSurfaceQML"
2121 id: root
22− color: "yellow"
22+ color: "pink"
2323
24− width: units.gu(40)
25− height: units.gu(70)
24+ anchors.fill: parent
25+
26+ implicitWidth: units.gu(40)
27+ implicitHeight: units.gu(70)
2628
2729 property alias screenshotSource: screenshotImage.source
2830
@@ -34,6 +36,7 @@ Rectangle {
3436 Image {
3537 id: screenshotImage
3638 anchors.fill: parent
39+ fillMode: Image.Stretch
3740 }
3841
3942 Text {
tests/qmltests/Stages/tst_PhoneStage.qml+1−4
@@ -26,14 +26,11 @@ Item {
2626 width: units.gu(70)
2727 height: units.gu(70)
2828
29− Rectangle {
30−
31− }
32−
3329 PhoneStage {
3430 id: phoneStage
3531 anchors { fill: parent; rightMargin: units.gu(30) }
3632 dragAreaWidth: units.gu(2)
33+ maximizedAppTopMargin: units.gu(3) + units.dp(2)
3734 }
3835
3936 Binding {