NetS13nServiceWorker: Add virtual tests for ServiceWorkerServicification

Bug: 828331
Change-Id: I6198fe5be6de71a33fc3bc191d16802c92b2751f
Reviewed-on: https://chromium-review.googlesource.com/1025593
Commit-Queue: Makoto Shimazu <shimazu@chromium.org>
Reviewed-by: Matt Falkenhagen <falken@chromium.org>
Cr-Commit-Position: refs/heads/master@{#561774}
diff --git a/third_party/WebKit/LayoutTests/TestExpectations b/third_party/WebKit/LayoutTests/TestExpectations
index ae6ae6e..7c2f723 100644
--- a/third_party/WebKit/LayoutTests/TestExpectations
+++ b/third_party/WebKit/LayoutTests/TestExpectations
@@ -1911,6 +1911,10 @@
 crbug.com/736308 virtual/outofblink-cors/http/tests/xmlhttprequest/xmlhttprequest-allowed-with-disabled-web-security.html [ Failure ]
 # ====== Out of Blink CORS related tests END ======
 
+crbug.com/771118 virtual/service-worker-servicification/external/wpt/service-workers/service-worker/mime-sniffing.https.html [ Failure ]
+
+crbug.com/846237 virtual/service-worker-servicification/external/wpt/service-workers/service-worker/import-scripts-updated-flag.https.html [ Crash ]
+
 crbug.com/492664 [ Linux ] external/wpt/css/css-writing-modes/box-offsets-rel-pos-vlr-005.xht [ Failure ]
 crbug.com/492664 [ Linux ] external/wpt/css/css-writing-modes/box-offsets-rel-pos-vrl-004.xht [ Failure ]
 crbug.com/492664 [ Mac ] external/wpt/css/css-writing-modes/bidi-embed-002.html [ Failure ]
@@ -2847,6 +2851,7 @@
 
 # Failure messages are unstable so we cannot create baselines.
 crbug.com/832071 external/wpt/service-workers/service-worker/worker-client-id.https.html [ Failure ]
+crbug.com/832071 virtual/service-worker-servicification/external/wpt/service-workers/service-worker/worker-client-id.https.html [ Failure ]
 crbug.com/832071 virtual/navigation-mojo-response/external/wpt/service-workers/service-worker/worker-client-id.https.html [ Failure ]
 
 # ====== New tests from wpt-importer added here ======
@@ -2983,6 +2988,7 @@
 crbug.com/626703 [ Mac10.12 ] virtual/picture-in-picture/external/wpt/feature-policy/feature-policy-frame-policy-allowed-for-some.https.sub.html [ Timeout ]
 crbug.com/626703 external/wpt/css/cssom-view/scroll-behavior-smooth.html [ Timeout ]
 crbug.com/626703 external/wpt/service-workers/service-worker/fetch-event-is-reload-navigation-manual.https.html [ Skip ]
+crbug.com/626703 virtual/service-worker-servicification/external/wpt/service-workers/service-worker/fetch-event-is-reload-navigation-manual.https.html [ Skip ]
 crbug.com/626703 virtual/outofblink-cors/external/wpt/service-workers/service-worker/fetch-event-is-reload-navigation-manual.https.html [ Skip ]
 crbug.com/626703 external/wpt/css/css-text/overflow-wrap/overflow-wrap-break-word-003.html [ Failure ]
 crbug.com/626703 external/wpt/css/css-text/overflow-wrap/overflow-wrap-break-word-002.html [ Failure ]
@@ -3373,6 +3379,7 @@
 crbug.com/626703 external/wpt/screen-orientation/onchange-event.html [ Timeout ]
 crbug.com/626703 external/wpt/screen-orientation/onchange-event-subframe.html [ Timeout ]
 crbug.com/648295 external/wpt/service-workers/service-worker/update-bytecheck.https.html [ Timeout ]
+crbug.com/648295 virtual/service-worker-servicification/external/wpt/service-workers/service-worker/update-bytecheck.https.html [ Timeout ]
 crbug.com/626703 external/wpt/speech-api/SpeechSynthesis-speak-twice.html [ Timeout ]
 crbug.com/626703 external/wpt/svg/linking/reftests/href-filter-element.html [ Failure ]
 crbug.com/626703 external/wpt/wasm/wasm_indexeddb_test.https.html [ Failure ]
@@ -3650,6 +3657,7 @@
 crbug.com/626703 external/wpt/html/rendering/non-replaced-elements/margin-collapsing-quirks/multicol-standards-mode.html [ Pass Crash Failure ]
 crbug.com/762017 external/wpt/html/semantics/embedded-content/media-elements/video_loop_base.html [ Pass Crash ]
 crbug.com/807954 external/wpt/service-workers/service-worker/fetch-event-respond-with-readable-stream-chunk.https.html [ Crash ]
+crbug.com/807954 virtual/service-worker-servicification/external/wpt/service-workers/service-worker/fetch-event-respond-with-readable-stream-chunk.https.html [ Crash ]
 
 # Other untriaged test failures, timeouts and crashes from newly-imported WPT tests.
 crbug.com/666703 external/wpt/html/browsers/sandboxing/sandbox-disallow-same-origin.html [ Timeout ]
@@ -3768,10 +3776,13 @@
 
 # This test requires a special browser flag and seems not suitable for a wpt test, see bug.
 crbug.com/691944 external/wpt/service-workers/service-worker/update-after-oneday.https.html [ Skip ]
+crbug.com/691944 virtual/service-worker-servicification/external/wpt/service-workers/service-worker/update-after-oneday.https.html [ Skip ]
 
 # These tests (erroneously) see a platform-specific User-Agent header
 crbug.com/595993 external/wpt/service-workers/service-worker/fetch-header-visibility.https.html [ Failure ]
+crbug.com/595993 virtual/service-worker-servicification/external/wpt/service-workers/service-worker/fetch-header-visibility.https.html [ Failure ]
 crbug.com/595993 external/wpt/service-workers/service-worker/request-end-to-end.https.html [ Failure ]
+crbug.com/595993 virtual/service-worker-servicification/external/wpt/service-workers/service-worker/request-end-to-end.https.html [ Failure ]
 
 crbug.com/619427 [ Mac Linux ] fast/overflow/overflow-height-float-not-removed-crash3.html [ Pass Failure ]
 
@@ -3955,7 +3966,9 @@
 
 # Flaky on trybots
 crbug.com/688486 external/wpt/service-workers/service-worker/fetch-request-resources.https.html [ Failure Pass ]
+crbug.com/688486 virtual/service-worker-servicification/external/wpt/service-workers/service-worker/fetch-request-resources.https.html [ Failure Pass ]
 crbug.com/831509 external/wpt/service-workers/service-worker/skip-waiting-installed.https.html [ Failure Pass ]
+crbug.com/831509 virtual/service-worker-servicification/external/wpt/service-workers/service-worker/skip-waiting-installed.https.html [ Failure Pass ]
 crbug.com/831509 virtual/navigation-mojo-response/external/wpt/service-workers/service-worker/skip-waiting-installed.https.html [ Failure Pass ]
 
 # Sheriff failures 2017-02-21
@@ -4245,6 +4258,7 @@
 crbug.com/757165 [ Win ] external/wpt/preload/download-resources.html [ Skip ]
 crbug.com/757165 [ Win ] external/wpt/preload/preload-default-csp.sub.html [ Skip ]
 crbug.com/757165 [ Win ] external/wpt/service-workers/service-worker/navigation-redirect.https.html [ Skip ]
+crbug.com/757165 [ Win ] virtual/service-worker-servicification/external/wpt/service-workers/service-worker/navigation-redirect.https.html [ Skip ]
 crbug.com/757165 [ Win ] fast/forms/file/recover-file-input-in-unposted-form.html [ Skip ]
 crbug.com/757165 [ Win ] fast/spatial-navigation/snav-aligned-not-aligned.html [ Pass Failure Timeout Crash ]
 crbug.com/757165 [ Win ] fast/spatial-navigation/snav-clipped-overflowed-content.html [ Pass Failure Timeout Crash ]
@@ -4519,7 +4533,9 @@
 crbug.com/802915 css3/blending/isolation-should-include-non-local-background.html [ Failure ]
 
 crbug.com/807838 external/wpt/service-workers/service-worker/worker-in-sandboxed-iframe-by-csp-fetch-event.https.html [ Crash Pass ]
+crbug.com/807838 virtual/service-worker-servicification/external/wpt/service-workers/service-worker/worker-in-sandboxed-iframe-by-csp-fetch-event.https.html [ Crash Pass ]
 crbug.com/830472 external/wpt/service-workers/service-worker/navigation-preload/broken-chunked-encoding.https.html [ Failure ]
+crbug.com/830472 virtual/service-worker-servicification/external/wpt/service-workers/service-worker/navigation-preload/broken-chunked-encoding.https.html [ Failure ]
 
 # Sheriff faulures 2017-12-12
 crbug.com/794180 http/tests/devtools/layers/layer-compositing-reasons.js [ Failure Pass ]
@@ -4761,6 +4777,7 @@
 
 crbug.com/840881 external/wpt/service-workers/service-worker/resource-timing.https.html [ Failure ]
 crbug.com/840881 virtual/outofblink-cors/external/wpt/service-workers/service-worker/resource-timing.https.html [ Failure ]
+crbug.com/840881 virtual/service-worker-servicification/external/wpt/service-workers/service-worker/resource-timing.https.html [ Failure ]
 
 # Sheriff 2018-04-12
 crbug.com/831993 [ Linux ] virtual/gpu-rasterization/images/cross-fade-overflow-position.html [ Pass Timeout ]
diff --git a/third_party/WebKit/LayoutTests/VirtualTestSuites b/third_party/WebKit/LayoutTests/VirtualTestSuites
index 8f98bb3e..2ba9799 100644
--- a/third_party/WebKit/LayoutTests/VirtualTestSuites
+++ b/third_party/WebKit/LayoutTests/VirtualTestSuites
@@ -668,6 +668,18 @@
     "args": ["--enable-features=PictureInPicture,UseSurfaceLayerForVideo"]
   },
   {
+    "prefix": "service-worker-servicification",
+    "base": "http/tests/serviceworker",
+    "args": ["--enable-features=ServiceWorkerServicification",
+             "--disable-features=NetworkService"]
+  },
+  {
+    "prefix": "service-worker-servicification",
+    "base": "external/wpt/service-workers/service-worker",
+    "args": ["--enable-features=ServiceWorkerServicification",
+             "--disable-features=NetworkService"]
+  },
+  {
     "prefix": "off-main-thread-websocket",
     "base": "external/wpt/websockets",
     "args": ["--disable-features=OffMainThreadWebSocket"]
diff --git a/third_party/WebKit/LayoutTests/virtual/service-worker-servicification/external/wpt/service-workers/service-worker/README.txt b/third_party/WebKit/LayoutTests/virtual/service-worker-servicification/external/wpt/service-workers/service-worker/README.txt
new file mode 100644
index 0000000..b0e1403
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/virtual/service-worker-servicification/external/wpt/service-workers/service-worker/README.txt
@@ -0,0 +1,2 @@
+This directory is for testing the case where ServiceWorkerServicification (aka NetS13nServiceWorker) is on and NetworkService is off.
+The tracking bug is crbug.com/846235.
diff --git a/third_party/WebKit/LayoutTests/virtual/service-worker-servicification/external/wpt/service-workers/service-worker/appcache-ordering-main.https-expected.txt b/third_party/WebKit/LayoutTests/virtual/service-worker-servicification/external/wpt/service-workers/service-worker/appcache-ordering-main.https-expected.txt
new file mode 100644
index 0000000..055c437
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/virtual/service-worker-servicification/external/wpt/service-workers/service-worker/appcache-ordering-main.https-expected.txt
@@ -0,0 +1,4 @@
+This is a testharness.js-based test.
+FAIL serviceworkers take priority over appcaches assert_unreached: unexpected rejection: assert_false: but serviceworkers should take priority expected false got true Reached unreachable code
+Harness: the test ran to completion.
+
diff --git a/third_party/WebKit/LayoutTests/virtual/service-worker-servicification/external/wpt/service-workers/service-worker/navigation-timing.https-expected.txt b/third_party/WebKit/LayoutTests/virtual/service-worker-servicification/external/wpt/service-workers/service-worker/navigation-timing.https-expected.txt
new file mode 100644
index 0000000..3cf6933
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/virtual/service-worker-servicification/external/wpt/service-workers/service-worker/navigation-timing.https-expected.txt
@@ -0,0 +1,6 @@
+This is a testharness.js-based test.
+FAIL Service worker controlled navigation timing assert_unreached: unexpected rejection: assert_true: Expected workerStart <= fetchStart expected true got false Reached unreachable code
+PASS Service worker controlled navigation timing network fallback
+PASS Service worker controlled navigation timing redirect
+Harness: the test ran to completion.
+
diff --git a/third_party/WebKit/LayoutTests/virtual/service-worker-servicification/http/tests/serviceworker/README.txt b/third_party/WebKit/LayoutTests/virtual/service-worker-servicification/http/tests/serviceworker/README.txt
new file mode 100644
index 0000000..b0e1403
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/virtual/service-worker-servicification/http/tests/serviceworker/README.txt
@@ -0,0 +1,2 @@
+This directory is for testing the case where ServiceWorkerServicification (aka NetS13nServiceWorker) is on and NetworkService is off.
+The tracking bug is crbug.com/846235.