Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(294)

Side by Side Diff: core/fpdfapi/fpdf_parser/cpdf_security_handler_embeddertest.cpp

Issue 2392603004: Move core/fpdfapi/fpdf_parser to core/fpdfapi/parser (Closed)
Patch Set: Rebase to master Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2016 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "testing/embedder_test.h"
6 #include "testing/gtest/include/gtest/gtest.h"
7
8 class CPDFSecurityHandlerEmbeddertest : public EmbedderTest {};
9
10 TEST_F(CPDFSecurityHandlerEmbeddertest, Unencrypted) {
11 ASSERT_TRUE(OpenDocument("about_blank.pdf"));
12 EXPECT_EQ(0xFFFFFFFF, FPDF_GetDocPermissions(document()));
13 }
14
15 TEST_F(CPDFSecurityHandlerEmbeddertest, UnencryptedWithPassword) {
16 ASSERT_TRUE(OpenDocument("about_blank.pdf", "foobar"));
17 EXPECT_EQ(0xFFFFFFFF, FPDF_GetDocPermissions(document()));
18 }
19
20 TEST_F(CPDFSecurityHandlerEmbeddertest, NoPassword) {
21 EXPECT_FALSE(OpenDocument("encrypted.pdf"));
22 }
23
24 TEST_F(CPDFSecurityHandlerEmbeddertest, UserPassword) {
25 ASSERT_TRUE(OpenDocument("encrypted.pdf", "1234"));
26 EXPECT_EQ(0xFFFFF2C0, FPDF_GetDocPermissions(document()));
27 }
28
29 TEST_F(CPDFSecurityHandlerEmbeddertest, OwnerPassword) {
30 ASSERT_TRUE(OpenDocument("encrypted.pdf", "5678"));
31 EXPECT_EQ(0xFFFFFFFC, FPDF_GetDocPermissions(document()));
32 }
OLDNEW
« no previous file with comments | « core/fpdfapi/fpdf_parser/cpdf_security_handler.cpp ('k') | core/fpdfapi/fpdf_parser/cpdf_simple_parser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698