Update web-platform-tests to revision 53f3408ffe1fd0e56a37aff4aaf1fa8441c41d6d

This commit is contained in:
Ms2ger 2016-07-12 09:30:50 +02:00
parent 9b01a4cc97
commit 0edf0ececb
59 changed files with 2247 additions and 1071 deletions

View file

@ -0,0 +1,9 @@
Example Tests
=============
The tests in this folder are examples to show how the framework
should be used. They are NOT intended for conformance testing use, and
tools/make_tests.py will not generate the tests in this folder without the
`--examples` option.

View file

@ -0,0 +1,46 @@
<!doctype html>
<html>
<head>
<title>Verify annotation conforms to the model</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/annotation-model/scripts/ajv.min.js"></script>
<script src="/annotation-model/scripts/JSONtest.js"></script>
<script>
setup({explicit_timeout: true, explicit_done: true });
var theDefinitions=[
"definitions/specificResource.json",
"definitions/stringUri.json",
"definitions/choiceSet.json",
"definitions/externalWebResource.json",
"definitions/textualBody.json"
];
var theTestFile="example1.test";
var runningTest = new JSONtest( {
"testInput" : "annotation-input",
"runTest" : "annotation-run",
"closeWindow" : "annotation-close",
"schemaDefs" : theDefinitions,
"testFile" : theTestFile
} ) ;
</script>
</head>
<body>
<p>Fill the textarea below with JSON output from your annotation client
implementation that supports the following criteria:</p>
<div id="testDescription"></div>
<p>Specifically, the following assertions will be evaluated:</p>
<div id="assertion"></div>
<form name="annotation" id="annotation">
<textarea name="annotation-input" id="annotation-input" style="width: 90%; height: 10em" >
</textarea>
<p><input type="button" id="annotation-run" name="Loading..." value="Loading...">
<input style="display: none" type="button" id="annotation-close"
name="Close" value="Close"></p>
</form>
</body>
</html>

View file

@ -0,0 +1,10 @@
{
"@context": "https://www.w3.org/ns/JSONtest-v1.jsonld",
"name": "Verify annotation conforms to the model",
"description": "Supply an example annotation that conforms to the basic structure.",
"ref": "https://www.w3.org/TR/annotation-model/#model",
"assertions": [
"exampleContext.json",
"exampleTarget.json"
]
}

View file

@ -0,0 +1,46 @@
<!doctype html>
<html>
<head>
<title>A test that has an 'or' clause</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/annotation-model/scripts/ajv.min.js"></script>
<script src="/annotation-model/scripts/JSONtest.js"></script>
<script>
setup({explicit_timeout: true, explicit_done: true });
var theDefinitions=[
"definitions/specificResource.json",
"definitions/stringUri.json",
"definitions/choiceSet.json",
"definitions/externalWebResource.json",
"definitions/textualBody.json"
];
var theTestFile="example2.test";
var runningTest = new JSONtest( {
"testInput" : "annotation-input",
"runTest" : "annotation-run",
"closeWindow" : "annotation-close",
"schemaDefs" : theDefinitions,
"testFile" : theTestFile
} ) ;
</script>
</head>
<body>
<p>Fill the textarea below with JSON output from your annotation client
implementation that supports the following criteria:</p>
<div id="testDescription"></div>
<p>Specifically, the following assertions will be evaluated:</p>
<div id="assertion"></div>
<form name="annotation" id="annotation">
<textarea name="annotation-input" id="annotation-input" style="width: 90%; height: 10em" >
</textarea>
<p><input type="button" id="annotation-run" name="Loading..." value="Loading...">
<input style="display: none" type="button" id="annotation-close"
name="Close" value="Close"></p>
</form>
</body>
</html>

View file

@ -0,0 +1,42 @@
{
"@context": "https://www.w3.org/ns/JSONtest-v1.jsonld",
"name": "A test that has an 'or' clause",
"description": "This is a complex test that uses or-ing among a list of assertions.",
"ref": "https://www.w3.org/TR/annotation-model/#model",
"testType": "manual",
"assertions":
{ "title": "Condition Object",
"description": "A pseudo-test that will get a result from the aggregate of its children",
"assertionType": "must",
"expectedResult": "valid",
"errorMessage": "Error: None of the various options were present",
"compareWith": "or",
"assertions": [
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "'The Annotation must have 1 or more @context values' (Section 3.1)",
"assertionType": "must",
"expectedResult": "valid",
"errorMessage": "Error: Annotation does not have an @context property.",
"type": "object",
"properties": {
"@context": {}
},
"required": ["@context"]
},
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "'An Annotation should have exactly 1 id' (Section 3.1)",
"assertionType": "should",
"expectedResult": "valid",
"errorMessage": "Warning: The Annotation is not identified using the id key (Section 3.1).",
"type": "object",
"properties": {
"id": {}
},
"required": ["id"]
}
]
}
}

View file

@ -0,0 +1,31 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Check @context value",
"description": "'http://www.w3.org/ns/anno.jsonld must be' an @context value (Section 3.1)",
"assertionType": "must",
"expectedResult": "valid",
"errorMessage": "Error: 'http://www.w3.org/ns/anno.jsonld' is not an @context value.",
"type": "object",
"properties": {
"@context": {
"oneOf": [
{ "type": "string",
"$ref": "#/definitions/contextValue" },
{ "type": "array",
"$ref": "#/definitions/contextArray" }
]
}
},
"definitions": {
"contextValue":
{ "enum": [ "http://www.w3.org/ns/anno.jsonld" ] },
"contextArray":
{ "not":
{ "items":
{ "not":
{ "type": "string",
"$ref": "#/definitions/contextValue" } }
}
}
}
}

View file

@ -0,0 +1,13 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Check if target feature implemented",
"description": "'There must be 1 or more target relationships associated with an Annotation.' (Section 3.1)",
"assertionType": "must",
"expectedResult": "valid",
"errorMessage": "Error: Annotation has no target relationships - at least 1 is required. (Section 3.1)",
"type": "object",
"properties": {
"target": { "type": ["string", "array", "object"] }
},
"required": ["target"]
}