Skip to content
This repository has been archived by the owner on Mar 13, 2018. It is now read-only.

Commit

Permalink
Fix issue with DOMTokenList
Browse files Browse the repository at this point in the history
The build.json file did not include DOMTokenList leading to
classList being brokon in 0.3.0

This adds a test that ensures that the list of files is in sync so
that these kind of errors do not happen again.

Fixes #445
  • Loading branch information
arv committed May 30, 2014
1 parent 2ca1cd3 commit 8fc5538
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 1 deletion.
1 change: 1 addition & 0 deletions build.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"src/wrappers/node-interfaces.js",
"src/wrappers/CharacterData.js",
"src/wrappers/Text.js",
"src/wrappers/DOMTokenList.js",
"src/wrappers/Element.js",
"src/wrappers/HTMLElement.js",
"src/wrappers/HTMLCanvasElement.js",
Expand Down
41 changes: 41 additions & 0 deletions test/js/build-json.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/*
* Copyright 2014 The Polymer Authors. All rights reserved.
* Use of this source code is goverened by a BSD-style
* license that can be found in the LICENSE file.
*/

suite('build.json', function() {

teardown(function() {
delete document.write;
});

test('Ensure lists match', function(done) {
var xhrJson = new XMLHttpRequest;
xhrJson.open('GET', '../build.json');
xhrJson.onload = function() {
var buildJson = JSON.parse(xhrJson.responseText);

var xhrJs = new XMLHttpRequest;
xhrJs.open('GET', '../shadowdom.js');
xhrJs.onload = function() {
var sources = [];

document.write = function(s) {
var path =
s.slice('<script src="../'.length, - '"><\/script>'.length);
sources.push(path);
};

('global', eval)(xhrJs.responseText);

assert.deepEqual(buildJson, sources);

done();
};
xhrJs.send(null);
};
xhrJson.send();
});

});
3 changes: 2 additions & 1 deletion test/test.main.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ mocha.setup({
var modules = [
'ChildNodeInterface.js',
'Comment.js',
'Document.js',
'DOMTokenList.js',
'Document.js',
'Element.js',
'HTMLAudioElement.js',
'HTMLBodyElement.js',
Expand Down Expand Up @@ -122,6 +122,7 @@ var modules = [
'TouchEvent.js',
'TreeScope.js',
'Window.js',
'build-json.js',
'createTable.js',
'custom-element.js',
'events.js',
Expand Down

0 comments on commit 8fc5538

Please sign in to comment.