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

Side by Side Diff: remoting/host/self_access_verifier_unittest.cc

Issue 8662001: Remove AccessVerifier interface. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 1 month 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 "base/memory/ref_counted.h" 5 #include "base/memory/ref_counted.h"
6 #include "base/task.h" 6 #include "base/task.h"
7 #include "remoting/host/in_memory_host_config.h" 7 #include "remoting/host/in_memory_host_config.h"
8 #include "remoting/host/self_access_verifier.h" 8 #include "remoting/host/self_access_verifier.h"
9 #include "testing/gmock/include/gmock/gmock.h" 9 #include "testing/gmock/include/gmock/gmock.h"
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
(...skipping 19 matching lines...) Expand all
30 30
31 TEST_F(SelfAccessVerifierTest, InvalidConfig) { 31 TEST_F(SelfAccessVerifierTest, InvalidConfig) {
32 SelfAccessVerifier target; 32 SelfAccessVerifier target;
33 EXPECT_FALSE(target.Init(config_)); 33 EXPECT_FALSE(target.Init(config_));
34 } 34 }
35 35
36 TEST_F(SelfAccessVerifierTest, VerifyPermissions) { 36 TEST_F(SelfAccessVerifierTest, VerifyPermissions) {
37 SelfAccessVerifier target; 37 SelfAccessVerifier target;
38 InitConfig(); 38 InitConfig();
39 ASSERT_TRUE(target.Init(config_)); 39 ASSERT_TRUE(target.Init(config_));
40 EXPECT_TRUE(target.VerifyPermissions("host@domain.com/123123", "")); 40 EXPECT_TRUE(target.VerifyPermissions("host@domain.com/123123"));
41 EXPECT_TRUE(target.VerifyPermissions("hOsT@domain.com/123123", "")); 41 EXPECT_TRUE(target.VerifyPermissions("hOsT@domain.com/123123"));
42 EXPECT_FALSE(target.VerifyPermissions("host@domain.com", "")); 42 EXPECT_FALSE(target.VerifyPermissions("host@domain.com"));
43 EXPECT_FALSE(target.VerifyPermissions("otherhost@domain.com/123123", "")); 43 EXPECT_FALSE(target.VerifyPermissions("otherhost@domain.com/123123"));
44 EXPECT_FALSE(target.VerifyPermissions("host@otherdomain.com/123123", "")); 44 EXPECT_FALSE(target.VerifyPermissions("host@otherdomain.com/123123"));
45 EXPECT_FALSE(target.VerifyPermissions("", "")); 45 EXPECT_FALSE(target.VerifyPermissions(""));
46 EXPECT_FALSE(target.VerifyPermissions("host@domain.co/saf", "")); 46 EXPECT_FALSE(target.VerifyPermissions("host@domain.co/saf"));
47 EXPECT_FALSE(target.VerifyPermissions("host@domain.com.other/blah", "")); 47 EXPECT_FALSE(target.VerifyPermissions("host@domain.com.other/blah"));
48 48
49 // Non ASCII string. 49 // Non ASCII string.
50 EXPECT_FALSE(target.VerifyPermissions("абв@domain.com/saf", "")); 50 EXPECT_FALSE(target.VerifyPermissions("абв@domain.com/saf"));
51 } 51 }
52 52
53 } // namespace remoting 53 } // namespace remoting
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698