fune/testing/web-platform/tests/css/css-scroll-snap-2/scroll-start/stash.py
David Awogbemila 3fe665217d Bug 1839521 [wpt PR 40656] - [css-scroll-snap-2] Rename scroll-start tests with 'tentative', a=testonly
Automatic update from web-platform-tests
[css-scroll-snap-2] Rename scroll-start tests with 'tentative'

Also, scroll-start-with-text-fragment-navigation.html is adjusted to the
new scroll-start directory added in crrev.com/c/4628128.

Bug: 1439807
Change-Id: Idfa8b0dd447bb621d0261780e3b6b93b9f952e82
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4629866
Reviewed-by: Robert Flack <flackr@chromium.org>
Commit-Queue: David Awogbemila <awogbemila@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1161712}

--

wpt-commits: 9f1dfeb0175b413db001ca619b0711efeada930b
wpt-pr: 40656
2023-07-06 08:21:00 +00:00

27 lines
1,000 B
Python

# Copyright 2023 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
This file allows the different windows created by
css/css-scroll-snap-2/scroll-start/scroll-start-with-text-fragment-navigation.html
to store and retrieve data.
scroll-start-with-text-fragment-navigation.html (test file) opens a window to
scroll-start-with-text-fragment-navigation-target.html which writes some data
which the test file will eventually read. This file handles the requests from
both windows.
"""
import time
def main(request, response):
key = request.GET.first(b"key")
if request.method == u"POST":
# Received result data from target page
request.server.stash.put(key, request.body, u'/css/css-scroll-snap-2/scroll-start')
return u"ok"
else:
# Request for result data from test page
value = request.server.stash.take(key, u'/css/css-scroll-snap-2/scroll-start')
return value