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

Side by Side Diff: extensions/renderer/api_binding_test_util.cc

Issue 2598123002: [Extensions Bindings] Add support for updateArgumentsPreValidate (Closed)
Patch Set: . Created 3 years, 12 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
OLDNEW
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 #include "extensions/renderer/api_binding_test_util.h" 5 #include "extensions/renderer/api_binding_test_util.h"
6 6
7 #include "base/json/json_reader.h" 7 #include "base/json/json_reader.h"
8 #include "base/json/json_writer.h" 8 #include "base/json/json_writer.h"
9 #include "base/strings/string_util.h" 9 #include "base/strings/string_util.h"
10 #include "base/values.h" 10 #include "base/values.h"
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 return RunFunction(function, context, context->Global(), argc, argv); 128 return RunFunction(function, context, context->Global(), argc, argv);
129 } 129 }
130 130
131 void RunFunctionOnGlobalAndIgnoreResult(v8::Local<v8::Function> function, 131 void RunFunctionOnGlobalAndIgnoreResult(v8::Local<v8::Function> function,
132 v8::Local<v8::Context> context, 132 v8::Local<v8::Context> context,
133 int argc, 133 int argc,
134 v8::Local<v8::Value> argv[]) { 134 v8::Local<v8::Value> argv[]) {
135 RunFunction(function, context, context->Global(), argc, argv); 135 RunFunction(function, context, context->Global(), argc, argv);
136 } 136 }
137 137
138 v8::Global<v8::Value> RunFunctionOnGlobalAndReturnHandle(
139 v8::Local<v8::Function> function,
140 v8::Local<v8::Context> context,
141 int argc,
142 v8::Local<v8::Value> argv[]) {
143 return v8::Global<v8::Value>(
144 context->GetIsolate(),
145 RunFunction(function, context, context->Global(), argc, argv));
146 }
147
138 void RunFunctionAndExpectError(v8::Local<v8::Function> function, 148 void RunFunctionAndExpectError(v8::Local<v8::Function> function,
139 v8::Local<v8::Context> context, 149 v8::Local<v8::Context> context,
140 v8::Local<v8::Value> receiver, 150 v8::Local<v8::Value> receiver,
141 int argc, 151 int argc,
142 v8::Local<v8::Value> argv[], 152 v8::Local<v8::Value> argv[],
143 const std::string& expected_error) { 153 const std::string& expected_error) {
144 std::string error; 154 std::string error;
145 v8::Local<v8::Value> result; 155 v8::Local<v8::Value> result;
146 EXPECT_FALSE(RunFunctionImpl(function, context, receiver, argc, argv, &result, 156 EXPECT_FALSE(RunFunctionImpl(function, context, receiver, argc, argv, &result,
147 &error)); 157 &error));
(...skipping 21 matching lines...) Expand all
169 } 179 }
170 180
171 std::unique_ptr<base::Value> GetBaseValuePropertyFromObject( 181 std::unique_ptr<base::Value> GetBaseValuePropertyFromObject(
172 v8::Local<v8::Object> object, 182 v8::Local<v8::Object> object,
173 v8::Local<v8::Context> context, 183 v8::Local<v8::Context> context,
174 base::StringPiece key) { 184 base::StringPiece key) {
175 return V8ToBaseValue(GetPropertyFromObject(object, context, key), context); 185 return V8ToBaseValue(GetPropertyFromObject(object, context, key), context);
176 } 186 }
177 187
178 } // namespace extensions 188 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698