on xenial help sign in
fix tests
f5cbddfNick Dedekind
tests/mocks/Unity/Application/SurfaceManager.cpp+2−2
@@ -83,7 +83,7 @@ void SurfaceManager::registerSurface(MirSurface *surface)
83 this->onStateRequested(surface, state);
83 this->onStateRequested(surface, state);
84 });
84 });
85
85
86− const QString persistentId = m_virtualKeyboard->persistentId();
86+ const QString persistentId = surface->persistentId();
87 connect(surface, &QObject::destroyed, this, [=]() {
87 connect(surface, &QObject::destroyed, this, [=]() {
88 this->onSurfaceDestroyed(surface, persistentId);
88 this->onSurfaceDestroyed(surface, persistentId);
89 });
89 });
@@ -225,7 +225,7 @@ void SurfaceManager::onStateRequested(MirSurface *surface, Mir::State state)
225 DEBUG_MSG("("<<surface<<","<<state<<") ended");
225 DEBUG_MSG("("<<surface<<","<<state<<") ended");
226}
226}
227
227
228−void SurfaceManager::onSurfaceDestroyed(const QString& persistentId, MirSurface *surface)
228+void SurfaceManager::onSurfaceDestroyed(MirSurface *surface, const QString& persistentId)
229{
229{
230 m_surfaces.removeAll(surface);
230 m_surfaces.removeAll(surface);
231 if (m_focusedSurface == surface) {
231 if (m_focusedSurface == surface) {
tests/mocks/Unity/Application/SurfaceManager.h+1−1
@@ -87,7 +87,7 @@ Q_SIGNALS:
87
87
88private Q_SLOTS:
88private Q_SLOTS:
89 void onStateRequested(MirSurface *surface, Mir::State state);
89 void onStateRequested(MirSurface *surface, Mir::State state);
90− void onSurfaceDestroyed(const QString& persistentId, MirSurface *surface);
90+ void onSurfaceDestroyed(MirSurface *surface, const QString& persistentId);
91
91
92private:
92private:
93 void doRaise(unity::shell::application::MirSurfaceInterface *surface);
93 void doRaise(unity::shell::application::MirSurfaceInterface *surface);
tests/qmltests/ApplicationMenuDataLoader.qml+4−1
@@ -5,8 +5,11 @@ import Unity.ApplicationMenu 0.1
5import Unity.Indicators 0.1 as Indicators
5import Unity.Indicators 0.1 as Indicators
6
6
7Object {
7Object {
8+
9+ property var surfaceManager: null
10+
8 Connections {
11 Connections {
9− target: SurfaceManager
12+ target: surfaceManager
10 onSurfaceCreated: {
13 onSurfaceCreated: {
11 var fakeMenuPath = "/" + surface.persistentId.replace(/\W+/g, "");
14 var fakeMenuPath = "/" + surface.persistentId.replace(/\W+/g, "");
12
15
tests/qmltests/ApplicationMenus/tst_MenuBar.qml+5−1
@@ -42,7 +42,11 @@ Item {
42 value: false
42 value: false
43 }
43 }
44
44
45+ SurfaceManager { id: sMgr }
45− ApplicationMenuDataLoader { id: appMenuData }
46+ ApplicationMenuDataLoader {
47+ id: appMenuData
48+ surfaceManager: sMgr
49+ }
46
50
47 Rectangle {
51 Rectangle {
48 anchors {
52 anchors {
tests/qmltests/Panel/tst_Panel.qml+5−3
@@ -42,9 +42,11 @@ PanelTest {
42 value: keyboardAttached.checked
42 value: keyboardAttached.checked
43 }
43 }
44
44
45+ SurfaceManager { id: sMgr }
45− ApplicationMenuDataLoader { id: appMenuData }
46+ ApplicationMenuDataLoader {
46−
47+ id: appMenuData
47− SurfaceManager {}
48+ surfaceManager: sMgr
49+ }
48
50
49 Component.onCompleted: {
51 Component.onCompleted: {
50 theme.name = "Ubuntu.Components.Themes.SuruDark"
52 theme.name = "Ubuntu.Components.Themes.SuruDark"
tests/qmltests/Stage/tst_DecoratedWindow.qml+5−1
@@ -46,7 +46,11 @@ Rectangle {
46 value: false
46 value: false
47 }
47 }
48
48
49+ SurfaceManager { id: sMgr }
49− ApplicationMenuDataLoader { }
50+ ApplicationMenuDataLoader {
51+ id: appMenuData
52+ surfaceManager: sMgr
53+ }
50
54
51 Item {
55 Item {
52 id: fakeShell
56 id: fakeShell
tests/qmltests/Stage/tst_DesktopStage.qml+4−8
@@ -60,10 +60,11 @@ Item {
60 }
60 }
61 }
61 }
62
62
63−
64− ApplicationMenuDataLoader { }
65−
66 SurfaceManager { id: sMgr }
63 SurfaceManager { id: sMgr }
64+ ApplicationMenuDataLoader {
65+ id: appMenuData
66+ surfaceManager: sMgr
67+ }
67
68
68 TopLevelWindowModel {
69 TopLevelWindowModel {
69 id: topSurfaceList
70 id: topSurfaceList
@@ -152,11 +153,6 @@ Item {
152 }
153 }
153 }
154 }
154
155
155− SignalSpy {
156− id: mouseEaterSpy
157− target: clickThroughTester
158− }
159−
160 StageTestCase {
156 StageTestCase {
161 id: testCase
157 id: testCase
162 name: "DesktopStage"
158 name: "DesktopStage"
tests/qmltests/Stage/tst_PhoneStage.qml+4−2
@@ -31,9 +31,11 @@ Item {
31
31
32 property var greeter: { fullyShown: true }
32 property var greeter: { fullyShown: true }
33
33
34− ApplicationMenuDataLoader { }
35−
36 SurfaceManager { id: sMgr }
34 SurfaceManager { id: sMgr }
35+ ApplicationMenuDataLoader {
36+ id: appMenuData
37+ surfaceManager: sMgr
38+ }
37
39
38 Stage {
40 Stage {
39 id: stage
41 id: stage
tests/qmltests/Stage/tst_TabletStage.qml+4−2
@@ -35,9 +35,11 @@ Rectangle {
35
35
36 property var greeter: { fullyShown: true }
36 property var greeter: { fullyShown: true }
37
37
38− ApplicationMenuDataLoader { }
39−
40 SurfaceManager { id: sMgr }
38 SurfaceManager { id: sMgr }
39+ ApplicationMenuDataLoader {
40+ id: appMenuData
41+ surfaceManager: sMgr
42+ }
41
43
42 Stage {
44 Stage {
43 id: stage
45 id: stage
tests/qmltests/Stage/tst_WindowDecoration.qml+5−1
@@ -47,7 +47,11 @@ Item {
47 property string name: "webbrowser"
47 property string name: "webbrowser"
48 }
48 }
49
49
50+ SurfaceManager { id: sMgr }
50− ApplicationMenuDataLoader { id: menuData }
51+ ApplicationMenuDataLoader {
52+ id: appMenuData
53+ surfaceManager: sMgr
54+ }
51
55
52 UnityMenuModel {
56 UnityMenuModel {
53 id: menuBackend
57 id: menuBackend
tests/qmltests/tst_Shell.qml+5−1
@@ -53,7 +53,11 @@ Rectangle {
53 shellLoader.active = true;
53 shellLoader.active = true;
54 }
54 }
55
55
56+ SurfaceManager { id: sMgr }
56− ApplicationMenuDataLoader {}
57+ ApplicationMenuDataLoader {
58+ id: appMenuData
59+ surfaceManager: sMgr
60+ }
57
61
58 property var shell: shellLoader.item ? shellLoader.item : null
62 property var shell: shellLoader.item ? shellLoader.item : null
59 onShellChanged: {
63 onShellChanged: {