~bzoltan/ubuntu-ui-toolkit/inputMainFocus

« back to all changes in this revision

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

  • Committer: CI Train Bot
  • Author(s): Zoltán Balogh, Tim Peeters, Zsombor Egri, Christian Dywan, Andrea Bernabei
  • Date: 2016-04-12 11:12:39 UTC
  • mfrom: (1000.868.47 OTA11-landing-2016-04-08)
  • Revision ID: ci-train-bot@canonical.com-20160412111239-g60hc86tzxtrprn3
OTA11-landing-2016-04-08

Show diffs side-by-side

added added

removed removed

Lines of Context:
34
34
                id: pageInStack
35
35
            }
36
36
        }
 
37
 
 
38
        Column {
 
39
            // for manual testing
 
40
            visible: pageStack.depth === 0
 
41
            anchors {
 
42
                left: parent.left
 
43
                right: parent.right
 
44
                top: parent.top
 
45
                margins: units.gu(1)
 
46
            }
 
47
            Button {
 
48
                text: "page1"
 
49
                onClicked: pageStack.push(page1)
 
50
            }
 
51
            Button {
 
52
                text: "page2"
 
53
                onClicked: pageStack.push(page2)
 
54
            }
 
55
            Button {
 
56
                text: "pageWithPage"
 
57
                onClicked: pageStack.push(pageWithPage)
 
58
            }
 
59
            Button {
 
60
                text: "tabs"
 
61
                onClicked: pageStack.push(tabs)
 
62
            }
 
63
            Button {
 
64
                text: "pageWithHeader"
 
65
                onClicked: pageStack.push(pageWithHeader)
 
66
            }
 
67
            Button {
 
68
                text: "pageComponent"
 
69
                onClicked: pageStack.push(pageComponent)
 
70
            }
 
71
        }
37
72
    }
38
73
    Page {
39
74
        id: page1
238
273
                    "PageStack.push() returns Page created from QML file");
239
274
        }
240
275
 
241
 
        function test_page_header_back_button() {
 
276
        function test_page_header_back_button_bug1565811() {
242
277
            pageStack.push(pageWithHeader);
243
 
            var backButton = findChild(pageWithHeader.header, "pagestack_back_action_button");
244
 
            // FIXME TIM: when visibleActions is fixed, only check for backButton, null.
245
 
            compare(backButton == null || !backButton.visible, true,
 
278
            var backButton = findChild(pageWithHeader.header.leadingActionBar,
 
279
                                       "pagestack_back_action_button");
 
280
            compare(backButton, null,
246
281
                    "Page header shows back button with only one page on the stack.");
247
 
 
248
282
            pageStack.pop();
249
283
            pageStack.push(page1);
250
284
            pageStack.push(pageWithHeader);
251
285
            waitForHeaderAnimation(mainView);
252
286
            backButton = findChild(pageWithHeader.header, "pagestack_back_action_button");
253
 
            compare(backButton.visible, true,
 
287
            compare(backButton && backButton.visible, true,
254
288
                    "Page header has no back button with two pages on the stack.");
255
289
        }
256
290
    }