on xenial help sign in
lp:~mzanetti/unity8/panel-button-fixes
2a22cd8Michał Sawicz
tests/mocks/Utils/windowstatestorage.cpp+6
@@ -45,6 +45,12 @@ QRect WindowStateStorage::getGeometry(const QString &windowId, const QRect &defa
45 return m_geometry.value(windowId).toRect();
45 return m_geometry.value(windowId).toRect();
46}
46}
47
47
48+void WindowStateStorage::clear()
49+{
50+ m_state.clear();
51+ m_geometry.clear();
52+}
53+
48void WindowStateStorage::saveState(const QString &windowId, WindowState state)
54void WindowStateStorage::saveState(const QString &windowId, WindowState state)
49{
55{
50 m_state[windowId] = state;
56 m_state[windowId] = state;
tests/mocks/Utils/windowstatestorage.h+3
@@ -36,6 +36,9 @@ public:
36 Q_INVOKABLE void saveGeometry(const QString &windowId, const QRect &rect);
36 Q_INVOKABLE void saveGeometry(const QString &windowId, const QRect &rect);
37 Q_INVOKABLE QRect getGeometry(const QString &windowId, const QRect &defaultValue);
37 Q_INVOKABLE QRect getGeometry(const QString &windowId, const QRect &defaultValue);
38
38
39+ // Only in the mock, to easily restore a fresh state
40+ Q_INVOKABLE void clear();
41+
39Q_SIGNALS:
42Q_SIGNALS:
40 void geometryChanged(const QVariantMap& geometry);
43 void geometryChanged(const QVariantMap& geometry);
41
44
tests/qmltests/tst_Shell.qml+4
@@ -29,6 +29,7 @@ import Unity.Notifications 1.0
29import Unity.Test 0.1
29import Unity.Test 0.1
30import Powerd 0.1
30import Powerd 0.1
31import Wizard 0.1 as Wizard
31import Wizard 0.1 as Wizard
32+import Utils 0.1
32
33
33import "../../qml"
34import "../../qml"
34import "../../qml/Components"
35import "../../qml/Components"
@@ -303,6 +304,7 @@ Rectangle {
303 mouseEmulation.checked = true;
304 mouseEmulation.checked = true;
304 tryCompare(shell, "enabled", true); // make sure greeter didn't leave us in disabled state
305 tryCompare(shell, "enabled", true); // make sure greeter didn't leave us in disabled state
305 tearDown();
306 tearDown();
307+ WindowStateStorage.clear();
306 }
308 }
307
309
308 function loadShell(formFactor) {
310 function loadShell(formFactor) {
@@ -1718,9 +1720,11 @@ Rectangle {
1718 var appDelegate = appRepeater.itemAt(0);
1720 var appDelegate = appRepeater.itemAt(0);
1719 var maximizeButton = findChild(appDelegate, "maximizeWindowButton");
1721 var maximizeButton = findChild(appDelegate, "maximizeWindowButton");
1720
1722
1723+ wait(5000)
1721 tryCompare(appDelegate, "state", "normal");
1724 tryCompare(appDelegate, "state", "normal");
1722 tryCompare(PanelState, "buttonsVisible", false)
1725 tryCompare(PanelState, "buttonsVisible", false)
1723
1726
1727+ wait(5000)
1724 mouseClick(maximizeButton, maximizeButton.width / 2, maximizeButton.height / 2);
1728 mouseClick(maximizeButton, maximizeButton.width / 2, maximizeButton.height / 2);
1725 tryCompare(appDelegate, "state", "maximized");
1729 tryCompare(appDelegate, "state", "maximized");
1726 tryCompare(PanelState, "buttonsVisible", true)
1730 tryCompare(PanelState, "buttonsVisible", true)