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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/host/self_access_verifier.cc ('k') | remoting/host/simple_host_process.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/self_access_verifier_unittest.cc
diff --git a/remoting/host/self_access_verifier_unittest.cc b/remoting/host/self_access_verifier_unittest.cc
deleted file mode 100644
index f0fd1798b6cd3dbfc9ea9c3b9c26fcc4c125298f..0000000000000000000000000000000000000000
--- a/remoting/host/self_access_verifier_unittest.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "base/memory/ref_counted.h"
-#include "base/task.h"
-#include "remoting/host/in_memory_host_config.h"
-#include "remoting/host/self_access_verifier.h"
-#include "testing/gmock/include/gmock/gmock.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-namespace remoting {
-
-namespace {
-const char kTestJid[] = "host@domain.com";
-} // namespace
-
-class SelfAccessVerifierTest : public testing::Test {
- protected:
- virtual void SetUp() {
- config_ = new InMemoryHostConfig();
- }
-
- void InitConfig() {
- config_->SetString(kXmppLoginConfigPath, kTestJid);
- }
-
- scoped_refptr<InMemoryHostConfig> config_;
-};
-
-TEST_F(SelfAccessVerifierTest, InvalidConfig) {
- SelfAccessVerifier target;
- EXPECT_FALSE(target.Init(config_));
-}
-
-TEST_F(SelfAccessVerifierTest, VerifyPermissions) {
- SelfAccessVerifier target;
- InitConfig();
- ASSERT_TRUE(target.Init(config_));
- EXPECT_TRUE(target.VerifyPermissions("host@domain.com/123123", ""));
- EXPECT_TRUE(target.VerifyPermissions("hOsT@domain.com/123123", ""));
- EXPECT_FALSE(target.VerifyPermissions("host@domain.com", ""));
- EXPECT_FALSE(target.VerifyPermissions("otherhost@domain.com/123123", ""));
- EXPECT_FALSE(target.VerifyPermissions("host@otherdomain.com/123123", ""));
- EXPECT_FALSE(target.VerifyPermissions("", ""));
- EXPECT_FALSE(target.VerifyPermissions("host@domain.co/saf", ""));
- EXPECT_FALSE(target.VerifyPermissions("host@domain.com.other/blah", ""));
-
- // Non ASCII string.
- EXPECT_FALSE(target.VerifyPermissions("абв@domain.com/saf", ""));
-}
-
-} // namespace remoting
« no previous file with comments | « remoting/host/self_access_verifier.cc ('k') | remoting/host/simple_host_process.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698