1 // Copyright 2014 The Chromium Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #include "extensions/common/test_util.h" 6 7 #include "extensions/common/extension.h" 8 #include "extensions/common/extension_builder.h" 9 #include "extensions/common/value_builder.h" 10 11 namespace extensions { 12 namespace test_util { 13 14 ExtensionBuilder& BuildExtension(ExtensionBuilder& builder) { 15 return builder 16 .SetManifest(DictionaryBuilder() 17 .Set("name", "Test extension") 18 .Set("version", "1.0") 19 .Set("manifest_version", 2)); 20 } 21 22 scoped_refptr<Extension> CreateEmptyExtension() { 23 return ExtensionBuilder() 24 .SetManifest( 25 DictionaryBuilder().Set("name", "Test").Set("version", "1.0")) 26 .Build(); 27 } 28 29 scoped_refptr<Extension> CreateEmptyExtension(const std::string& id) { 30 return ExtensionBuilder() 31 .SetManifest( 32 DictionaryBuilder().Set("name", "test").Set("version", "0.1")) 33 .SetID(id) 34 .Build(); 35 } 36 37 } // namespace test_util 38 } // namespace extensions 39