OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "chrome/browser/extensions/test_extension_prefs.h" | 5 #include "chrome/browser/extensions/test_extension_prefs.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 FilePath path = extensions_dir_.AppendASCII(name); | 136 FilePath path = extensions_dir_.AppendASCII(name); |
137 std::string errors; | 137 std::string errors; |
138 scoped_refptr<Extension> extension = Extension::Create( | 138 scoped_refptr<Extension> extension = Extension::Create( |
139 path, location, manifest, extra_flags, &errors); | 139 path, location, manifest, extra_flags, &errors); |
140 EXPECT_TRUE(extension) << errors; | 140 EXPECT_TRUE(extension) << errors; |
141 if (!extension) | 141 if (!extension) |
142 return NULL; | 142 return NULL; |
143 | 143 |
144 EXPECT_TRUE(Extension::IdIsValid(extension->id())); | 144 EXPECT_TRUE(Extension::IdIsValid(extension->id())); |
145 prefs_->OnExtensionInstalled(extension, Extension::ENABLED, | 145 prefs_->OnExtensionInstalled(extension, Extension::ENABLED, |
146 extra_flags & Extension::FROM_WEBSTORE, | 146 extra_flags & Extension::FROM_WEBSTORE, 0); |
147 StringOrdinal::CreateInitialOrdinal()); | |
148 return extension; | 147 return extension; |
149 } | 148 } |
150 | 149 |
151 std::string TestExtensionPrefs::AddExtensionAndReturnId(std::string name) { | 150 std::string TestExtensionPrefs::AddExtensionAndReturnId(std::string name) { |
152 scoped_refptr<Extension> extension(AddExtension(name)); | 151 scoped_refptr<Extension> extension(AddExtension(name)); |
153 return extension->id(); | 152 return extension->id(); |
154 } | 153 } |
155 | 154 |
156 PrefService* TestExtensionPrefs::CreateIncognitoPrefService() const { | 155 PrefService* TestExtensionPrefs::CreateIncognitoPrefService() const { |
157 return pref_service_->CreateIncognitoPrefService( | 156 return pref_service_->CreateIncognitoPrefService( |
158 new ExtensionPrefStore(extension_pref_value_map_.get(), true)); | 157 new ExtensionPrefStore(extension_pref_value_map_.get(), true)); |
159 } | 158 } |
160 | 159 |
161 void TestExtensionPrefs::set_extensions_disabled(bool extensions_disabled) { | 160 void TestExtensionPrefs::set_extensions_disabled(bool extensions_disabled) { |
162 extensions_disabled_ = extensions_disabled; | 161 extensions_disabled_ = extensions_disabled; |
163 } | 162 } |
OLD | NEW |