From d1a8cbe9ec5d37344eec470882c7f8e90f52be77 Mon Sep 17 00:00:00 2001 From: Peter Linss Date: Sat, 9 Feb 2013 12:45:54 -0800 Subject: [PATCH 1/2] Added support for flags to per-test metadata --- testharness.js | 3 +++ testharnessreport.js | 6 +++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/testharness.js b/testharness.js index 5a2cd2a..5a602ff 100644 --- a/testharness.js +++ b/testharness.js @@ -71,6 +71,9 @@ policies and contribution forms [3]. * author - Name and contact information for the author of the test in the * format: "Name " or "Name http://contact/url" * + * flags - space separated list of test flags in addition to any present in + * the head metadata + * * == Asynchronous Tests == * * Testing asynchronous features is somewhat more complex since the result of diff --git a/testharnessreport.js b/testharnessreport.js index fa73347..ea72143 100644 --- a/testharnessreport.js +++ b/testharnessreport.js @@ -28,7 +28,7 @@ var metadata_generator = { currentMetadata: {}, cachedMetadata: false, - metadataProperties: ['help', 'assert', 'author'], + metadataProperties: ['help', 'assert', 'author', 'flags'], error: function(message) { var messageElement = document.createElement('p'); @@ -338,6 +338,10 @@ var metadata_generator = { showSource = true; } } + else if (1 < tests.length) { +// message = 'Cached metadata not present. '; + showSource = true; + } } if (message) { From 9c9b87467896e60149db03a76c9da96e50655286 Mon Sep 17 00:00:00 2001 From: plinss Date: Wed, 20 Feb 2013 11:37:13 -0800 Subject: [PATCH 2/2] Update testharnessreport.js Ignore empty metadata values --- testharnessreport.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testharnessreport.js b/testharnessreport.js index ea72143..4129394 100644 --- a/testharnessreport.js +++ b/testharnessreport.js @@ -77,7 +77,7 @@ var metadata_generator = { for (var metaIndex = 0; metaIndex < this.metadataProperties.length; metaIndex++) { var meta = this.metadataProperties[metaIndex]; - if (test.properties.hasOwnProperty(meta)) { + if (test.properties.hasOwnProperty(meta) && test.properties[meta]) { if ('author' == meta) { this.validateContact(test, meta); }