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

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

Issue 6518012: Use case-insensitive comparison when comparing JIDs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/remoting/host
Patch Set: addressed comments Created 9 years, 10 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
« no previous file with comments | « remoting/host/access_verifier.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/ref_counted.h" 5 #include "base/ref_counted.h"
6 #include "base/task.h" 6 #include "base/task.h"
7 #include "remoting/host/access_verifier.h" 7 #include "remoting/host/access_verifier.h"
8 #include "remoting/host/in_memory_host_config.h" 8 #include "remoting/host/in_memory_host_config.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 20 matching lines...) Expand all
31 TEST_F(AccessVerifierTest, InvalidConfig) { 31 TEST_F(AccessVerifierTest, InvalidConfig) {
32 AccessVerifier target; 32 AccessVerifier target;
33 EXPECT_FALSE(target.Init(config_)); 33 EXPECT_FALSE(target.Init(config_));
34 } 34 }
35 35
36 TEST_F(AccessVerifierTest, VerifyPermissions) { 36 TEST_F(AccessVerifierTest, VerifyPermissions) {
37 AccessVerifier target; 37 AccessVerifier 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_FALSE(target.VerifyPermissions("host@domain.com", "")); 42 EXPECT_FALSE(target.VerifyPermissions("host@domain.com", ""));
42 EXPECT_FALSE(target.VerifyPermissions("otherhost@domain.com/123123", "")); 43 EXPECT_FALSE(target.VerifyPermissions("otherhost@domain.com/123123", ""));
43 EXPECT_FALSE(target.VerifyPermissions("host@otherdomain.com/123123", "")); 44 EXPECT_FALSE(target.VerifyPermissions("host@otherdomain.com/123123", ""));
44 EXPECT_FALSE(target.VerifyPermissions("", "")); 45 EXPECT_FALSE(target.VerifyPermissions("", ""));
45 EXPECT_FALSE(target.VerifyPermissions("host@domain.co/saf", "")); 46 EXPECT_FALSE(target.VerifyPermissions("host@domain.co/saf", ""));
46 EXPECT_FALSE(target.VerifyPermissions("host@domain.com.other/blah", "")); 47 EXPECT_FALSE(target.VerifyPermissions("host@domain.com.other/blah", ""));
48
49 // Non ASCII string.
50 EXPECT_FALSE(target.VerifyPermissions("абв@domain.com/saf", ""));
47 } 51 }
48 52
49 } // namespace remoting 53 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/host/access_verifier.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698