Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(110)

Side by Side Diff: LayoutTests/fast/dom/MicroData/resources/microdata-common.js

Issue 14028014: Remove MicroData implementation (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Also delete all the tests Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // this function creates element with specified property and contents.
2 function createElement(type, props, contents) {
3 if (window.testRunner)
4 testRunner.dumpAsText();
5
6 var element = document.createElement(type);
7
8 debug('Created element of type: ' + type);
9 for (var i in props) {
10 if (props.hasOwnProperty(i)) {
11 debug('Set attribute: ' + i + ', value: ' + props[i]);
12 element.setAttribute(i,props[i]);
13 }
14 }
15 if (contents) {
16 element.innerHTML = contents;
17 }
18 return element;
19 }
20
21
22 // runs a test and writes a log
23 function runTest(collection, elements, title) {
24 if (window.testRunner)
25 testRunner.dumpAsText();
26
27 pass = true;
28
29 if (collection.length != elements.length) {
30 pass = false
31 debug('FAIL - expected ' + elements.length + ' elements but got ' + collecti on.length + " elements. ");
32 }
33 for(var i = 0, max = collection.length > elements.length ? elements.length : c ollection.length; i < max; i++) {
34 if(collection[i] != elements[i]) {
35 debug(title);
36 pass = false
37 debug('FAIL - expected element : ' + elements[i].tagName + " but got eleme nt :" + collection[i].tagName);
38 debug('FAIL - expected element with id: ' + elements[i].id + " but got ele ment with id:" + collection[i].id);
39 }
40 }
41 if (pass)
42 debug(title + ': PASS');
43 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698