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 3// found in the LICENSE file. 4 5#ifndef CHROME_COMMON_EXTENSIONS_EXTENSION_TEST_UTIL_H_ 6#define CHROME_COMMON_EXTENSIONS_EXTENSION_TEST_UTIL_H_ 7 8#include <string> 9 10#include "base/memory/ref_counted.h" 11#include "extensions/common/manifest.h" 12 13namespace extensions { 14class Extension; 15} 16 17// Newer functions go in extensions/common/test_util.h. 18namespace extension_test_util { 19 20// Helpers for loading manifests, |dir| is relative to chrome::DIR_TEST_DATA 21// followed by "extensions". 22scoped_refptr<extensions::Extension> LoadManifestUnchecked( 23 const std::string& dir, 24 const std::string& test_file, 25 extensions::Manifest::Location location, 26 int extra_flags, 27 const std::string& id, 28 std::string* error); 29 30scoped_refptr<extensions::Extension> LoadManifestUnchecked( 31 const std::string& dir, 32 const std::string& test_file, 33 extensions::Manifest::Location location, 34 int extra_flags, 35 std::string* error); 36 37scoped_refptr<extensions::Extension> LoadManifest( 38 const std::string& dir, 39 const std::string& test_file, 40 extensions::Manifest::Location location, 41 int extra_flags); 42 43scoped_refptr<extensions::Extension> LoadManifest(const std::string& dir, 44 const std::string& test_file, 45 int extra_flags); 46 47scoped_refptr<extensions::Extension> LoadManifestStrict( 48 const std::string& dir, 49 const std::string& test_file); 50 51scoped_refptr<extensions::Extension> LoadManifest(const std::string& dir, 52 const std::string& test_file); 53 54} // namespace extension_test_util 55 56#endif // CHROME_COMMON_EXTENSIONS_EXTENSION_TEST_UTIL_H_ 57