OLD | NEW |
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 #include "chrome/test/base/module_system_test.h" | 5 #include "chrome/test/base/module_system_test.h" |
6 | 6 |
7 #include "base/callback.h" | 7 #include "base/callback.h" |
8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
12 #include "base/path_service.h" | 12 #include "base/path_service.h" |
13 #include "base/stl_util.h" | 13 #include "base/stl_util.h" |
14 #include "base/strings/string_piece.h" | 14 #include "base/strings/string_piece.h" |
15 #include "chrome/common/chrome_paths.h" | 15 #include "chrome/common/chrome_paths.h" |
16 #include "chrome/renderer/extensions/chrome_v8_context.h" | 16 #include "chrome/renderer/extensions/chrome_v8_context.h" |
17 #include "chrome/renderer/extensions/logging_native_handler.h" | 17 #include "chrome/renderer/extensions/logging_native_handler.h" |
18 #include "chrome/renderer/extensions/object_backed_native_handler.h" | |
19 #include "chrome/renderer/extensions/safe_builtins.h" | |
20 #include "chrome/renderer/extensions/utils_native_handler.h" | 18 #include "chrome/renderer/extensions/utils_native_handler.h" |
| 19 #include "extensions/renderer/object_backed_native_handler.h" |
| 20 #include "extensions/renderer/safe_builtins.h" |
21 #include "ui/base/resource/resource_bundle.h" | 21 #include "ui/base/resource/resource_bundle.h" |
22 | 22 |
23 #include <map> | 23 #include <map> |
24 #include <string> | 24 #include <string> |
25 | 25 |
26 using extensions::ModuleSystem; | 26 using extensions::ModuleSystem; |
27 using extensions::NativeHandler; | 27 using extensions::NativeHandler; |
28 using extensions::ObjectBackedNativeHandler; | 28 using extensions::ObjectBackedNativeHandler; |
29 | 29 |
30 namespace { | 30 namespace { |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 } | 197 } |
198 | 198 |
199 v8::Handle<v8::Object> ModuleSystemTest::CreateGlobal(const std::string& name) { | 199 v8::Handle<v8::Object> ModuleSystemTest::CreateGlobal(const std::string& name) { |
200 v8::Isolate* isolate = v8::Isolate::GetCurrent(); | 200 v8::Isolate* isolate = v8::Isolate::GetCurrent(); |
201 v8::EscapableHandleScope handle_scope(isolate); | 201 v8::EscapableHandleScope handle_scope(isolate); |
202 v8::Local<v8::Object> object = v8::Object::New(isolate); | 202 v8::Local<v8::Object> object = v8::Object::New(isolate); |
203 isolate->GetCurrentContext()->Global()->Set( | 203 isolate->GetCurrentContext()->Global()->Set( |
204 v8::String::NewFromUtf8(isolate, name.c_str()), object); | 204 v8::String::NewFromUtf8(isolate, name.c_str()), object); |
205 return handle_scope.Escape(object); | 205 return handle_scope.Escape(object); |
206 } | 206 } |
OLD | NEW |