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

Side by Side Diff: webkit/chromeos/fileapi/file_access_permissions_unittest.cc

Issue 14304004: Convert a bunch of test_shell_tests to content_browsertests. These are tests that depend on loading… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: sync Created 7 years, 8 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "webkit/chromeos/fileapi/file_access_permissions.h" 5 #include "webkit/chromeos/fileapi/file_access_permissions.h"
6 #include "testing/gtest/include/gtest/gtest.h" 6 #include "testing/gtest/include/gtest/gtest.h"
7 7
8 8
9 class FileAccessPermissionsTest : public testing::Test { 9 class FileAccessPermissionsTest : public testing::Test {
10 }; 10 };
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 EXPECT_FALSE(permissions.HasAccessPermission(extension2, good_file)); 43 EXPECT_FALSE(permissions.HasAccessPermission(extension2, good_file));
44 EXPECT_FALSE(permissions.HasAccessPermission(extension2, bad_file)); 44 EXPECT_FALSE(permissions.HasAccessPermission(extension2, bad_file));
45 45
46 46
47 // After granting file access to the handler extension for a given directory, 47 // After granting file access to the handler extension for a given directory,
48 // it can access that directory and all files within it. 48 // it can access that directory and all files within it.
49 permissions.GrantAccessPermission(extension2, good_dir); 49 permissions.GrantAccessPermission(extension2, good_dir);
50 EXPECT_FALSE(permissions.HasAccessPermission(extension1, good_dir)); 50 EXPECT_FALSE(permissions.HasAccessPermission(extension1, good_dir));
51 EXPECT_TRUE(permissions.HasAccessPermission(extension1, good_file)); 51 EXPECT_TRUE(permissions.HasAccessPermission(extension1, good_file));
52 EXPECT_FALSE(permissions.HasAccessPermission(extension1, bad_file)); 52 EXPECT_FALSE(permissions.HasAccessPermission(extension1, bad_file));
53 EXPECT_FALSE(permissions.HasAccessPermission(extension2, good_dir)); 53 EXPECT_TRUE(permissions.HasAccessPermission(extension2, good_dir));
54 EXPECT_FALSE(permissions.HasAccessPermission(extension2, good_file)); 54 EXPECT_TRUE(permissions.HasAccessPermission(extension2, good_file));
55 EXPECT_FALSE(permissions.HasAccessPermission(extension2, bad_file)); 55 EXPECT_TRUE(permissions.HasAccessPermission(extension2, bad_file));
56 56
57 // After revoking rights for extensions, they should not be able to access 57 // After revoking rights for extensions, they should not be able to access
58 // any file system element anymore. 58 // any file system element anymore.
59 permissions.RevokePermissions(extension1); 59 permissions.RevokePermissions(extension1);
60 permissions.RevokePermissions(extension2); 60 permissions.RevokePermissions(extension2);
61 EXPECT_FALSE(permissions.HasAccessPermission(extension1, good_dir)); 61 EXPECT_FALSE(permissions.HasAccessPermission(extension1, good_dir));
62 EXPECT_FALSE(permissions.HasAccessPermission(extension1, good_file)); 62 EXPECT_FALSE(permissions.HasAccessPermission(extension1, good_file));
63 EXPECT_FALSE(permissions.HasAccessPermission(extension1, bad_file)); 63 EXPECT_FALSE(permissions.HasAccessPermission(extension1, bad_file));
64 EXPECT_FALSE(permissions.HasAccessPermission(extension2, good_dir)); 64 EXPECT_FALSE(permissions.HasAccessPermission(extension2, good_dir));
65 EXPECT_FALSE(permissions.HasAccessPermission(extension2, good_file)); 65 EXPECT_FALSE(permissions.HasAccessPermission(extension2, good_file));
66 EXPECT_FALSE(permissions.HasAccessPermission(extension2, bad_file)); 66 EXPECT_FALSE(permissions.HasAccessPermission(extension2, bad_file));
67 } 67 }
OLDNEW
« no previous file with comments | « webkit/chromeos/fileapi/file_access_permissions.h ('k') | webkit/chromeos/fileapi/memory_file_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698