| OLD | NEW |
| 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 <string> | 5 #include <string> |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/values.h" | 8 #include "base/values.h" |
| 9 #include "base/version.h" | 9 #include "base/version.h" |
| 10 #include "chrome/browser/extensions/external_policy_extension_provider.h" | 10 #include "chrome/browser/extensions/external_policy_extension_provider.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 void Visit(ListValue* policy_forcelist, | 25 void Visit(ListValue* policy_forcelist, |
| 26 ListValue* policy_validlist, | 26 ListValue* policy_validlist, |
| 27 const std::set<std::string>& ignore_list) { | 27 const std::set<std::string>& ignore_list) { |
| 28 provider_.reset(new ExternalPolicyExtensionProvider()); | 28 provider_.reset(new ExternalPolicyExtensionProvider()); |
| 29 // Give the list extensions to the provider. | 29 // Give the list extensions to the provider. |
| 30 provider_->SetPreferences(policy_forcelist); | 30 provider_->SetPreferences(policy_forcelist); |
| 31 | 31 |
| 32 // Extensions will be removed from this list as they visited, | 32 // Extensions will be removed from this list as they visited, |
| 33 // so it should be emptied by the end. | 33 // so it should be emptied by the end. |
| 34 remaining_extensions = policy_validlist; | 34 remaining_extensions = policy_validlist; |
| 35 provider_->VisitRegisteredExtension(this, ignore_list); | 35 provider_->VisitRegisteredExtension(this); |
| 36 EXPECT_EQ(0u, remaining_extensions->GetSize()); | 36 EXPECT_EQ(0u, remaining_extensions->GetSize()); |
| 37 } | 37 } |
| 38 | 38 |
| 39 virtual void OnExternalExtensionFileFound(const std::string& id, | 39 virtual void OnExternalExtensionFileFound(const std::string& id, |
| 40 const Version* version, | 40 const Version* version, |
| 41 const FilePath& path, | 41 const FilePath& path, |
| 42 Extension::Location unused) { | 42 Extension::Location unused) { |
| 43 ADD_FAILURE() << "There should be no external extensions from files."; | 43 ADD_FAILURE() << "There should be no external extensions from files."; |
| 44 } | 44 } |
| 45 | 45 |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa;http#//www.example.com/crx")); | 104 "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa;http#//www.example.com/crx")); |
| 105 forced_extensions.Append(Value::CreateStringValue( | 105 forced_extensions.Append(Value::CreateStringValue( |
| 106 "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")); | 106 "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")); |
| 107 forced_extensions.Append(Value::CreateStringValue( | 107 forced_extensions.Append(Value::CreateStringValue( |
| 108 "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaahttp#//www.example.com/crx")); | 108 "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaahttp#//www.example.com/crx")); |
| 109 | 109 |
| 110 MockExternalPolicyExtensionProviderVisitor mv; | 110 MockExternalPolicyExtensionProviderVisitor mv; |
| 111 std::set<std::string> empty; | 111 std::set<std::string> empty; |
| 112 mv.Visit(&forced_extensions, &valid_extensions, empty); | 112 mv.Visit(&forced_extensions, &valid_extensions, empty); |
| 113 } | 113 } |
| OLD | NEW |