Skip to content

Commit

Permalink
flutter: fix 1 test
Browse files Browse the repository at this point in the history
  • Loading branch information
iamsergio committed Apr 22, 2024
1 parent 7176dae commit e4dc5d2
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tests/tst_docks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -211,11 +211,12 @@ KDDW_QCORO_TASK tst_hasPreviousDockedLocation()
KDDW_QCORO_TASK tst_hasPreviousDockedLocation2()
{
// Tests with LayoutSaver
EnsureTopLevelsDeleted e;

QByteArray saved;

// #1 Tests after a restore
{
EnsureTopLevelsDeleted e;
auto m = createMainWindow(Size(501, 500), MainWindowOption_None, "mainWindow1");
auto dock1 = createDockWidget("1");
CHECK(!dock1->hasPreviousDockedLocation());
Expand All @@ -234,6 +235,7 @@ KDDW_QCORO_TASK tst_hasPreviousDockedLocation2()

// #2. Tests after a restore but with a fresh main window
{
EnsureTopLevelsDeleted e;
auto m = createMainWindow(Size(501, 500), MainWindowOption_None, "mainWindow1");
auto dock1 = createDockWidget("1");
CHECK(!dock1->hasPreviousDockedLocation());
Expand All @@ -246,6 +248,7 @@ KDDW_QCORO_TASK tst_hasPreviousDockedLocation2()

// #3. Tests after a restore but with a fresh main window
{
EnsureTopLevelsDeleted e;
auto m = createMainWindow(Size(501, 500), MainWindowOption_None, "mainWindow1");
LayoutSaver saver;
saver.restoreLayout(saved);
Expand All @@ -258,6 +261,7 @@ KDDW_QCORO_TASK tst_hasPreviousDockedLocation2()
// #4. Tests with StartHidden
QByteArray saved2;
{
EnsureTopLevelsDeleted e;
auto m = createMainWindow(Size(501, 500), MainWindowOption_None, "mainWindow2");
auto dock2 = createDockWidget("2", Platform::instance()->tests_createView({ true, {}, { 100, 100 } }), {}, {}, false);
CHECK(dock2->isFloating());
Expand All @@ -270,6 +274,7 @@ KDDW_QCORO_TASK tst_hasPreviousDockedLocation2()
}

{
EnsureTopLevelsDeleted e;
auto m = createMainWindow(Size(501, 500), MainWindowOption_None, "mainWindow2");
auto dock2 = createDockWidget("2", Platform::instance()->tests_createView({ true, {}, { 100, 100 } }), {}, {}, false);

Expand Down

0 comments on commit e4dc5d2

Please sign in to comment.