Bug 1405018 - Add support helper for generating inline <iframe> elements. r?whimboo
MozReview-Commit-ID: FSs7haU0a5z
--- a/testing/web-platform/tests/webdriver/tests/support/inline.py
+++ b/testing/web-platform/tests/webdriver/tests/support/inline.py
@@ -25,16 +25,20 @@ def inline(doc, doctype="html", mime="te
if mime != "text/html;charset=utf8":
query["content-type"] = mime
return build_url("/webdriver/tests/support/inline.py",
query=urllib.urlencode(query),
protocol=protocol)
+def iframe(doc):
+ return "<iframe src='%s'></iframe>" % inline(doc)
+
+
def main(request, response):
doc = request.GET.first("doc", None)
content_type = request.GET.first("content-type", "text/html;charset=utf8")
if doc is None:
rv = 404, [("Content-Type", "text/plain")], "Missing doc parameter in query"
else:
rv = [("Content-Type", content_type)], doc
return rv