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

Side by Side Diff: chrome/browser/extensions/extension_function_test_utils.h

Issue 10919201: Make sure that a given app/extension requests only its own resources. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Improve tests; fix merge conflicts. Created 8 years, 3 months 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) 2012 The Chromium Authors. All rights reserved. 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 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 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_FUNCTION_TEST_UTILS_H_ 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_FUNCTION_TEST_UTILS_H_
6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_FUNCTION_TEST_UTILS_H_ 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_FUNCTION_TEST_UTILS_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 47
48 // Creates an extension instance that can be attached to an ExtensionFunction 48 // Creates an extension instance that can be attached to an ExtensionFunction
49 // before running it. 49 // before running it.
50 scoped_refptr<extensions::Extension> CreateEmptyExtension(); 50 scoped_refptr<extensions::Extension> CreateEmptyExtension();
51 51
52 // Creates an extension instance with a specified location that can be attached 52 // Creates an extension instance with a specified location that can be attached
53 // to an ExtensionFunction before running. 53 // to an ExtensionFunction before running.
54 scoped_refptr<extensions::Extension> CreateEmptyExtensionWithLocation( 54 scoped_refptr<extensions::Extension> CreateEmptyExtensionWithLocation(
55 extensions::Extension::Location location); 55 extensions::Extension::Location location);
56 56
57 // Creates an empty extension with a variable ID, for tests that require
58 // multiple extensions side-by-side having distinct IDs. If not empty, then
59 // id_input is passed directly to Extension::CreateId() and thus has the same
60 // behavior as that method. If id_input is empty, then Extension::Create()
61 // receives an empty explicit ID and generates an appropriate ID for a blank
62 // extension.
63 scoped_refptr<extensions::Extension> CreateEmptyExtension(
64 const std::string& id_input);
65
66 scoped_refptr<extensions::Extension> CreateExtension(
67 extensions::Extension::Location location,
68 base::DictionaryValue* test_extension_value,
69 const std::string& id_input);
70
57 // Creates an extension instance with a specified extension value that can be 71 // Creates an extension instance with a specified extension value that can be
58 // attached to an ExtensionFunction before running. 72 // attached to an ExtensionFunction before running.
59 scoped_refptr<extensions::Extension> CreateExtension( 73 scoped_refptr<extensions::Extension> CreateExtension(
60 base::DictionaryValue* test_extension_value); 74 base::DictionaryValue* test_extension_value);
61 75
62 scoped_refptr<extensions::Extension> CreateExtension( 76 scoped_refptr<extensions::Extension> CreateExtension(
63 extensions::Extension::Location location, 77 extensions::Extension::Location location,
64 base::DictionaryValue* test_extension_value); 78 base::DictionaryValue* test_extension_value);
65 79
66 // Returns true if |val| contains privacy information, e.g. url, 80 // Returns true if |val| contains privacy information, e.g. url,
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 // we're going to need to frob for all the different extension functions. But 120 // we're going to need to frob for all the different extension functions. But
107 // we can refactor when we see what is needed. 121 // we can refactor when we see what is needed.
108 bool RunFunction(UIThreadExtensionFunction* function, 122 bool RunFunction(UIThreadExtensionFunction* function,
109 const std::string& args, 123 const std::string& args,
110 Browser* browser, 124 Browser* browser,
111 RunFunctionFlags flags); 125 RunFunctionFlags flags);
112 126
113 } // namespace extension_function_test_utils 127 } // namespace extension_function_test_utils
114 128
115 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_FUNCTION_TEST_UTILS_H_ 129 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_FUNCTION_TEST_UTILS_H_
OLDNEW
« no previous file with comments | « chrome/browser/extensions/api/usb/usb_device_resource.cc ('k') | chrome/browser/extensions/extension_function_test_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698