scheduler: Always create a real scheduler in unit tests
[chromium-blink-merge.git] / gin / BUILD.gn
blob793ee3d8fa7999931b584ab5a97708fc9c2d880e
1 # Copyright 2014 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.
5 import("//build/module_args/v8.gni")
6 import("//testing/test.gni")
8 component("gin") {
9   sources = [
10     "arguments.cc",
11     "arguments.h",
12     "array_buffer.cc",
13     "array_buffer.h",
14     "context_holder.cc",
15     "converter.cc",
16     "converter.h",
17     "debug_impl.cc",
18     "debug_impl.h",
19     "dictionary.cc",
20     "dictionary.h",
21     "function_template.cc",
22     "function_template.h",
23     "gin_export.h",
24     "handle.h",
25     "interceptor.cc",
26     "interceptor.h",
27     "isolate_holder.cc",
28     "modules/console.cc",
29     "modules/console.h",
30     "modules/file_module_provider.cc",
31     "modules/file_module_provider.h",
32     "modules/module_registry.cc",
33     "modules/module_registry.h",
34     "modules/module_registry_observer.h",
35     "modules/module_runner_delegate.cc",
36     "modules/module_runner_delegate.h",
37     "modules/timer.cc",
38     "modules/timer.h",
39     "object_template_builder.cc",
40     "object_template_builder.h",
41     "per_context_data.cc",
42     "per_context_data.h",
43     "per_isolate_data.cc",
44     "per_isolate_data.h",
45     "public/context_holder.h",
46     "public/debug.h",
47     "public/gin_embedders.h",
48     "public/isolate_holder.h",
49     "public/v8_platform.h",
50     "public/wrapper_info.h",
51     "run_microtasks_observer.cc",
52     "run_microtasks_observer.h",
53     "runner.cc",
54     "runner.h",
55     "shell_runner.cc",
56     "shell_runner.h",
57     "try_catch.cc",
58     "try_catch.h",
59     "v8_initializer.cc",
60     "v8_initializer.h",
61     "v8_isolate_memory_dump_provider.cc",
62     "v8_isolate_memory_dump_provider.h",
63     "v8_platform.cc",
64     "wrappable.cc",
65     "wrappable.h",
66     "wrapper_info.cc",
67   ]
69   defines = [ "GIN_IMPLEMENTATION" ]
71   public_deps = [
72     "//base",
73     "//v8",
74   ]
75   deps = [
76     "//base/third_party/dynamic_annotations",
77   ]
78   if (v8_use_external_startup_data && is_win) {
79     public_deps += [ ":gin_v8_snapshot_fingerprint" ]
80     deps += [ "//crypto:crypto" ]
81     sources += [ "$target_gen_dir/v8_snapshot_fingerprint.cc" ]
82     defines += [ "V8_VERIFY_EXTERNAL_STARTUP_DATA" ]
83   }
86 if (v8_use_external_startup_data) {
87   action("gin_v8_snapshot_fingerprint") {
88     script = "//gin/fingerprint/fingerprint_v8_snapshot.py"
90     snapshot_file = "$root_build_dir/snapshot_blob.bin"
91     natives_file = "$root_build_dir/natives_blob.bin"
92     output_file = "$target_gen_dir/v8_snapshot_fingerprint.cc"
94     args = [
95       "--snapshot_file",
96       rebase_path(snapshot_file, root_build_dir),
97       "--natives_file",
98       rebase_path(natives_file, root_build_dir),
99       "--output_file",
100       rebase_path(output_file, root_build_dir),
101     ]
102     inputs = [
103       snapshot_file,
104       natives_file,
105     ]
106     outputs = [
107       output_file,
108     ]
110     deps = [
111       "//v8",
112     ]
113   }
116 executable("gin_shell") {
117   sources = [
118     "shell/gin_main.cc",
119   ]
121   deps = [
122     ":gin",
123     "//base",
124     "//base:i18n",
125     "//v8",
126   ]
129 source_set("gin_test") {
130   testonly = true
131   sources = [
132     "test/file.cc",
133     "test/file.h",
134     "test/file_runner.cc",
135     "test/file_runner.h",
136     "test/gc.cc",
137     "test/gc.h",
138     "test/gtest.cc",
139     "test/gtest.h",
140     "test/v8_test.cc",
141     "test/v8_test.h",
142   ]
144   public_deps = [
145     ":gin",
146     "//testing/gtest",
147   ]
148   deps = [
149     "//v8",
150   ]
153 test("gin_unittests") {
154   sources = [
155     "converter_unittest.cc",
156     "interceptor_unittest.cc",
157     "modules/module_registry_unittest.cc",
158     "modules/timer_unittest.cc",
159     "per_context_data_unittest.cc",
160     "shell/gin_shell_unittest.cc",
161     "shell_runner_unittest.cc",
162     "test/run_all_unittests.cc",
163     "test/run_js_tests.cc",
164     "wrappable_unittest.cc",
165   ]
167   deps = [
168     ":gin_test",
169     "//base/test:test_support",
170     "//v8",
171   ]