Update web-platform-tests to 887399d3d0a85d0e27a6688ae384459376adf7ca

This commit is contained in:
Ms2ger 2015-12-21 12:07:57 +01:00 committed by Anthony Ramine
parent a900196b3f
commit 8ea56eabaa
44 changed files with 178 additions and 77 deletions

View file

@ -13271,10 +13271,6 @@
"path": "custom-elements/custom-element-lifecycle/types-of-callbacks/attached-callback-move-element-test.html", "path": "custom-elements/custom-element-lifecycle/types-of-callbacks/attached-callback-move-element-test.html",
"url": "/custom-elements/custom-element-lifecycle/types-of-callbacks/attached-callback-move-element-test.html" "url": "/custom-elements/custom-element-lifecycle/types-of-callbacks/attached-callback-move-element-test.html"
}, },
{
"path": "custom-elements/custom-element-lifecycle/types-of-callbacks/attached-callback-test.html",
"url": "/custom-elements/custom-element-lifecycle/types-of-callbacks/attached-callback-test.html"
},
{ {
"path": "custom-elements/custom-element-lifecycle/types-of-callbacks/attribute-changed-callback-change-attribute-test.html", "path": "custom-elements/custom-element-lifecycle/types-of-callbacks/attribute-changed-callback-change-attribute-test.html",
"url": "/custom-elements/custom-element-lifecycle/types-of-callbacks/attribute-changed-callback-change-attribute-test.html" "url": "/custom-elements/custom-element-lifecycle/types-of-callbacks/attribute-changed-callback-change-attribute-test.html"
@ -15051,10 +15047,6 @@
"path": "html/browsers/browsing-the-web/scroll-to-fragid/006.html", "path": "html/browsers/browsing-the-web/scroll-to-fragid/006.html",
"url": "/html/browsers/browsing-the-web/scroll-to-fragid/006.html" "url": "/html/browsers/browsing-the-web/scroll-to-fragid/006.html"
}, },
{
"path": "html/browsers/browsing-the-web/scroll-to-fragid/007.html",
"url": "/html/browsers/browsing-the-web/scroll-to-fragid/007.html"
},
{ {
"path": "html/browsers/browsing-the-web/unloading-documents/001.html", "path": "html/browsers/browsing-the-web/unloading-documents/001.html",
"url": "/html/browsers/browsing-the-web/unloading-documents/001.html" "url": "/html/browsers/browsing-the-web/unloading-documents/001.html"
@ -15495,10 +15487,6 @@
"path": "html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/close_unload.html", "path": "html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/close_unload.html",
"url": "/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/close_unload.html" "url": "/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/close_unload.html"
}, },
{
"path": "html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/creating_browsing_context_test_01.html",
"url": "/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/creating_browsing_context_test_01.html"
},
{ {
"path": "html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_1.html", "path": "html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_1.html",
"url": "/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_1.html" "url": "/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_1.html"
@ -28809,6 +28797,11 @@
"timeout": "long", "timeout": "long",
"url": "/custom-elements/concepts/custom-elements-type-allowed-chars.html" "url": "/custom-elements/concepts/custom-elements-type-allowed-chars.html"
}, },
{
"path": "custom-elements/custom-element-lifecycle/types-of-callbacks/attached-callback-test.html",
"timeout": "long",
"url": "/custom-elements/custom-element-lifecycle/types-of-callbacks/attached-callback-test.html"
},
{ {
"path": "dom/nodes/Document-characterSet-normalization.html", "path": "dom/nodes/Document-characterSet-normalization.html",
"timeout": "long", "timeout": "long",
@ -28949,6 +28942,11 @@
"timeout": "long", "timeout": "long",
"url": "/eventsource/shared-worker/eventsource-constructor-non-same-origin.htm" "url": "/eventsource/shared-worker/eventsource-constructor-non-same-origin.htm"
}, },
{
"path": "html/browsers/browsing-the-web/scroll-to-fragid/007.html",
"timeout": "long",
"url": "/html/browsers/browsing-the-web/scroll-to-fragid/007.html"
},
{ {
"path": "html/browsers/history/the-history-interface/007.html", "path": "html/browsers/history/the-history-interface/007.html",
"timeout": "long", "timeout": "long",
@ -28959,6 +28957,11 @@
"timeout": "long", "timeout": "long",
"url": "/html/browsers/origin/cross-origin-objects/cross-origin-objects.sub.html" "url": "/html/browsers/origin/cross-origin-objects/cross-origin-objects.sub.html"
}, },
{
"path": "html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/creating_browsing_context_test_01.html",
"timeout": "long",
"url": "/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/creating_browsing_context_test_01.html"
},
{ {
"path": "html/dom/interfaces.html", "path": "html/dom/interfaces.html",
"timeout": "long", "timeout": "long",
@ -35866,7 +35869,7 @@
} }
] ]
}, },
"rev": "0bb3d73f26aa5a21326b6c1c7aaf35029222223f", "rev": "887399d3d0a85d0e27a6688ae384459376adf7ca",
"url_base": "/", "url_base": "/",
"version": 2 "version": 2
} }

View file

@ -12,3 +12,18 @@
[Basic functionality of setAttributeNodeNS] [Basic functionality of setAttributeNodeNS]
expected: FAIL expected: FAIL
[getAttributeNames tests]
expected: FAIL
[Own property correctness with basic attributes]
expected: FAIL
[Own property correctness with non-namespaced attribute before same-name namespaced one]
expected: FAIL
[Own property correctness with namespaced attribute before same-name non-namespaced one]
expected: FAIL
[Own property correctness with two namespaced attributes with the same name-with-prefix]
expected: FAIL

View file

@ -1 +1 @@
9c4ca39ebe57502b74d75aa9d6953b017d884f54 a900196b3f56fac46f86d8a8157a61f14fdca364

View file

