on xenial help sign in
lp:~mzanetti/unity8/panel-button-fixes
commit2a22cd8ee591e309dcf9b10309ea7e6e80b58489 authorMichał Sawicz <michal.sawicz@canonical.com> dateTue 27 Oct 2015, 20:51 (11 years ago) parent7e7e4039a708f4
3 files changed+13
tests/mocks/Utils/windowstatestorage.cpp+6 tests/mocks/Utils/windowstatestorage.h+3 tests/qmltests/tst_Shell.qml+4
tests/mocks/Utils/windowstatestorage.cpp+6
@@ -45,6 +45,12 @@ QRect WindowStateStorage::getGeometry(const QString &windowId, const QRect &defa
4545 return m_geometry.value(windowId).toRect();
4646}
4747
48+void WindowStateStorage::clear()
49+{
50+ m_state.clear();
51+ m_geometry.clear();
52+}
53+
4854void WindowStateStorage::saveState(const QString &windowId, WindowState state)
4955{
5056 m_state[windowId] = state;
tests/mocks/Utils/windowstatestorage.h+3
@@ -36,6 +36,9 @@ public:
3636 Q_INVOKABLE void saveGeometry(const QString &windowId, const QRect &rect);
3737 Q_INVOKABLE QRect getGeometry(const QString &windowId, const QRect &defaultValue);
3838
39+ // Only in the mock, to easily restore a fresh state
40+ Q_INVOKABLE void clear();
41+
3942Q_SIGNALS:
4043 void geometryChanged(const QVariantMap& geometry);
4144
tests/qmltests/tst_Shell.qml+4
@@ -29,6 +29,7 @@ import Unity.Notifications 1.0
2929import Unity.Test 0.1
3030import Powerd 0.1
3131import Wizard 0.1 as Wizard
32+import Utils 0.1
3233
3334import "../../qml"
3435import "../../qml/Components"
@@ -303,6 +304,7 @@ Rectangle {
303304 mouseEmulation.checked = true;
304305 tryCompare(shell, "enabled", true); // make sure greeter didn't leave us in disabled state
305306 tearDown();
307+ WindowStateStorage.clear();
306308 }
307309
308310 function loadShell(formFactor) {
@@ -1718,9 +1720,11 @@ Rectangle {
17181720 var appDelegate = appRepeater.itemAt(0);
17191721 var maximizeButton = findChild(appDelegate, "maximizeWindowButton");
17201722
1723+ wait(5000)
17211724 tryCompare(appDelegate, "state", "normal");
17221725 tryCompare(PanelState, "buttonsVisible", false)
17231726
1727+ wait(5000)
17241728 mouseClick(maximizeButton, maximizeButton.width / 2, maximizeButton.height / 2);
17251729 tryCompare(appDelegate, "state", "maximized");
17261730 tryCompare(PanelState, "buttonsVisible", true)