OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 EXTENSIONS_RENDERER_API_BINDING_TEST_UTIL_H_ | 5 #ifndef EXTENSIONS_RENDERER_API_BINDING_TEST_UTIL_H_ |
6 #define EXTENSIONS_RENDERER_API_BINDING_TEST_UTIL_H_ | 6 #define EXTENSIONS_RENDERER_API_BINDING_TEST_UTIL_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 v8::Local<v8::Value> GetPropertyFromObject(v8::Local<v8::Object> object, | 99 v8::Local<v8::Value> GetPropertyFromObject(v8::Local<v8::Object> object, |
100 v8::Local<v8::Context> context, | 100 v8::Local<v8::Context> context, |
101 base::StringPiece key); | 101 base::StringPiece key); |
102 | 102 |
103 // As above, but converts the result to a base::Value. | 103 // As above, but converts the result to a base::Value. |
104 std::unique_ptr<base::Value> GetBaseValuePropertyFromObject( | 104 std::unique_ptr<base::Value> GetBaseValuePropertyFromObject( |
105 v8::Local<v8::Object> object, | 105 v8::Local<v8::Object> object, |
106 v8::Local<v8::Context> context, | 106 v8::Local<v8::Context> context, |
107 base::StringPiece key); | 107 base::StringPiece key); |
108 | 108 |
| 109 // As above, but returns a JSON-serialized version of the value, or |
| 110 // "undefined", "null", "function", or "empty". |
| 111 std::string GetStringPropertyFromObject(v8::Local<v8::Object> object, |
| 112 v8::Local<v8::Context> context, |
| 113 base::StringPiece key); |
| 114 |
109 } // extensions | 115 } // extensions |
110 | 116 |
111 #endif // EXTENSIONS_RENDERER_API_BINDING_TEST_UTIL_H_ | 117 #endif // EXTENSIONS_RENDERER_API_BINDING_TEST_UTIL_H_ |
OLD | NEW |