@ -3,7 +3,6 @@
<head> <head>
<meta charset="utf-8" /> <meta charset="utf-8" />
<title>XMLHttpRequest: worker scripts, origin and referrer</title> <title>XMLHttpRequest: worker scripts, origin and referrer</title>
<link rel="stylesheet" href="/resources/testharness.css" />
<script src="/resources/testharness.js"></script> <script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script> <script src="/resources/testharnessreport.js"></script>
<link rel="help" href="https://xhr.spec.whatwg.org/#the-open()-method" data-tested-assertations="following::OL[1]/LI[3] following::OL[1]/LI[3]/ol[1]/li[1] following::OL[1]/LI[3]/ol[1]/li[2] following::OL[1]/LI[3]/ol[1]/li[3]" /> <link rel="help" href="https://xhr.spec.whatwg.org/#the-open()-method" data-tested-assertations="following::OL[1]/LI[3] following::OL[1]/LI[3]/ol[1]/li[1] following::OL[1]/LI[3]/ol[1]/li[2] following::OL[1]/LI[3]/ol[1]/li[3]" />

View file

@ -3,7 +3,6 @@
<head> <head>
<meta charset="utf-8" /> <meta charset="utf-8" />
<title>XMLHttpRequest: relative URLs in worker scripts resolved by script URL</title> <title>XMLHttpRequest: relative URLs in worker scripts resolved by script URL</title>
<link rel="stylesheet" href="/resources/testharness.css" />
<script src="/resources/testharness.js"></script> <script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script> <script src="/resources/testharnessreport.js"></script>
<link rel="help" href="https://xhr.spec.whatwg.org/#the-open()-method" data-tested-assertations="following::OL[1]/LI[3] following::OL[1]/LI[3]/ol[1]/li[1]" /> <link rel="help" href="https://xhr.spec.whatwg.org/#the-open()-method" data-tested-assertations="following::OL[1]/LI[3] following::OL[1]/LI[3]/ol[1]/li[1]" />

View file

@ -11,7 +11,6 @@
<link rel="help" href="https://xhr.spec.whatwg.org/#event-xhr-timeout" data-tested-assertations="../.." /> <link rel="help" href="https://xhr.spec.whatwg.org/#event-xhr-timeout" data-tested-assertations="../.." />
<link rel="help" href="https://xhr.spec.whatwg.org/#request-error" data-tested-assertations="following::ol/li[9]"/> <link rel="help" href="https://xhr.spec.whatwg.org/#request-error" data-tested-assertations="following::ol/li[9]"/>
<link rel="help" href="https://xhr.spec.whatwg.org/#infrastructure-for-the-send()-method" data-tested-assertations="following-sibling::dl//code[contains(@title,'dom-XMLHttpRequest-timeout')]/.. following-sibling::dl//code[contains(@title,'dom-XMLHttpRequest-timeout')]/../following-sibling::dd following::dt[1] following::dd[1]" /> <link rel="help" href="https://xhr.spec.whatwg.org/#infrastructure-for-the-send()-method" data-tested-assertations="following-sibling::dl//code[contains(@title,'dom-XMLHttpRequest-timeout')]/.. following-sibling::dl//code[contains(@title,'dom-XMLHttpRequest-timeout')]/../following-sibling::dd following::dt[1] following::dd[1]" />
<link rel="stylesheet" href="/resources/testharness.css" />
<meta name=timeout content=long> <meta name=timeout content=long>
<script src="/resources/testharness.js"></script> <script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script> <script src="/resources/testharnessreport.js"></script>

View file

@ -7,7 +7,6 @@
<link rel="help" href="https://xhr.spec.whatwg.org/#abort-error" data-tested-assertations=".."/> <link rel="help" href="https://xhr.spec.whatwg.org/#abort-error" data-tested-assertations=".."/>
<link rel="help" href="https://xhr.spec.whatwg.org/#event-xhr-abort" data-tested-assertations="../.." /> <link rel="help" href="https://xhr.spec.whatwg.org/#event-xhr-abort" data-tested-assertations="../.." />
<link rel="help" href="https://xhr.spec.whatwg.org/#request-error" data-tested-assertations="following::ol/li[9]"/> <link rel="help" href="https://xhr.spec.whatwg.org/#request-error" data-tested-assertations="following::ol/li[9]"/>
<link rel="stylesheet" href="/resources/testharness.css" />
<meta name=timeout content=long> <meta name=timeout content=long>
<script src="/resources/testharness.js"></script> <script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script> <script src="/resources/testharnessreport.js"></script>

View file

@ -7,7 +7,6 @@
<link rel="help" href="https://xhr.spec.whatwg.org/#handler-xhr-ontimeout" data-tested-assertations="../.."/> <link rel="help" href="https://xhr.spec.whatwg.org/#handler-xhr-ontimeout" data-tested-assertations="../.."/>
<link rel="help" href="https://xhr.spec.whatwg.org/#timeout-error" data-tested-assertations=".."/> <link rel="help" href="https://xhr.spec.whatwg.org/#timeout-error" data-tested-assertations=".."/>
<link rel="help" href="https://xhr.spec.whatwg.org/#request-error" data-tested-assertations="following::ol[1]/li[9]"/> <link rel="help" href="https://xhr.spec.whatwg.org/#request-error" data-tested-assertations="following::ol[1]/li[9]"/>
<link rel="stylesheet" href="/resources/testharness.css" />
<meta name=timeout content=long> <meta name=timeout content=long>
<script src="/resources/testharness.js"></script> <script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script> <script src="/resources/testharnessreport.js"></script>

View file

@ -8,7 +8,6 @@
<link rel="help" href="https://xhr.spec.whatwg.org/#timeout-error" data-tested-assertations=".."/> <link rel="help" href="https://xhr.spec.whatwg.org/#timeout-error" data-tested-assertations=".."/>
<link rel="help" href="https://xhr.spec.whatwg.org/#request-error" data-tested-assertations="following::ol[1]/li[9]"/> <link rel="help" href="https://xhr.spec.whatwg.org/#request-error" data-tested-assertations="following::ol[1]/li[9]"/>
<link rel="help" href="https://xhr.spec.whatwg.org/#infrastructure-for-the-send()-method" data-tested-assertations="following-sibling::dl//code[contains(@title,'dom-XMLHttpRequest-timeout')]/.. following-sibling::dl//code[contains(@title,'dom-XMLHttpRequest-timeout')]/../following-sibling::dd following::dt[1] following::dd[1]" /> <link rel="help" href="https://xhr.spec.whatwg.org/#infrastructure-for-the-send()-method" data-tested-assertations="following-sibling::dl//code[contains(@title,'dom-XMLHttpRequest-timeout')]/.. following-sibling::dl//code[contains(@title,'dom-XMLHttpRequest-timeout')]/../following-sibling::dd following::dt[1] following::dd[1]" />
<link rel="stylesheet" href="/resources/testharness.css" />
<meta name=timeout content=long> <meta name=timeout content=long>
<script src="/resources/testharness.js"></script> <script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script> <script src="/resources/testharnessreport.js"></script>

