Don't preload rarely seen large images
[chromium-blink-merge.git] / components / resource_provider / BUILD.gn
blobf151d120ce560fe25ce82c4e7170309ab84e11ea
1 # Copyright 2015 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("//mojo/public/mojo_application.gni")
6 import("//testing/test.gni")
8 if (is_android) {
9   import("//build/config/android/rules.gni")
11   java_library_path = "$target_out_dir/java_library.dex.jar"
13   mojo_android_application("resource_provider") {
14     input_so = "$root_out_dir/lib.stripped/libresource_provider_lib.so"
15     input_dex_jar = java_library_path
16     deps = [
17       ":java_library",
18       ":resource_provider_lib",
19     ]
20   }
22   shared_library("resource_provider_lib") {
23     sources = [
24       "android/android_hooks.cc",
25       "main.cc",
26     ]
28     deps = [
29       ":jni_headers",
30       ":lib",
31       "//base",
32       "//components/resource_provider/public/interfaces",
33       "//mojo/environment:chromium",
34       "//third_party/mojo/src/mojo/public/c/system:for_shared_library",
35       "//url",
36     ]
37   }
39   generate_jni("jni_headers") {
40     sources = [
41       "android/java/org/chromium/resource_provider/Main.java",
42     ]
43     jni_package = "components/resource_provider"
44   }
46   android_library("java_classes") {
47     java_files = [ "android/java/org/chromium/resource_provider/Main.java" ]
49     deps = [
50       "//base:base_java",
51     ]
52   }
54   android_standalone_library("java_library") {
55     dex_path = java_library_path
57     deps = [
58       ":java_classes",
59     ]
60   }
61 } else {
62   mojo_native_application("resource_provider") {
63     sources = [
64       "main.cc",
65     ]
67     deps = [
68       ":lib",
69       "//base",
70       "//components/resource_provider/public/interfaces",
71       "//mojo/environment:chromium",
72       "//url",
73     ]
74   }
77 source_set("lib") {
78   sources = [
79     "file_utils.cc",
80     "file_utils.h",
81     "resource_provider_app.cc",
82     "resource_provider_app.h",
83     "resource_provider_impl.cc",
84     "resource_provider_impl.h",
85   ]
87   deps = [
88     "//base",
89     "//components/resource_provider/public/interfaces",
90     "//mojo/application/public/cpp",
91     "//mojo/common:common_base",
92     "//mojo/platform_handle",
93     "//url",
94   ]
97 test("resource_provider_unittests") {
98   sources = [
99     "file_utils_unittest.cc",
100   ]
102   deps = [
103     ":lib",
104     "//base",
105     "//base/test:test_config",
106     "//components/resource_provider/public/interfaces",
107     "//mojo/environment:chromium",
108     "//testing/gtest",
109     "//third_party/mojo/src/mojo/edk/test:run_all_unittests",
110     "//url",
111   ]
114 mojo_native_application("apptests") {
115   output_name = "resource_provider_apptests"
116   testonly = true
118   sources = [
119     "resource_provider_apptest.cc",
120   ]
122   resources = [
123     "//components/test/data/resource_provider/sample",
124     "//components/test/data/resource_provider/dir",
125   ]
127   deps = [
128     "//base",
129     "//base/test:test_config",
130     "//components/resource_provider/public/cpp",
131     "//components/resource_provider/public/interfaces",
132     "//mojo/application/public/cpp:test_support",
133     "//mojo/platform_handle",
134   ]
136   data_deps = [ ":resource_provider" ]