summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorxunjieli <xunjieli@chromium.org>2015-04-14 14:34:25 -0700
committerCommit bot <commit-bot@chromium.org>2015-04-14 21:34:45 +0000
commita688820914fc176f3ecd851612e6653b0ee32322 (patch)
treeb8b09119e75de6e357935fa21fa87029b01cdf56
parentae86c87f5709af909aa5cbdf1857f567c2ea8297 (diff)
downloadchromium_src-a688820914fc176f3ecd851612e6653b0ee32322.zip
chromium_src-a688820914fc176f3ecd851612e6653b0ee32322.tar.gz
chromium_src-a688820914fc176f3ecd851612e6653b0ee32322.tar.bz2
Make Cronet gyp file compiles net_unittests
This CL is the first step to make cronet bot build and run net_unittests. R=mef@chromium.org BUG=419082 Review URL: https://codereview.chromium.org/1070853003 Cr-Commit-Position: refs/heads/master@{#325125}
-rw-r--r--components/cronet.gypi9
-rw-r--r--net/BUILD.gn13
-rw-r--r--net/net.gyp13
-rw-r--r--net/url_request/url_request_unittest.cc4
4 files changed, 30 insertions, 9 deletions
diff --git a/components/cronet.gypi b/components/cronet.gypi
index 3c036b1..3bc6058 100644
--- a/components/cronet.gypi
+++ b/components/cronet.gypi
@@ -299,13 +299,19 @@
'../third_party/icu/icu.gyp:icuuc',
],
'conditions': [
- ['use_icu_alternatives_on_android==1',
+ # If file support is disabled, add the following sources since
+ # url_request_mock_http_job depends on them.
+ ['disable_file_support==1',
{
'sources': [
'../net/base/directory_lister.cc',
'../net/base/directory_lister.h',
+ '../net/url_request/test_url_request_interceptor.cc',
+ '../net/url_request/test_url_request_interceptor.h',
'../net/url_request/url_request_file_job.cc',
'../net/url_request/url_request_file_job.h',
+ '../net/test/url_request/url_request_mock_http_job.cc',
+ '../net/test/url_request/url_request_mock_http_job.h',
]
}
],
@@ -361,6 +367,7 @@
'libcronet',
'cronet_java',
'cronet_stub',
+ '../net/net.gyp:net_unittests_apk',
],
'variables': {
'native_lib': 'libcronet.>(android_product_extension)',
diff --git a/net/BUILD.gn b/net/BUILD.gn
index 9d82fd0..cb20fce 100644
--- a/net/BUILD.gn
+++ b/net/BUILD.gn
@@ -690,14 +690,10 @@ source_set("test_support") {
"test/url_request/url_request_failed_job.h",
"test/url_request/url_request_mock_data_job.cc",
"test/url_request/url_request_mock_data_job.h",
- "test/url_request/url_request_mock_http_job.cc",
- "test/url_request/url_request_mock_http_job.h",
"test/url_request/url_request_slow_download_job.cc",
"test/url_request/url_request_slow_download_job.h",
"url_request/test_url_fetcher_factory.cc",
"url_request/test_url_fetcher_factory.h",
- "url_request/test_url_request_interceptor.cc",
- "url_request/test_url_request_interceptor.h",
"url_request/url_request_test_util.cc",
"url_request/url_request_test_util.h",
]
@@ -747,6 +743,15 @@ source_set("test_support") {
if (!use_nss_certs) {
sources -= [ "test/cert_test_util_nss.cc" ]
}
+
+ if (!disable_file_support) {
+ sources += [
+ "test/url_request/url_request_mock_http_job.cc",
+ "test/url_request/url_request_mock_http_job.h",
+ "url_request/test_url_request_interceptor.cc",
+ "url_request/test_url_request_interceptor.h",
+ ]
+ }
}
source_set("balsa") {
diff --git a/net/net.gyp b/net/net.gyp
index 7d13fb7..a322f77 100644
--- a/net/net.gyp
+++ b/net/net.gyp
@@ -594,14 +594,10 @@
'test/url_request/url_request_failed_job.h',
'test/url_request/url_request_mock_data_job.cc',
'test/url_request/url_request_mock_data_job.h',
- 'test/url_request/url_request_mock_http_job.cc',
- 'test/url_request/url_request_mock_http_job.h',
'test/url_request/url_request_slow_download_job.cc',
'test/url_request/url_request_slow_download_job.h',
'url_request/test_url_fetcher_factory.cc',
'url_request/test_url_fetcher_factory.h',
- 'url_request/test_url_request_interceptor.cc',
- 'url_request/test_url_request_interceptor.h',
'url_request/url_request_test_util.cc',
'url_request/url_request_test_util.h',
],
@@ -660,6 +656,14 @@
'test/cert_test_util_nss.cc',
],
}],
+ ['disable_file_support != 1', {
+ 'sources': [
+ 'test/url_request/url_request_mock_http_job.cc',
+ 'test/url_request/url_request_mock_http_job.h',
+ 'url_request/test_url_request_interceptor.cc',
+ 'url_request/test_url_request_interceptor.h',
+ ],
+ }],
],
# TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
'msvs_disabled_warnings': [4267, ],
@@ -1319,6 +1323,7 @@
'disable_ftp_support': 1,
'disable_file_support': 1,
'enable_websockets': 0,
+ 'use_icu_alternatives_on_android': 1,
},
'dependencies': [
'../url/url.gyp:url_lib_use_icu_alternatives_on_android',
diff --git a/net/url_request/url_request_unittest.cc b/net/url_request/url_request_unittest.cc
index e86672c..5996500 100644
--- a/net/url_request/url_request_unittest.cc
+++ b/net/url_request/url_request_unittest.cc
@@ -176,6 +176,7 @@ void TestLoadTimingReusedWithProxy(
EXPECT_LE(load_timing_info.send_end, load_timing_info.receive_headers_end);
}
+#if !defined(DISABLE_FILE_SUPPORT)
// Tests load timing information in the case of a cache hit, when no cache
// validation request was sent over the wire.
base::StringPiece TestNetResourceProvider(int key) {
@@ -196,6 +197,7 @@ void FillBuffer(char* buffer, size_t len) {
buffer[i] = 'g';
}
}
+#endif
#if !defined(OS_IOS)
void TestLoadTimingCacheHitNoNetwork(
@@ -215,6 +217,7 @@ void TestLoadTimingCacheHitNoNetwork(
EXPECT_TRUE(load_timing_info.proxy_resolve_end.is_null());
}
+#if !defined(DISABLE_FTP_SUPPORT)
// Tests load timing in the case that there is no HTTP response. This can be
// used to test in the case of errors or non-HTTP requests.
void TestLoadTimingNoHttpResponse(
@@ -234,6 +237,7 @@ void TestLoadTimingNoHttpResponse(
EXPECT_TRUE(load_timing_info.send_end.is_null());
EXPECT_TRUE(load_timing_info.receive_headers_end.is_null());
}
+#endif
// Do a case-insensitive search through |haystack| for |needle|.
bool ContainsString(const std::string& haystack, const char* needle) {