View file

@ -8,7 +8,6 @@
<link rel="help" href="https://xhr.spec.whatwg.org/#timeout-error" data-tested-assertations=".."/> <link rel="help" href="https://xhr.spec.whatwg.org/#timeout-error" data-tested-assertations=".."/>
<link rel="help" href="https://xhr.spec.whatwg.org/#request-error" data-tested-assertations="following::ol[1]/li[9]"/> <link rel="help" href="https://xhr.spec.whatwg.org/#request-error" data-tested-assertations="following::ol[1]/li[9]"/>
<link rel="help" href="https://xhr.spec.whatwg.org/#infrastructure-for-the-send()-method" data-tested-assertations="following-sibling::dl//code[contains(@title,'dom-XMLHttpRequest-timeout')]/.. following-sibling::dl//code[contains(@title,'dom-XMLHttpRequest-timeout')]/../following-sibling::dd following::dt[1] following::dd[1]" /> <link rel="help" href="https://xhr.spec.whatwg.org/#infrastructure-for-the-send()-method" data-tested-assertations="following-sibling::dl//code[contains(@title,'dom-XMLHttpRequest-timeout')]/.. following-sibling::dl//code[contains(@title,'dom-XMLHttpRequest-timeout')]/../following-sibling::dd following::dt[1] following::dd[1]" />
<link rel="stylesheet" href="/resources/testharness.css" />
<meta name=timeout content=long> <meta name=timeout content=long>
<script src="/resources/testharness.js"></script> <script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script> <script src="/resources/testharnessreport.js"></script>

View file

@ -5,7 +5,6 @@
<title>XHR2 Timeout Property Tests</title> <title>XHR2 Timeout Property Tests</title>
<link rel="help" href="https://xhr.spec.whatwg.org/#the-timeout-attribute" data-tested-assertations="following::ol[1]/li[1]" /> <link rel="help" href="https://xhr.spec.whatwg.org/#the-timeout-attribute" data-tested-assertations="following::ol[1]/li[1]" />
<link rel="help" href="https://xhr.spec.whatwg.org/#the-open()-method" data-tested-assertations="following::ol[1]/li[10]" /> <link rel="help" href="https://xhr.spec.whatwg.org/#the-open()-method" data-tested-assertations="following::ol[1]/li[10]" />
<link rel="stylesheet" href="/resources/testharness.css" />
<meta name=timeout content=long> <meta name=timeout content=long>
<script src="/resources/testharness.js"></script> <script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script> <script src="/resources/testharnessreport.js"></script>

View file

@ -4,7 +4,6 @@
<meta charset="utf-8" /> <meta charset="utf-8" />
<title>XHR2 Timeout Property Tests</title> <title>XHR2 Timeout Property Tests</title>
<link rel="help" href="https://xhr.spec.whatwg.org/#timeout-error" /> <link rel="help" href="https://xhr.spec.whatwg.org/#timeout-error" />
<link rel="stylesheet" href="/resources/testharness.css" />
<link rel="help" href="https://xhr.spec.whatwg.org/#the-timeout-attribute" data-tested-assertations="following::ol[1]/li[2]" /> <link rel="help" href="https://xhr.spec.whatwg.org/#the-timeout-attribute" data-tested-assertations="following::ol[1]/li[2]" />
<link rel="help" href="https://xhr.spec.whatwg.org/#handler-xhr-ontimeout" data-tested-assertations="../.."/> <link rel="help" href="https://xhr.spec.whatwg.org/#handler-xhr-ontimeout" data-tested-assertations="../.."/>
<link rel="help" href="https://xhr.spec.whatwg.org/#timeout-error" data-tested-assertations=".."/> <link rel="help" href="https://xhr.spec.whatwg.org/#timeout-error" data-tested-assertations=".."/>

View file

@ -11,7 +11,6 @@
<link rel="help" href="https://xhr.spec.whatwg.org/#event-xhr-timeout" data-tested-assertations="../.." /> <link rel="help" href="https://xhr.spec.whatwg.org/#event-xhr-timeout" data-tested-assertations="../.." />
<link rel="help" href="https://xhr.spec.whatwg.org/#request-error" data-tested-assertations="following::ol/li[9]"/> <link rel="help" href="https://xhr.spec.whatwg.org/#request-error" data-tested-assertations="following::ol/li[9]"/>
<link rel="help" href="https://xhr.spec.whatwg.org/#infrastructure-for-the-send()-method" data-tested-assertations="following-sibling::dl//code[contains(@title,'dom-XMLHttpRequest-timeout')]/.. following-sibling::dl//code[contains(@title,'dom-XMLHttpRequest-timeout')]/../following-sibling::dd following::dt[1] following::dd[1]" /> <link rel="help" href="https://xhr.spec.whatwg.org/#infrastructure-for-the-send()-method" data-tested-assertations="following-sibling::dl//code[contains(@title,'dom-XMLHttpRequest-timeout')]/.. following-sibling::dl//code[contains(@title,'dom-XMLHttpRequest-timeout')]/../following-sibling::dd following::dt[1] following::dd[1]" />
<link rel="stylesheet" href="/resources/testharness.css" />
<meta name=timeout content=long> <meta name=timeout content=long>
<script src="/resources/testharness.js"></script> <script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script> <script src="/resources/testharnessreport.js"></script>

View file

@ -7,7 +7,6 @@
<link rel="help" href="https://xhr.spec.whatwg.org/#handler-xhr-ontimeout" data-tested-assertations="../.."/> <link rel="help" href="https://xhr.spec.whatwg.org/#handler-xhr-ontimeout" data-tested-assertations="../.."/>
<link rel="help" href="https://xhr.spec.whatwg.org/#timeout-error" data-tested-assertations=".."/> <link rel="help" href="https://xhr.spec.whatwg.org/#timeout-error" data-tested-assertations=".."/>
<link rel="help" href="https://xhr.spec.whatwg.org/#request-error" data-tested-assertations="following::ol[1]/li[9]"/> <link rel="help" href="https://xhr.spec.whatwg.org/#request-error" data-tested-assertations="following::ol[1]/li[9]"/>
<link rel="stylesheet" href="/resources/testharness.css" />
<meta name=timeout content=long> <meta name=timeout content=long>
<script src="/resources/testharness.js"></script> <script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script> <script src="/resources/testharnessreport.js"></script>

