| 1 |
# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*- |
| 2 |
# |
| 3 |
# This file is part of the LibreOffice project. |
| 4 |
# |
| 5 |
# This Source Code Form is subject to the terms of the Mozilla Public |
| 6 |
# License, v. 2.0. If a copy of the MPL was not distributed with this |
| 7 |
# file, You can obtain one at http://mozilla.org/MPL/2.0/. |
| 8 |
# |
| 9 |
from uitest.framework import UITestCase |
| 10 |
from uitest.uihelper.common import get_url_for_data_file |
| 11 |
from libreoffice.uno.propertyvalue import mkPropertyValues |
| 12 |
|
| 13 |
#Bug 144943 - FILEOPEN PPTX Read-only passwords on PPTX files are not working |
| 14 |
|
| 15 |
class tdf144943(UITestCase): |
| 16 |
|
| 17 |
def test_tdf144943(self): |
| 18 |
with self.ui_test.load_file(get_url_for_data_file("tdf144943.pptx")): |
| 19 |
document = self.ui_test.get_component() |
| 20 |
|
| 21 |
# Without the fix in place, this test would have failed with |
| 22 |
# AssertionError: False is not true |
| 23 |
self.assertTrue(document.isReadonly()) |
| 24 |
|
| 25 |
with self.ui_test.execute_dialog_through_command(".uno:EditDoc") as xDialog: |
| 26 |
xPassword = xDialog.getChild("newpassEntry") |
| 27 |
xPassword.executeAction("TYPE", mkPropertyValues({"TEXT": "password"})) |
| 28 |
|
| 29 |
self.assertFalse(document.isReadonly()) |
| 30 |
|
| 31 |
# vim: set shiftwidth=4 softtabstop=4 expandtab: |