| OLD | NEW |
| 1 # Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 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 import("//build/module_args/mojo.gni") | 5 import("//build/module_args/mojo.gni") |
| 6 import("//mojo/public/mojo_application.gni") | 6 import("//mojo/public/mojo_application.gni") |
| 7 import("//mojo/public/tools/bindings/mojom.gni") | 7 import("//mojo/public/tools/bindings/mojom.gni") |
| 8 import("//mojo/tools/embed/rules.gni") | 8 import("//mojo/tools/embed/rules.gni") |
| 9 import("//testing/test.gni") |
| 10 |
| 11 group("tests") { |
| 12 testonly = true |
| 13 |
| 14 deps = [ |
| 15 ":apptests", |
| 16 ":unittests", |
| 17 ] |
| 18 } |
| 9 | 19 |
| 10 source_set("url_response_disk_cache") { | 20 source_set("url_response_disk_cache") { |
| 11 sources = [ | 21 sources = [ |
| 12 "url_response_disk_cache_app.cc", | 22 "url_response_disk_cache_app.cc", |
| 13 "url_response_disk_cache_app.h", | 23 "url_response_disk_cache_app.h", |
| 14 "url_response_disk_cache_impl.cc", | 24 "url_response_disk_cache_impl.cc", |
| 15 "url_response_disk_cache_impl.h", | 25 "url_response_disk_cache_impl.h", |
| 16 ] | 26 ] |
| 17 | 27 |
| 18 deps = [ | 28 deps = [ |
| 19 ":bindings", | 29 ":bindings", |
| 30 ":url_response_disk_cache_db", |
| 20 "//base", | 31 "//base", |
| 32 "//crypto", |
| 21 "//mojo/application", | 33 "//mojo/application", |
| 22 "//mojo/data_pipe_utils", | 34 "//mojo/data_pipe_utils", |
| 23 "//mojo/environment:chromium", | 35 "//mojo/environment:chromium", |
| 24 "//mojo/public/cpp/application", | 36 "//mojo/public/cpp/application", |
| 25 "//mojo/public/cpp/system", | 37 "//mojo/public/cpp/system", |
| 38 "//mojo/public/interfaces/network", |
| 26 "//mojo/services/url_response_disk_cache/public/interfaces", | 39 "//mojo/services/url_response_disk_cache/public/interfaces", |
| 27 "//third_party/zlib:zip", | 40 "//third_party/zlib:zip", |
| 28 "//url:url", | 41 "//url:url", |
| 29 ] | 42 ] |
| 30 } | 43 } |
| 31 | 44 |
| 45 source_set("url_response_disk_cache_db") { |
| 46 sources = [ |
| 47 "url_response_disk_cache_db.cc", |
| 48 "url_response_disk_cache_db.h", |
| 49 ] |
| 50 |
| 51 deps = [ |
| 52 ":bindings", |
| 53 "//base", |
| 54 "//third_party/leveldatabase", |
| 55 ] |
| 56 } |
| 57 |
| 32 mojom("bindings") { | 58 mojom("bindings") { |
| 33 sources = [ | 59 sources = [ |
| 34 "url_response_disk_cache_entry.mojom", | 60 "url_response_disk_cache_entry.mojom", |
| 35 ] | 61 ] |
| 62 |
| 63 deps = [ |
| 64 "//mojo/public/interfaces/network", |
| 65 ] |
| 36 } | 66 } |
| 37 | 67 |
| 38 mojo_native_application("tests") { | 68 mojo_native_application("apptests") { |
| 39 output_name = "url_response_disk_cache_apptests" | 69 output_name = "url_response_disk_cache_apptests" |
| 40 | 70 |
| 41 testonly = true | 71 testonly = true |
| 42 | 72 |
| 43 sources = [ | 73 sources = [ |
| 44 "url_response_disk_cache_apptest.cc", | 74 "url_response_disk_cache_apptest.cc", |
| 45 ] | 75 ] |
| 46 | 76 |
| 47 deps = [ | 77 deps = [ |
| 48 ":embed_test_data", | 78 ":embed_test_data", |
| 49 "//base", | 79 "//base", |
| 50 "//mojo/application", | 80 "//mojo/application", |
| 51 "//mojo/application:test_support", | 81 "//mojo/application:test_support", |
| 52 "//mojo/public/cpp/bindings", | 82 "//mojo/public/cpp/bindings", |
| 53 "//mojo/public/cpp/system:system", | 83 "//mojo/public/cpp/system:system", |
| 54 "//mojo/services/network/public/interfaces:interfaces", | 84 "//mojo/services/network/public/interfaces:interfaces", |
| 55 "//mojo/services/url_response_disk_cache/public/interfaces", | 85 "//mojo/services/url_response_disk_cache/public/interfaces", |
| 56 ] | 86 ] |
| 57 | 87 |
| 58 data_deps = [ ":url_response_disk_cache" ] | 88 data_deps = [ ":url_response_disk_cache" ] |
| 59 } | 89 } |
| 60 | 90 |
| 91 test("unittests") { |
| 92 output_name = "url_response_disk_cache_unittests" |
| 93 |
| 94 sources = [ |
| 95 "url_response_disk_cache_db_unittests.cc", |
| 96 ] |
| 97 |
| 98 deps = [ |
| 99 ":url_response_disk_cache_db", |
| 100 "//base", |
| 101 "//base/test:run_all_unittests", |
| 102 "//base/test:test_support", |
| 103 "//mojo/environment:chromium", |
| 104 "//mojo/public/cpp/bindings", |
| 105 "//mojo/public/cpp/system", |
| 106 "//mojo/public/platform/native:system", |
| 107 "//testing/gtest", |
| 108 ] |
| 109 } |
| 110 |
| 61 action("test_data") { | 111 action("test_data") { |
| 62 script = "//mojo/public/tools/gn/zip.py" | 112 script = "//mojo/public/tools/gn/zip.py" |
| 63 inputs = [ | 113 inputs = [ |
| 64 "test_data/file1", | 114 "test_data/file1", |
| 65 "test_data/file2", | 115 "test_data/file2", |
| 66 ] | 116 ] |
| 67 output = "$target_out_dir/test_data.zip" | 117 output = "$target_out_dir/test_data.zip" |
| 68 outputs = [ | 118 outputs = [ |
| 69 output, | 119 output, |
| 70 ] | 120 ] |
| 71 rebase_base_dir = rebase_path("test_data", root_build_dir) | 121 rebase_base_dir = rebase_path("test_data", root_build_dir) |
| 72 rebase_inputs = rebase_path(inputs, root_build_dir) | 122 rebase_inputs = rebase_path(inputs, root_build_dir) |
| 73 rebase_output = rebase_path(output, root_build_dir) | 123 rebase_output = rebase_path(output, root_build_dir) |
| 74 args = [ | 124 args = [ |
| 75 "--base-dir=$rebase_base_dir", | 125 "--base-dir=$rebase_base_dir", |
| 76 "--inputs=$rebase_inputs", | 126 "--inputs=$rebase_inputs", |
| 77 "--output=$rebase_output", | 127 "--output=$rebase_output", |
| 78 ] | 128 ] |
| 79 } | 129 } |
| 80 | 130 |
| 81 embed_file("embed_test_data") { | 131 embed_file("embed_test_data") { |
| 82 source = "$target_out_dir/test_data.zip" | 132 source = "$target_out_dir/test_data.zip" |
| 83 namespace = "mojo" | 133 namespace = "mojo" |
| 84 variable = "kTestData" | 134 variable = "kTestData" |
| 85 | 135 |
| 86 deps = [ | 136 deps = [ |
| 87 ":test_data", | 137 ":test_data", |
| 88 ] | 138 ] |
| 89 } | 139 } |
| OLD | NEW |