View file

@ -8,7 +8,6 @@
<link rel="help" href="https://xhr.spec.whatwg.org/#timeout-error" data-tested-assertations=".."/> <link rel="help" href="https://xhr.spec.whatwg.org/#timeout-error" data-tested-assertations=".."/>
<link rel="help" href="https://xhr.spec.whatwg.org/#request-error" data-tested-assertations="following::ol[1]/li[9]"/> <link rel="help" href="https://xhr.spec.whatwg.org/#request-error" data-tested-assertations="following::ol[1]/li[9]"/>
<link rel="help" href="https://xhr.spec.whatwg.org/#infrastructure-for-the-send()-method" data-tested-assertations="following-sibling::dl//code[contains(@title,'dom-XMLHttpRequest-timeout')]/.. following-sibling::dl//code[contains(@title,'dom-XMLHttpRequest-timeout')]/../following-sibling::dd following::dt[1] following::dd[1]" /> <link rel="help" href="https://xhr.spec.whatwg.org/#infrastructure-for-the-send()-method" data-tested-assertations="following-sibling::dl//code[contains(@title,'dom-XMLHttpRequest-timeout')]/.. following-sibling::dl//code[contains(@title,'dom-XMLHttpRequest-timeout')]/../following-sibling::dd following::dt[1] following::dd[1]" />
<link rel="stylesheet" href="/resources/testharness.css" />
<meta name=timeout content=long> <meta name=timeout content=long>
<script src="/resources/testharness.js"></script> <script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script> <script src="/resources/testharnessreport.js"></script>

View file

@ -8,7 +8,6 @@
<link rel="help" href="https://xhr.spec.whatwg.org/#timeout-error" data-tested-assertations=".."/> <link rel="help" href="https://xhr.spec.whatwg.org/#timeout-error" data-tested-assertations=".."/>
<link rel="help" href="https://xhr.spec.whatwg.org/#request-error" data-tested-assertations="following::ol[1]/li[9]"/> <link rel="help" href="https://xhr.spec.whatwg.org/#request-error" data-tested-assertations="following::ol[1]/li[9]"/>
<link rel="help" href="https://xhr.spec.whatwg.org/#infrastructure-for-the-send()-method" data-tested-assertations="following-sibling::dl//code[contains(@title,'dom-XMLHttpRequest-timeout')]/.. following-sibling::dl//code[contains(@title,'dom-XMLHttpRequest-timeout')]/../following-sibling::dd following::dt[1] following::dd[1]" /> <link rel="help" href="https://xhr.spec.whatwg.org/#infrastructure-for-the-send()-method" data-tested-assertations="following-sibling::dl//code[contains(@title,'dom-XMLHttpRequest-timeout')]/.. following-sibling::dl//code[contains(@title,'dom-XMLHttpRequest-timeout')]/../following-sibling::dd following::dt[1] following::dd[1]" />
<link rel="stylesheet" href="/resources/testharness.css" />
<meta name=timeout content=long> <meta name=timeout content=long>
<script src="/resources/testharness.js"></script> <script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script> <script src="/resources/testharnessreport.js"></script>

View file

@ -8,7 +8,6 @@
<link rel="help" href="https://xhr.spec.whatwg.org/#timeout-error" data-tested-assertations=".."/> <link rel="help" href="https://xhr.spec.whatwg.org/#timeout-error" data-tested-assertations=".."/>
<link rel="help" href="https://xhr.spec.whatwg.org/#request-error" data-tested-assertations="following::ol[1]/li[9]"/> <link rel="help" href="https://xhr.spec.whatwg.org/#request-error" data-tested-assertations="following::ol[1]/li[9]"/>
<link rel="help" href="https://xhr.spec.whatwg.org/#infrastructure-for-the-send()-method" data-tested-assertations="following-sibling::dl//code[contains(@title,'dom-XMLHttpRequest-timeout')]/.. following-sibling::dl//code[contains(@title,'dom-XMLHttpRequest-timeout')]/../following-sibling::dd following::dt[1] following::dd[1]" /> <link rel="help" href="https://xhr.spec.whatwg.org/#infrastructure-for-the-send()-method" data-tested-assertations="following-sibling::dl//code[contains(@title,'dom-XMLHttpRequest-timeout')]/.. following-sibling::dl//code[contains(@title,'dom-XMLHttpRequest-timeout')]/../following-sibling::dd following::dt[1] following::dd[1]" />
<link rel="stylesheet" href="/resources/testharness.css" />
<meta name=timeout content=long> <meta name=timeout content=long>
<script src="/resources/testharness.js"></script> <script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script> <script src="/resources/testharnessreport.js"></script>

View file

@ -8,7 +8,6 @@
<link rel="help" href="https://xhr.spec.whatwg.org/#timeout-error" data-tested-assertations=".."/> <link rel="help" href="https://xhr.spec.whatwg.org/#timeout-error" data-tested-assertations=".."/>
<link rel="help" href="https://xhr.spec.whatwg.org/#request-error" data-tested-assertations="following::ol[1]/li[9]"/> <link rel="help" href="https://xhr.spec.whatwg.org/#request-error" data-tested-assertations="following::ol[1]/li[9]"/>
<link rel="help" href="https://xhr.spec.whatwg.org/#infrastructure-for-the-send()-method" data-tested-assertations="following-sibling::dl//code[contains(@title,'dom-XMLHttpRequest-timeout')]/.. following-sibling::dl//code[contains(@title,'dom-XMLHttpRequest-timeout')]/../following-sibling::dd following::dt[1] following::dd[1]" /> <link rel="help" href="https://xhr.spec.whatwg.org/#infrastructure-for-the-send()-method" data-tested-assertations="following-sibling::dl//code[contains(@title,'dom-XMLHttpRequest-timeout')]/.. following-sibling::dl//code[contains(@title,'dom-XMLHttpRequest-timeout')]/../following-sibling::dd following::dt[1] following::dd[1]" />
<link rel="stylesheet" href="/resources/testharness.css" />
<meta name=timeout content=long> <meta name=timeout content=long>
<script src="/resources/testharness.js"></script> <script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script> <script src="/resources/testharnessreport.js"></script>

