Bug 1405018 - Add support helper for generating inline <iframe> elements. r=whimboo
authorAndreas Tolfsen <ato@sny.no>
Mon, 02 Oct 2017 19:06:27 +0100
changeset 432427 e287f4cad6d4
parent 432426 fdcd4aa54eae
child 432428 5d8a54db7749
push id7953
push userryanvm@gmail.com
push date2017-10-12 14:05 +0000
treeherdermozilla-beta@f4ba99b41183 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerswhimboo
bugs1405018
milestone57.0
Bug 1405018 - Add support helper for generating inline <iframe> elements. r=whimboo MozReview-Commit-ID: FSs7haU0a5z
testing/web-platform/tests/webdriver/tests/support/inline.py
--- 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