[M120 Migration][VD] Fix url crash in RequestCertificateConfirm
[platform/framework/web/chromium-efl.git] / sql / BUILD.gn
1 # Copyright 2014 The Chromium Authors
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
4
5 import("//testing/libfuzzer/fuzzer_test.gni")
6 import("//testing/test.gni")
7
8 component("sql") {
9   sources = [
10     "database.cc",
11     "database.h",
12     "database_memory_dump_provider.cc",
13     "database_memory_dump_provider.h",
14     "error_delegate_util.cc",
15     "error_delegate_util.h",
16     "init_status.h",
17     "initialization.cc",
18     "initialization.h",
19     "internal_api_token.h",
20     "meta_table.cc",
21     "meta_table.h",
22     "recover_module/btree.cc",
23     "recover_module/btree.h",
24     "recover_module/cursor.cc",
25     "recover_module/cursor.h",
26     "recover_module/integers.cc",
27     "recover_module/integers.h",
28     "recover_module/module.cc",
29     "recover_module/module.h",
30     "recover_module/pager.cc",
31     "recover_module/pager.h",
32     "recover_module/parsing.cc",
33     "recover_module/parsing.h",
34     "recover_module/payload.cc",
35     "recover_module/payload.h",
36     "recover_module/record.cc",
37     "recover_module/record.h",
38     "recover_module/table.cc",
39     "recover_module/table.h",
40     "recovery.cc",
41     "recovery.h",
42     "sandboxed_vfs.cc",
43     "sandboxed_vfs.h",
44     "sandboxed_vfs_file.cc",
45     "sandboxed_vfs_file.h",
46     "sql_features.cc",
47     "sql_features.h",
48     "sql_memory_dump_provider.cc",
49     "sql_memory_dump_provider.h",
50     "sqlite_result_code.cc",
51     "sqlite_result_code.h",
52     "sqlite_result_code_values.cc",
53     "sqlite_result_code_values.h",
54     "statement.cc",
55     "statement.h",
56     "statement_id.cc",
57     "statement_id.h",
58     "transaction.cc",
59     "transaction.h",
60     "vfs_wrapper.cc",
61     "vfs_wrapper.h",
62   ]
63
64   defines = [ "IS_SQL_IMPL" ]
65
66   deps = [
67     "//base",
68     "//base/third_party/dynamic_annotations",
69     "//third_party/sqlite",
70   ]
71
72   # For vfs_wrapper.cc time-machine exclusions.
73   if (is_mac) {
74     frameworks = [
75       "CoreFoundation.framework",
76       "CoreServices.framework",
77     ]
78   }
79
80   if (is_fuchsia) {
81     sources += [
82       "vfs_wrapper_fuchsia.cc",
83       "vfs_wrapper_fuchsia.h",
84     ]
85   }
86 }
87
88 static_library("test_support") {
89   testonly = true
90   sources = [
91     "test/scoped_error_expecter.cc",
92     "test/scoped_error_expecter.h",
93     "test/test_helpers.cc",
94     "test/test_helpers.h",
95   ]
96
97   public_deps = [ ":sql" ]
98   deps = [
99     "//base",
100     "//testing/gtest",
101     "//third_party/sqlite",
102   ]
103 }
104
105 bundle_data("sql_unittests_bundle_data") {
106   testonly = true
107   sources = [ "test/data/recovery_387868" ]
108   outputs = [ "{{bundle_resources_dir}}/" +
109               "{{source_root_relative_dir}}/{{source_file_part}}" ]
110 }
111
112 test("sql_unittests") {
113   sources = [
114     "database_options_unittest.cc",
115     "database_unittest.cc",
116     "meta_table_unittest.cc",
117     "recover_module/module_unittest.cc",
118     "recovery_unittest.cc",
119     "sql_memory_dump_provider_unittest.cc",
120     "sqlite_features_unittest.cc",
121     "sqlite_result_code_unittest.cc",
122     "statement_id_unittest.cc",
123     "statement_unittest.cc",
124     "test/database_test_peer.cc",
125     "test/database_test_peer.h",
126     "test/paths.cc",
127     "test/paths.h",
128     "test/run_all_unittests.cc",
129     "test/sql_test_suite.cc",
130     "test/sql_test_suite.h",
131     "transaction_unittest.cc",
132   ]
133
134   data = [ "test/data/" ]
135
136   deps = [
137     ":sql",
138     ":sql_unittests_bundle_data",
139     ":test_support",
140     "//base/test:test_support",
141     "//testing/gtest",
142     "//third_party/sqlite",
143   ]
144 }
145
146 fuzzer_test("sql_recovery_fuzzer") {
147   sources = [ "recovery_fuzzer.cc" ]
148   deps = [
149     ":sql",
150     "//base",
151     "//base/test:test_support",
152   ]
153 }
154
155 # TODO(https://crbug.com/1385500): Make built-in recovery work on Fuchsia.
156 if (!is_fuchsia) {
157   fuzzer_test("sql_built_in_recovery_fuzzer") {
158     sources = [ "built_in_recovery_fuzzer.cc" ]
159     deps = [
160       ":sql",
161       "//base",
162       "//base/test:test_support",
163     ]
164
165     libfuzzer_options = [ "rss_limit_mb=4096" ]
166   }
167 }