View file

@ -36,7 +36,7 @@ def main(request, response):
#Log that the preflight actually happened if we have an ident #Log that the preflight actually happened if we have an ident
if 'token' in request.GET: if 'token' in request.GET:
request.server.stash.put(request.GET['token']) request.server.stash.put(request.GET['token'], True)
if 'location' in request.GET: if 'location' in request.GET:
if code is None: if code is None:

View file

@ -2,6 +2,7 @@
<html> <html>
<head> <head>
<title>Attached callback of a custom element should be called </title> <title>Attached callback of a custom element should be called </title>
<meta name="timeout" content="long">
<meta name="author" title="Sergey G. Grekhov" href="mailto:sgrekhov@unipro.ru"> <meta name="author" title="Sergey G. Grekhov" href="mailto:sgrekhov@unipro.ru">
<meta name="assert" content="attached callback ... must be enqueued whenever custom element is inserted into a document and this document has a browsing context."> <meta name="assert" content="attached callback ... must be enqueued whenever custom element is inserted into a document and this document has a browsing context.">
<link rel="help" href="http://www.w3.org/TR/custom-elements/#types-of-callbacks"> <link rel="help" href="http://www.w3.org/TR/custom-elements/#types-of-callbacks">

View file

@ -459,4 +459,104 @@ test(function() {
var el2 = document.createElement("div"); var el2 = document.createElement("div");
assert_throws("INUSE_ATTRIBUTE_ERR", function(){el2.setAttributeNode(attrNode)}); assert_throws("INUSE_ATTRIBUTE_ERR", function(){el2.setAttributeNode(attrNode)});
}, "setAttributeNode on bound attribute should throw InUseAttributeError") }, "setAttributeNode on bound attribute should throw InUseAttributeError")
test(function() {
var el = document.createElement("div");
el.setAttribute("foo", "bar");
assert_equals(el.getAttributeNames().length, 1);
assert_equals(el.getAttributeNames()[0], el.attributes[0].name);
assert_equals(el.getAttributeNames()[0], "foo");
el.removeAttribute("foo");
assert_equals(el.getAttributeNames().length, 0);
el.setAttribute("foo", "bar");
el.setAttributeNS("", "FOO", "bar");
el.setAttributeNS("dummy1", "foo", "bar");
el.setAttributeNS("dummy2", "dummy:foo", "bar");
assert_equals(el.getAttributeNames().length, 4);
assert_equals(el.getAttributeNames()[0], "foo");
assert_equals(el.getAttributeNames()[1], "FOO");
assert_equals(el.getAttributeNames()[2], "foo");
assert_equals(el.getAttributeNames()[3], "dummy:foo");
assert_equals(el.getAttributeNames()[0], el.attributes[0].name);
assert_equals(el.getAttributeNames()[1], el.attributes[1].name);
assert_equals(el.getAttributeNames()[2], el.attributes[2].name);
assert_equals(el.getAttributeNames()[3], el.attributes[3].name);
el.removeAttributeNS("", "FOO");
assert_equals(el.getAttributeNames().length, 3);
assert_equals(el.getAttributeNames()[0], "foo");
assert_equals(el.getAttributeNames()[1], "foo");
assert_equals(el.getAttributeNames()[2], "dummy:foo");
assert_equals(el.getAttributeNames()[0], el.attributes[0].name);
assert_equals(el.getAttributeNames()[1], el.attributes[1].name);
assert_equals(el.getAttributeNames()[2], el.attributes[2].name);
}, "getAttributeNames tests");
function getEnumerableOwnProps1(obj) {
var arr = [];
for (var prop in obj) {
if (obj.hasOwnProperty(prop)) {
arr.push(prop);
}
}
return arr;
}
function getEnumerableOwnProps2(obj) {
return Object.getOwnPropertyNames(obj).filter(
(name) => Object.getOwnPropertyDescriptor(obj, name).enumerable)
}
test(function() {
var el = document.createElement("div");
el.setAttribute("a", "");
el.setAttribute("b", "");
assert_array_equals(getEnumerableOwnProps1(el.attributes),
["0", "1"])
assert_array_equals(getEnumerableOwnProps2(el.attributes),
["0", "1"])
assert_array_equals(Object.getOwnPropertyNames(el.attributes),
["0", "1", "a", "b"])
}, "Own property correctness with basic attributes");
test(function() {
var el = document.createElement("div");
el.setAttributeNS("", "a", "");
el.setAttribute("b", "");
el.setAttributeNS("foo", "a", "");
assert_array_equals(getEnumerableOwnProps1(el.attributes),
["0", "1", "2"])
assert_array_equals(getEnumerableOwnProps2(el.attributes),
["0", "1", "2"])
assert_array_equals(Object.getOwnPropertyNames(el.attributes),
["0", "1", "2", "a", "b"])
}, "Own property correctness with non-namespaced attribute before same-name namespaced one");
test(function() {
var el = document.createElement("div");
el.setAttributeNS("foo", "a", "");
el.setAttribute("b", "");
el.setAttributeNS("", "a", "");
assert_array_equals(getEnumerableOwnProps1(el.attributes),
["0", "1", "2"])
assert_array_equals(getEnumerableOwnProps2(el.attributes),
["0", "1", "2"])
assert_array_equals(Object.getOwnPropertyNames(el.attributes),
["0", "1", "2", "a", "b"])
}, "Own property correctness with namespaced attribute before same-name non-namespaced one");
test(function() {
var el = document.createElement("div");
el.setAttributeNS("foo", "a:b", "");
el.setAttributeNS("foo", "c:d", "");
el.setAttributeNS("bar", "a:b", "");
assert_array_equals(getEnumerableOwnProps1(el.attributes),
["0", "1", "2"])
assert_array_equals(getEnumerableOwnProps2(el.attributes),
["0", "1", "2"])
assert_array_equals(Object.getOwnPropertyNames(el.attributes),
["0", "1", "2", "a:b", "c:d"])
}, "Own property correctness with two namespaced attributes with the same name-with-prefix");
</script> </script>

