OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <vector> | 5 #include <vector> |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "base/message_loop/message_loop_proxy.h" | 10 #include "base/message_loop/message_loop_proxy.h" |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 | 154 |
155 TEST_F(CloudPolicyValidatorTest, SuccessfulRunValidationWithNoDMTokens) { | 155 TEST_F(CloudPolicyValidatorTest, SuccessfulRunValidationWithNoDMTokens) { |
156 existing_dm_token_.clear(); | 156 existing_dm_token_.clear(); |
157 policy_.policy_data().clear_request_token(); | 157 policy_.policy_data().clear_request_token(); |
158 ignore_missing_dm_token_ = CloudPolicyValidatorBase::DM_TOKEN_NOT_REQUIRED; | 158 ignore_missing_dm_token_ = CloudPolicyValidatorBase::DM_TOKEN_NOT_REQUIRED; |
159 Validate(Invoke(this, &CloudPolicyValidatorTest::CheckSuccessfulValidation)); | 159 Validate(Invoke(this, &CloudPolicyValidatorTest::CheckSuccessfulValidation)); |
160 } | 160 } |
161 | 161 |
162 TEST_F(CloudPolicyValidatorTest, UsernameCanonicalization) { | 162 TEST_F(CloudPolicyValidatorTest, UsernameCanonicalization) { |
163 policy_.policy_data().set_username( | 163 policy_.policy_data().set_username( |
164 StringToUpperASCII(std::string(PolicyBuilder::kFakeUsername))); | 164 base::StringToUpperASCII(std::string(PolicyBuilder::kFakeUsername))); |
165 Validate(CheckStatus(CloudPolicyValidatorBase::VALIDATION_OK)); | 165 Validate(CheckStatus(CloudPolicyValidatorBase::VALIDATION_OK)); |
166 } | 166 } |
167 | 167 |
168 TEST_F(CloudPolicyValidatorTest, ErrorNoPolicyType) { | 168 TEST_F(CloudPolicyValidatorTest, ErrorNoPolicyType) { |
169 policy_.policy_data().clear_policy_type(); | 169 policy_.policy_data().clear_policy_type(); |
170 Validate(CheckStatus(CloudPolicyValidatorBase::VALIDATION_WRONG_POLICY_TYPE)); | 170 Validate(CheckStatus(CloudPolicyValidatorBase::VALIDATION_WRONG_POLICY_TYPE)); |
171 } | 171 } |
172 | 172 |
173 TEST_F(CloudPolicyValidatorTest, ErrorWrongPolicyType) { | 173 TEST_F(CloudPolicyValidatorTest, ErrorWrongPolicyType) { |
174 policy_.policy_data().set_policy_type("invalid"); | 174 policy_.policy_data().set_policy_type("invalid"); |
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
378 | 378 |
379 TEST_F(CloudPolicyValidatorTest, NoRotation) { | 379 TEST_F(CloudPolicyValidatorTest, NoRotation) { |
380 allow_key_rotation_ = false; | 380 allow_key_rotation_ = false; |
381 policy_.UnsetNewSigningKey(); | 381 policy_.UnsetNewSigningKey(); |
382 Validate(CheckStatus(CloudPolicyValidatorBase::VALIDATION_OK)); | 382 Validate(CheckStatus(CloudPolicyValidatorBase::VALIDATION_OK)); |
383 } | 383 } |
384 | 384 |
385 } // namespace | 385 } // namespace |
386 | 386 |
387 } // namespace policy | 387 } // namespace policy |
OLD | NEW |