~ubuntu-sdk-team/ubuntu-ui-toolkit/staging

« back to all changes in this revision

Viewing changes to tests/unit_x11/tst_components/tst_multicolumnheader.qml

  • Committer: Tarmac
  • Author(s): Tim Peeters
  • Date: 2015-09-01 09:47:49 UTC
  • mfrom: (1618.2.3 apl-headercontents)
  • Revision ID: tarmac-20150901094749-4zcvp9ym8kac2a1e
Don't unset the subheader style when Page.head changes because that unsets the parent of Page.head.contents. Fixes: https://bugs.launchpad.net/bugs/1488922.

Approved by Christian Dywan, PS Jenkins bot.

Show diffs side-by-side

added added

removed removed

Lines of Context:
61
61
                    onClicked: layout.addPageToNextColumn(
62
62
                                   rootPage, Qt.resolvedUrl("MyExternalPage.qml"))
63
63
                }
 
64
                ListItemWithLabel {
 
65
                    text: "Add page with head contents left"
 
66
                    onClicked: layout.addPageToCurrentColumn(rootPage, headContentsPage)
 
67
                }
 
68
                ListItemWithLabel {
 
69
                    text: "Add page with head contents right"
 
70
                    onClicked: layout.addPageToNextColumn(rootPage, headContentsPage)
 
71
                }
64
72
            }
65
73
        }
66
74
        Page {
108
116
                color: "blue"
109
117
            }
110
118
        }
 
119
        Page {
 
120
            id: headContentsPage
 
121
            head.contents: Rectangle {
 
122
                id: headRectangle
 
123
                color: UbuntuColors.orange
 
124
                anchors.fill: parent
 
125
            }
 
126
        }
111
127
    }
112
128
 
113
129
    UbuntuTestCase {
340
356
            compare(get_back_button_visible(0), false,
341
357
                    "Back button remains visible after removing page from following column.");
342
358
        }
 
359
 
 
360
        function test_head_contents_visible_bug1488922() {
 
361
            layout.addPageToCurrentColumn(rootPage, headContentsPage);
 
362
            // The bug occurred when the style for the subheader was unset
 
363
            //  after a short delay, so wait before testing Page.head.contents.parent.
 
364
            wait(100);
 
365
            compare(headRectangle.visible, true, "Head contents not visible in current column.");
 
366
            compare(headRectangle.parent == null, false, "Head contents has no parent in current column.");
 
367
            layout.removePages(headContentsPage);
 
368
            layout.addPageToNextColumn(rootPage, headContentsPage);
 
369
            wait(100);
 
370
            compare(headRectangle.visible, true, "Head contents not visible in next column.");
 
371
            compare(headRectangle.parent == null, false, "Head contents has no parent in next column.");
 
372
            layout.removePages(headContentsPage);
 
373
        }
343
374
    }
344
375
}