summaryrefslogtreecommitdiff
path: root/chromium/ios/web/test/BUILD.gn
blob: 16539ceebe1445bdf3a2136ed6fb74493ec283bc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
# Copyright 2016 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

import("//ios/web/js_compile.gni")
import("//mojo/public/tools/bindings/mojom.gni")
import("//tools/grit/grit_rule.gni")
import("//tools/grit/repack.gni")

mojom("mojo_bindings") {
  sources = [ "mojo_test.mojom" ]
}

repack("packed_resources") {
  testonly = true
  sources = [
    "$root_gen_dir/ios/web/ios_web_resources.pak",
    "$root_gen_dir/ios/web/test/test_resources.pak",
    "$root_gen_dir/ui/resources/webui_resources.pak",
  ]
  deps = [
    ":resources",
    "//ios/web:resources",
    "//ui/resources",
  ]
  output = "$target_gen_dir/resources.pak"
  copy_data_to_bundle = true
}

grit("resources") {
  source = "test_resources.grd"

  inputs = [ "${root_gen_dir}/ios/web/test/mojo_test.mojom.js" ]
  deps = [ ":mojo_bindings_js" ]
  outputs = [
    "grit/test_resources.h",
    "test_resources.pak",
  ]
  grit_flags = [
    "-E",
    "root_gen_dir=" + rebase_path(root_gen_dir, root_build_dir),
  ]
}

source_set("test_support") {
  configs += [ "//build/config/compiler:enable_arc" ]
  testonly = true

  # This public_dep is a workaround because there is a circular dependency
  # (this target should public_dep on //ios/web/public/test).
  public_deps = [ "//testing/gtest" ]

  deps = [
    ":all_frames_web_test_bundle",
    ":test_constants",
    "//base",
    "//base/test:test_support",
    "//components/crash/core/common",
    "//ios/testing:verify_custom_webkit",
    "//ios/web",
    "//ios/web/common:web_view_creation_util",
    "//ios/web/navigation:core",
    "//ios/web/public/test:util",
    "//ios/web/public/test/fakes",
    "//ios/web/public/test/http_server",
    "//ios/web/test/fakes",
    "//net",
    "//third_party/ocmock",
    "//ui/base",
  ]

  sources = [
    "test_web_thread.cc",
    "url_test_util.mm",
    "web_int_test.h",
    "web_int_test.mm",
    "web_task_environment.cc",
    "web_test_suite.mm",
    "web_test_with_web_controller.h",
    "web_test_with_web_controller.mm",
    "wk_web_view_crash_utils.h",
    "wk_web_view_crash_utils.mm",
  ]
}

source_set("test_constants") {
  testonly = true
  sources = [
    "test_url_constants.cc",
    "test_url_constants.h",
  ]
}

js_compile_bundle("all_frames_web_test_bundle") {
  testonly = true
  closure_entry_point = "__crWeb.allFramesWebTestBundle"

  sources = [
    "resources/all_frames_web_test_bundle.js",
    "resources/cookie_test.js",
  ]
}