[go: nahoru, domu]

Create WKHTTPSystemCookieStore

WKHTTPSystemCookieStore is a SystemCookieStore that uses WKHTTPCookieStore
as its internal cookie store.
WKHTTPCookieStore is an async store that does it's callbacks on the main thread,
from there we post the systemCookieStore callbacks to the webthread.

Also created system_cookie_store unit tests to be a generic unit tests for all
classes that implements systemCookieStore, and added NSHTTPSystemCookieStore
unit test delegate & WKHTTPSystemCookieStore unit test delegate to use it.

Bug: 759229, 759227, 779106
Cq-Include-Trybots: master.tryserver.chromium.mac:ios-simulator-cronet
Change-Id: I7d100e1f3e27b3cffea66506a4d20e6bdbc44927
Reviewed-on: https://chromium-review.googlesource.com/741883
Commit-Queue: Mohammad Refaat <mrefaat@chromium.org>
Reviewed-by: Eugene But <eugenebut@chromium.org>
Cr-Commit-Position: refs/heads/master@{#514351}
diff --git a/ios/net/BUILD.gn b/ios/net/BUILD.gn
index 618a989..797bbee 100644
--- a/ios/net/BUILD.gn
+++ b/ios/net/BUILD.gn
@@ -78,12 +78,31 @@
   }
 }
 
+source_set("test_support") {
+  testonly = true
+  configs += [ "//build/config/compiler:enable_arc" ]
+
+  deps = [
+    ":net",
+    "//base",
+    "//ios/testing:ios_test_support",
+    "//net:test_support",
+  ]
+  sources = [
+    "cookies/cookie_store_ios_test_util.h",
+    "cookies/cookie_store_ios_test_util.mm",
+    "cookies/system_cookie_store_unittest_template.h",
+  ]
+}
+
 test("ios_net_unittests") {
   configs += [ "//build/config/compiler:enable_arc" ]
   deps = [
     ":net",
+    ":test_support",
     "//base",
     "//base/test:run_all_unittests",
+    "//ios/testing:ios_test_support",
     "//net:test_support",
     "//testing/gtest",
     "//url",
@@ -93,8 +112,6 @@
     "cookies/cookie_cache_unittest.cc",
     "cookies/cookie_creation_time_manager_unittest.mm",
     "cookies/cookie_store_ios_persistent_unittest.mm",
-    "cookies/cookie_store_ios_test_util.h",
-    "cookies/cookie_store_ios_test_util.mm",
     "cookies/cookie_store_ios_unittest.mm",
     "cookies/ns_http_system_cookie_store_unittest.mm",
     "cookies/system_cookie_util_unittest.mm",