@@ -856,8 +856,6 @@ Item {
856856 function test_saveRestoreMaximized() {
857857 var originalWindowCount = topSurfaceList.count;
858858 var appDelegate = startApplication("dialer-app");
859− var decoratedWindow = findChild(appDelegate, "decoratedWindow");
860− verify(decoratedWindow);
861859 compare(topSurfaceList.count, originalWindowCount + 1);
862860
863861 var initialWindowX = appDelegate.windowedX;
@@ -870,14 +868,9 @@ Item {
870868
871869 // Now change the state to maximized. The window should not keep updating the stored values
872870 maximizeAppDelegate(appDelegate);
873− decoratedWindow.windowControlButtonsVisible = true;
874871
875872 // Close the window and restart the application
876− var closeButton = findChild(appDelegate, "closeWindowButton");
877− appDelegate = null;
878− verify(closeButton);
879− mouseClick(closeButton);
880− closeButton = null;
873+ appDelegate.close();
881874 tryCompare(topSurfaceList, "count", originalWindowCount);
882875 wait(100); // plus some spare room
883876 appDelegate = startApplication("dialer-app");