summaryrefslogtreecommitdiff
path: root/uitest
diff options
context:
space:
mode:
Diffstat (limited to 'uitest')
-rw-r--r--uitest/uitest/test.py10
-rw-r--r--uitest/uitest/uihelper/guarded.py22
2 files changed, 10 insertions, 22 deletions
diff --git a/uitest/uitest/test.py b/uitest/uitest/test.py
index 8b7b5a4c98f8..15cdce4654f0 100644
--- a/uitest/uitest/test.py
+++ b/uitest/uitest/test.py
@@ -175,6 +175,16 @@ class UITest(object):
self.close_dialog_through_button(xCancelBtn)
return True
+ # Calls UITest.close_doc at exit
+ @contextmanager
+ def create_doc_in_start_center_guarded(self, app):
+ self.create_doc_in_start_center(app)
+ component = self.get_component()
+ try:
+ yield component
+ finally:
+ self.close_doc()
+
def create_doc_in_start_center(self, app):
xStartCenter = self._xUITest.getTopFocusWindow()
try:
diff --git a/uitest/uitest/uihelper/guarded.py b/uitest/uitest/uihelper/guarded.py
deleted file mode 100644
index 67a11137357d..000000000000
--- a/uitest/uitest/uihelper/guarded.py
+++ /dev/null
@@ -1,22 +0,0 @@
-# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*-
-#
-# This file is part of the LibreOffice project.
-#
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#
-
-from contextlib import contextmanager
-
-# Calls UITest.close_doc at exit
-@contextmanager
-def create_doc_in_start_center(testCase, app):
- testCase.ui_test.create_doc_in_start_center(app)
- component = testCase.ui_test.get_component()
- try:
- yield component
- finally:
- testCase.ui_test.close_doc()
-
-# vim: set shiftwidth=4 softtabstop=4 expandtab: