function loadWithConfig (conf, check) {
var config = [];
for (var k in conf) {
config.push(k + "=" + encodeURI($.isArray(conf[k]) ? JSON.stringify(conf[k]) : conf[k]).replace(/=/g, "%3D"));
}
var $ifr = $("")
, loaded = false
, MAXOUT = 5000
, incr = function (ev) {
if (ev.data && ev.data.topic == "end-all") loaded = true;
}
;
$ifr.attr("src", "spec/core/simple.html?" + config.join(";"));
runs(function () {
window.addEventListener("message", incr, false);
$ifr.appendTo($("body"));
});
waitsFor(function () { return loaded; }, MAXOUT);
runs(function () {
check($ifr);
$ifr.remove();
loaded = false;
window.removeEventListener("message", incr, false);
});
}
describe("W3C — Permalinks", function () {
var MAXOUT = 5000
, basicConfig = {
editors: [{ name: "Shane McCarron",
url: "http://URI",
company: "COMPANY",
companyURI: "http://COMPANY",
mailto: "EMAIL",
note: "NOTE"}]
, shortName: "some-spec"
, publicationDate: "2013-06-25"
, previousPublishDate: "2012-06-07"
, previousMaturity: "REC"
, specStatus: "PER"
, wgPatentURI: "http://www.w3.org/fake-patent-uri"
, includePermalinks: true
, doRDFa: 1.1
}
, noConfig = {
editors: [{ name: "Shane McCarron",
url: "http://URI",
company: "COMPANY",
companyURI: "http://COMPANY",
mailto: "EMAIL",
note: "NOTE"}]
, shortName: "some-spec"
, publicationDate: "2013-06-25"
, previousPublishDate: "2012-06-07"
, previousMaturity: "REC"
, specStatus: "PER"
, includePermalinks: false
, doRDFa: false
};
it("permalinks data should be added when section or h* have an id", function () {
var doc;
runs(function () {
makeRSDoc({ config: basicConfig, body: $(" some contenta heading
some content
some content
Other Content
some content
some content
some content
some content