View file

@ -7,7 +7,6 @@
<link rel="help" href="http://www.w3.org/TR/hr-time/#sec-extenstions-performance-interface"/> <link rel="help" href="http://www.w3.org/TR/hr-time/#sec-extenstions-performance-interface"/>
<script src="/resources/testharness.js"></script> <script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script> <script src="/resources/testharnessreport.js"></script>
<link rel="stylesheet" href="/resources/testharness.css" />
<script> <script>
test(function() { test(function() {
assert_equals(typeof window.performance, "object"); assert_equals(typeof window.performance, "object");

View file

@ -7,7 +7,6 @@
<link rel="help" href="http://www.w3.org/TR/hr-time/#sec-monotonic-clock"/> <link rel="help" href="http://www.w3.org/TR/hr-time/#sec-monotonic-clock"/>
<script src="/resources/testharness.js"></script> <script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script> <script src="/resources/testharnessreport.js"></script>
<link rel="stylesheet" href="/resources/testharness.css" />
<script> <script>
test(function() { test(function() {
assert_true(window.performance.now() > 0, "window.performance.now() returns positive numbers"); assert_true(window.performance.now() > 0, "window.performance.now() returns positive numbers");

View file

@ -1,12 +1,13 @@
<!doctype html> <!doctype html>
<!-- this tests the spec as it hopefully will be once bug https://www.w3.org/Bugs/Public/show_bug.cgi?id=17155 is fixed --> <!-- this tests the spec as it hopefully will be once bug https://www.w3.org/Bugs/Public/show_bug.cgi?id=17155 is fixed -->
<title>Fragment Navigation: hashchange event multiple changes old/newURL</title> <title>Fragment Navigation: hashchange event multiple changes old/newURL</title>
<meta name=timeout content=long>
<script src="/resources/testharness.js"></script> <script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script> <script src="/resources/testharnessreport.js"></script>
<body> <body>
<div id="log"></div> <div id="log"></div>
<script> <script>
var t = async_test(undefined, {timeout:30000}); var t = async_test();
t.step(function() { t.step(function() {
var original_url = location.href; var original_url = location.href;
assert_equals(location.hash, "", "Page must be loaded with no hash"); assert_equals(location.hash, "", "Page must be loaded with no hash");
@ -19,12 +20,12 @@ t.step(function() {
addEventListener("hashchange", addEventListener("hashchange",
t.step_func(function(e) { t.step_func(function(e) {
if (count < 1000) { if (count < 100) {
location.hash = "test" + count++; location.hash = "test" + count++;
hashes.push(location.hash); hashes.push(location.hash);
} else if (count === 1000) { } else if (count === 100) {
expected = []; expected = [];
for (var i=0; i<1000; i++) { for (var i=0; i<100; i++) {
expected.push("#test" + i); expected.push("#test" + i);
} }
assert_array_equals(hashes, expected); assert_array_equals(hashes, expected);

View file

@ -3,12 +3,12 @@
<title>[Browsing Context] : [APIs for creating browsing_contexts by name]</title> <title>[Browsing Context] : [APIs for creating browsing_contexts by name]</title>
<link rel="author" title="Duhyeong Kim" href="mailto:dduskim@gmail.com"> <link rel="author" title="Duhyeong Kim" href="mailto:dduskim@gmail.com">
<link rel="help" href="https://html.spec.whatwg.org/multipage/#apis-for-creating-and-navigating-browsing-contexts-by-name"> <link rel="help" href="https://html.spec.whatwg.org/multipage/#apis-for-creating-and-navigating-browsing-contexts-by-name">
<meta name=timeout content=long>
<script src="/resources/testharness.js"></script> <script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script> <script src="/resources/testharnessreport.js"></script>
<div id="log"></div>
<script> <script>
async_test(function() { async_test(function() {
var currentUrl = 'http://' + window.location.host + '/'; var currentUrl = 'http://' + window.location.host + '/common/blank.html';
var win = window.open(currentUrl, '', 'height=1,width=1'); var win = window.open(currentUrl, '', 'height=1,width=1');
this.add_cleanup(function() { win.close(); }); this.add_cleanup(function() { win.close(); });
win.onload = this.step_func_done(function () { win.onload = this.step_func_done(function () {

View file

@ -8,7 +8,6 @@
<script src="/resources/testharness.js"></script> <script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script> <script src="/resources/testharnessreport.js"></script>
<script src="resources/webperftestharness.js"></script> <script src="resources/webperftestharness.js"></script>
<link rel="stylesheet" href="/resources/testharness.css" />
<script> <script>
setup({explicit_done: true}); setup({explicit_done: true});

View file

@ -7,7 +7,6 @@
<link rel="help" href="http://www.w3.org/TR/html5/dom.html#resource-metadata-management"/> <link rel="help" href="http://www.w3.org/TR/html5/dom.html#resource-metadata-management"/>
<script src="/resources/testharness.js"></script> <script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script> <script src="/resources/testharnessreport.js"></script>
<link rel="stylesheet" href="/resources/testharness.css" />
<script> <script>
setup({ explicit_done: true }); setup({ explicit_done: true });
var has_loading = (document.readyState == "loading"); var has_loading = (document.readyState == "loading");

View file

@ -8,7 +8,6 @@
<script src="/resources/testharness.js"></script> <script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script> <script src="/resources/testharnessreport.js"></script>
<script src="resources/webperftestharness.js"></script> <script src="resources/webperftestharness.js"></script>
<link rel="stylesheet" href="/resources/testharness.css" />
<script> <script>
setup({explicit_done: true}); setup({explicit_done: true});

View file

@ -8,7 +8,6 @@
<script src="/resources/testharness.js"></script> <script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script> <script src="/resources/testharnessreport.js"></script>
<script src="resources/webperftestharness.js"></script> <script src="resources/webperftestharness.js"></script>
<link rel="stylesheet" href="/resources/testharness.css" />
<script> <script>
setup({explicit_done: true}); setup({explicit_done: true});

View file

@ -8,7 +8,6 @@
<script src="/resources/testharness.js"></script> <script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script> <script src="/resources/testharnessreport.js"></script>
<script src="resources/webperftestharness.js"></script> <script src="resources/webperftestharness.js"></script>
<link rel="stylesheet" href="/resources/testharness.css" />
<script> <script>
setup({explicit_done: true}); setup({explicit_done: true});

View file

@ -8,7 +8,6 @@
<script src="/resources/testharness.js"></script> <script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script> <script src="/resources/testharnessreport.js"></script>
<script src="resources/webperftestharness.js"></script> <script src="resources/webperftestharness.js"></script>
<link rel="stylesheet" href="/resources/testharness.css" />
</head> </head>
<body> <body>
<h1>Description</h1> <h1>Description</h1>

View file

@ -8,7 +8,6 @@
<script src="/resources/testharness.js"></script> <script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script> <script src="/resources/testharnessreport.js"></script>
<script src="resources/webperftestharness.js"></script> <script src="resources/webperftestharness.js"></script>
<link rel="stylesheet" href="/resources/testharness.css" />
<script> <script>
function onload_test() { function onload_test() {
var objWindow = var objWindow =

View file

@ -9,7 +9,6 @@
<script src="/resources/testharness.js"></script> <script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script> <script src="/resources/testharnessreport.js"></script>
<script src="resources/webperftestharness.js"></script> <script src="resources/webperftestharness.js"></script>
<link rel="stylesheet" href="/resources/testharness.css" />
</head> </head>
<body> <body>
<h1>Description</h1> <h1>Description</h1>

View file

@ -8,7 +8,6 @@
<script src="/resources/testharness.js"></script> <script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script> <script src="/resources/testharnessreport.js"></script>
<script src="resources/webperftestharness.js"></script> <script src="resources/webperftestharness.js"></script>
<link rel="stylesheet" href="/resources/testharness.css" />
<script> <script>
setup({explicit_done: true}); setup({explicit_done: true});

View file

@ -8,7 +8,6 @@
<script src="/resources/testharness.js"></script> <script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script> <script src="/resources/testharnessreport.js"></script>
<script src="resources/webperftestharness.js"></script> <script src="resources/webperftestharness.js"></script>
<link rel="stylesheet" href="/resources/testharness.css" />
<script> <script>
setup({explicit_done: true}); setup({explicit_done: true});

View file

@ -8,7 +8,6 @@
<script src="/resources/testharness.js"></script> <script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script> <script src="/resources/testharnessreport.js"></script>
<script src="resources/webperftestharness.js"></script> <script src="resources/webperftestharness.js"></script>
<link rel="stylesheet" href="/resources/testharness.css" />
<script> <script>
setup({explicit_done: true}); setup({explicit_done: true});

View file

@ -9,7 +9,6 @@
<script src="/resources/testharness.js"></script> <script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script> <script src="/resources/testharnessreport.js"></script>
<script src="resources/webperftestharness.js"></script> <script src="resources/webperftestharness.js"></script>
<link rel="stylesheet" href="/resources/testharness.css" />
</head> </head>
<body> <body>
<h1>Description</h1> <h1>Description</h1>

View file

@ -60,7 +60,7 @@ metadata, as described in the [metadata](#metadata) section below.
Testing asynchronous features is somewhat more complex since the result of Testing asynchronous features is somewhat more complex since the result of
a test may depend on one or more events or other callbacks. The API provided a test may depend on one or more events or other callbacks. The API provided
for testing these features is indended to be rather low-level but hopefully for testing these features is intended to be rather low-level but hopefully
applicable to many situations. applicable to many situations.
To create a test, one starts by getting a Test object using async_test: To create a test, one starts by getting a Test object using async_test:
@ -225,7 +225,7 @@ wrapping everything in functions for isolation becomes
burdensome. For these cases `testharness.js` support "single page burdensome. For these cases `testharness.js` support "single page
tests". tests".
In order for a test to be interpreted as a single page test, the In order for a test to be interpreted as a single page test, then
it must simply not call `test()` or `async_test()` anywhere on the page, and it must simply not call `test()` or `async_test()` anywhere on the page, and
must call the `done()` function to indicate that the test is complete. All must call the `done()` function to indicate that the test is complete. All
the `assert_*` functions are avaliable as normal, but are called without the `assert_*` functions are avaliable as normal, but are called without
@ -243,7 +243,7 @@ the normal step function wrapper. For example:
</script> </script>
``` ```
The test title for sinple page tests is always taken from `document.title`. The test title for single page tests is always taken from `document.title`.
## Making assertions ## ## Making assertions ##
@ -424,8 +424,8 @@ The framework provides callbacks corresponding to 4 events:
* `start` - triggered when the first Test is created * `start` - triggered when the first Test is created
* `test_state` - triggered when a test state changes * `test_state` - triggered when a test state changes
* `result` - triggered when a test result is recieved * `result` - triggered when a test result is received
* `complete` - triggered when all results are recieved * `complete` - triggered when all results are received
The page defining the tests may add callbacks for these events by calling The page defining the tests may add callbacks for these events by calling
the following methods: the following methods:

View file

@ -2,17 +2,11 @@ import os
import urlparse import urlparse
from abc import ABCMeta, abstractmethod, abstractproperty from abc import ABCMeta, abstractmethod, abstractproperty
from utils import from_os_path, to_os_path
item_types = ["testharness", "reftest", "manual", "stub", "wdspec"] item_types = ["testharness", "reftest", "manual", "stub", "wdspec"]
def from_os_path(path):
return path.replace(os.path.sep, "/")
def to_os_path(path):
return path.replace("/", os.path.sep)
def get_source_file(source_files, tests_root, manifest, path): def get_source_file(source_files, tests_root, manifest, path):
def make_new(): def make_new():
from sourcefile import SourceFile from sourcefile import SourceFile

View file

@ -5,6 +5,7 @@ from collections import defaultdict
from item import item_types, ManualTest, WebdriverSpecTest, Stub, RefTest, TestharnessTest from item import item_types, ManualTest, WebdriverSpecTest, Stub, RefTest, TestharnessTest
from log import get_logger from log import get_logger
from sourcefile import SourceFile from sourcefile import SourceFile
from utils import from_os_path, to_os_path
CURRENT_VERSION = 2 CURRENT_VERSION = 2
@ -207,7 +208,7 @@ class Manifest(object):
for item_type, items in self._data.iteritems() for item_type, items in self._data.iteritems()
} }
reftest_nodes = {key:[v.to_json() for v in value] reftest_nodes = {from_os_path(key): [v.to_json() for v in value]
for key, value in self.reftest_nodes.iteritems()} for key, value in self.reftest_nodes.iteritems()}
rv = {"url_base": self.url_base, rv = {"url_base": self.url_base,
@ -246,6 +247,7 @@ class Manifest(object):
self._add(manifest_item) self._add(manifest_item)
for path, values in obj["reftest_nodes"].iteritems(): for path, values in obj["reftest_nodes"].iteritems():
path = to_os_path(path)
for v in values: for v in values:
item = RefTest.from_json(self, tests_root, v, item = RefTest.from_json(self, tests_root, v,
source_files=source_files) source_files=source_files)
@ -306,17 +308,16 @@ class LocalChanges(object):
return self._data[item_type] return self._data[item_type]
def to_json(self): def to_json(self):
reftest_nodes = {key:[v.to_json() for v in value] reftest_nodes = {from_os_path(key): [v.to_json() for v in value]
for key, value in self.reftest_nodes.iteritems()} for key, value in self.reftest_nodes.iteritems()}
rv = {"items": defaultdict(dict), rv = {"items": defaultdict(dict),
"reftest_nodes": reftest_nodes, "reftest_nodes": reftest_nodes,
"deleted": []} "deleted": [from_os_path(path) for path in self._deleted]}
rv["deleted"].extend(self._deleted)
for test_type, paths in self._data.iteritems(): for test_type, paths in self._data.iteritems():
for path, tests in paths.iteritems(): for path, tests in paths.iteritems():
path = from_os_path(path)
rv["items"][test_type][path] = [test.to_json() for test in tests] rv["items"][test_type][path] = [test.to_json() for test in tests]
return rv return rv
@ -343,6 +344,7 @@ class LocalChanges(object):
self.add(manifest_item) self.add(manifest_item)
for path, values in obj["reftest_nodes"].iteritems(): for path, values in obj["reftest_nodes"].iteritems():
path = to_os_path(path)
for v in values: for v in values:
item = RefTest.from_json(self.manifest, tests_root, v, item = RefTest.from_json(self.manifest, tests_root, v,
source_files=source_files) source_files=source_files)
@ -350,7 +352,7 @@ class LocalChanges(object):
self.reftest_nodes_by_url[item.url] = item self.reftest_nodes_by_url[item.url] = item
for item in obj["deleted"]: for item in obj["deleted"]:
self.add_deleted(item) self.add_deleted(to_os_path(item))
return self return self

View file

@ -21,6 +21,12 @@ def is_blacklisted(url):
return True return True
return False return False
def from_os_path(path):
return path.replace(os.path.sep, "/")
def to_os_path(path):
return path.replace("/", os.path.sep)
class ContextManagerStringIO(StringIO): class ContextManagerStringIO(StringIO):
def __enter__(self): def __enter__(self):
return self return self

View file

@ -137,7 +137,9 @@ class FileHandler(object):
if "pipe" in query: if "pipe" in query:
pipeline = Pipeline(query["pipe"][-1]) pipeline = Pipeline(query["pipe"][-1])
elif os.path.splitext(path)[0].endswith(".sub"): elif os.path.splitext(path)[0].endswith(".sub"):
pipeline = Pipeline("sub") ml_extensions = {".html", ".htm", ".xht", ".xhtml", ".xml", ".svg"}
escape_type = "html" if os.path.splitext(path)[1] in ml_extensions else "none"
pipeline = Pipeline("sub(%s)" % escape_type)
if pipeline is not None: if pipeline is not None:
response = pipeline(request, response) response = pipeline(request, response)
@ -167,7 +169,7 @@ class FileHandler(object):
return [] return []
else: else:
if use_sub: if use_sub:
data = template(request, data) data = template(request, data, escape_type="none")
return [tuple(item.strip() for item in line.split(":", 1)) return [tuple(item.strip() for item in line.split(":", 1))
for line in data.splitlines() if line] for line in data.splitlines() if line]

View file

@ -313,10 +313,13 @@ class FirstWrapper(object):
return "" return ""
@pipe() @pipe(opt(nullable(str)))
def sub(request, response): def sub(request, response, escape_type="html"):
"""Substitute environment information about the server and request into the script. """Substitute environment information about the server and request into the script.
:param escape_type: String detailing the type of escaping to use. Known values are
"html" and "none", with "html" the default for historic reasons.
The format is a very limited template language. Substitutions are The format is a very limited template language. Substitutions are
enclosed by {{ and }}. There are several avaliable substitutions: enclosed by {{ and }}. There are several avaliable substitutions:
@ -359,12 +362,12 @@ def sub(request, response):
""" """
content = resolve_content(response) content = resolve_content(response)
new_content = template(request, content) new_content = template(request, content, escape_type=escape_type)
response.content = new_content response.content = new_content
return response return response
def template(request, content): def template(request, content, escape_type="html"):
#TODO: There basically isn't any error handling here #TODO: There basically isn't any error handling here
tokenizer = ReplacementTokenizer() tokenizer = ReplacementTokenizer()
@ -419,9 +422,12 @@ def template(request, content):
if variable is not None: if variable is not None:
variables[variable] = value variables[variable] = value
escape_func = {"html": lambda x:escape(x, quote=True),
"none": lambda x:x}[escape_type]
#Should possibly support escaping for other contexts e.g. script #Should possibly support escaping for other contexts e.g. script
#TODO: read the encoding of the response #TODO: read the encoding of the response
return escape(unicode(value), quote=True).encode("utf-8") return escape_func(unicode(value)).encode("utf-8")
template_regexp = re.compile(r"{{([^}]*)}}") template_regexp = re.compile(r"{{([^}]*)}}")
new_content, count = template_regexp.subn(config_replacement, content) new_content, count = template_regexp.subn(config_replacement, content)

View file

@ -119,7 +119,7 @@ class Stash(object):
if internal_key in self.data: if internal_key in self.data:
raise StashError("Tried to overwrite existing shared stash value " raise StashError("Tried to overwrite existing shared stash value "
"for key %s (old value was %s, new value is %s)" % "for key %s (old value was %s, new value is %s)" %
(internal_key, self[str(internal_key)], value)) (internal_key, self.data[str(internal_key)], value))
else: else:
self.data[internal_key] = value self.data[internal_key] = value