1 // Copyright 2011 The Emscripten Authors. All rights reserved. 2 // Emscripten is available under two separate licenses, the MIT license and the 3 // University of Illinois/NCSA Open Source License. Both these licenses can be 4 // found in the LICENSE file. 5 6 #include <QtTest/QtTest> 7 8 #include <poppler-qt4.h> 9 10 class TestPermissions: public QObject 11 { 12 Q_OBJECT 13 private slots: 14 void permissions1(); 15 }; 16 permissions1()17void TestPermissions::permissions1() 18 { 19 Poppler::Document *doc; 20 doc = Poppler::Document::load("../../../test/unittestcases/orientation.pdf"); 21 QVERIFY( doc ); 22 23 // we are allowed to print 24 QVERIFY( doc->okToPrint() ); 25 26 // we are not allowed to change 27 QVERIFY( !(doc->okToChange()) ); 28 29 // we are not allowed to copy or extract content 30 QVERIFY( !(doc->okToCopy()) ); 31 32 // we are not allowed to print at high resolution 33 QVERIFY( !(doc->okToPrintHighRes()) ); 34 35 // we are not allowed to fill forms 36 QVERIFY( !(doc->okToFillForm()) ); 37 38 // we are allowed to extract content for accessibility 39 QVERIFY( doc->okToExtractForAccessibility() ); 40 41 // we are allowed to assemble this document 42 QVERIFY( doc->okToAssemble() ); 43 44 delete doc; 45 } 46 47 QTEST_MAIN(TestPermissions) 48 #include "check_permissions.moc" 49 50