Update web-platform-tests to revision 3bac98b37f29ec287e115fcecff566eb081131a8

This commit is contained in:
WPT Sync Bot 2019-08-24 10:23:06 +00:00
parent 6ff2524781
commit 57ea61dc86
64 changed files with 1309 additions and 347 deletions

View file

@ -168,10 +168,10 @@ def current_session():
@pytest.fixture
def url(server_config):
def inner(path, protocol="http", subdomain="", query="", fragment=""):
domain = server_config["domains"][""][subdomain]
def inner(path, protocol="http", domain="", subdomain="", query="", fragment=""):
domain = server_config["domains"][domain][subdomain]
port = server_config["ports"][protocol][0]
host = "%s:%s" % (domain, port)
host = "{0}:{1}".format(domain, port)
return urlparse.urlunsplit((protocol, host, path, query, fragment))
inner.__name__ = "url"

View file

@ -1,11 +1,10 @@
from urlparse import urlparse
import webdriver.protocol as protocol
from tests.support.asserts import assert_success
from tests.support.helpers import document_location
from tests.support.inline import (
iframe,
inline,
)
from tests.support.inline import iframe, inline
"""
@ -29,32 +28,37 @@ def switch_to_frame(session, frame):
def test_cross_origin_iframe(session, server_config):
session.url = inline(iframe("", subdomain="www"))
session.url = inline(iframe("", domain="alt"))
frame_element = session.find.css("iframe", all=False)
response = switch_to_frame(session, frame_element)
value = assert_success(response)
assert document_location(session).startswith(
"http://www.{}".format(server_config["browser_host"]))
assert_success(response)
parse_result = urlparse(document_location(session))
assert parse_result.netloc != server_config["browser_host"]
def test_nested_cross_origin_iframe(session, server_config):
frame2 = iframe("", subdomain="www.www")
frame1 = iframe(frame2, subdomain="www")
top_doc = inline(frame1, subdomain="")
frame2 = iframe("", domain="alt", subdomain="www")
frame1 = iframe(frame2)
top_doc = inline(frame1, domain="alt")
session.url = top_doc
assert document_location(session).startswith(
"http://{}".format(server_config["browser_host"]))
frame1_el = session.find.css("iframe", all=False)
response = switch_to_frame(session, frame1_el)
value = assert_success(response)
assert document_location(session).startswith(
"http://www.{}".format(server_config["browser_host"]))
parse_result = urlparse(document_location(session))
top_level_host = parse_result.netloc
assert not top_level_host.startswith(server_config["browser_host"])
frame1_element = session.find.css("iframe", all=False)
response = switch_to_frame(session, frame1_element)
assert_success(response)
parse_result = urlparse(document_location(session))
assert parse_result.netloc.startswith(server_config["browser_host"])
frame2_el = session.find.css("iframe", all=False)
response = switch_to_frame(session, frame2_el)
value = assert_success(response)
assert document_location(session).startswith(
"http://www.www.{}".format(server_config["browser_host"]))
assert_success(response)
parse_result = urlparse(document_location(session))
assert parse_result.netloc == "www.{}".format(top_level_host)