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

Side by Side Diff: chrome/browser/extensions/external_policy_extension_provider_unittest.cc

Issue 5535002: Decouple killbit testing from external extension providers (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: update Created 10 years 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) 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
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698