summaryrefslogtreecommitdiff
path: root/test/testutils
diff options
context:
space:
mode:
authorJohn-Mark Bell <jmb@netsurf-browser.org>2012-09-19 00:03:05 +0100
committerJohn-Mark Bell <jmb@netsurf-browser.org>2012-09-19 00:03:05 +0100
commitf6dfa1bd24a39ebf55993837431b10e437cade12 (patch)
tree8c6efd74987cd9c9ab0a0bd8bf8e5735bef8e7a8 /test/testutils
parent12a34ebfb1791c1ca7f09f24a0e56be4530fdfc6 (diff)
downloadlibdom-f6dfa1bd24a39ebf55993837431b10e437cade12.tar.gz
libdom-f6dfa1bd24a39ebf55993837431b10e437cade12.tar.bz2
Enable HTMLSelectElement tests
Diffstat (limited to 'test/testutils')
-rw-r--r--test/testutils/foreach.c26
-rw-r--r--test/testutils/foreach.h4
2 files changed, 30 insertions, 0 deletions
diff --git a/test/testutils/foreach.c b/test/testutils/foreach.c
index 764920c..bbc8a47 100644
--- a/test/testutils/foreach.c
+++ b/test/testutils/foreach.c
@@ -34,6 +34,11 @@ void foreach_initialise_domnamednodemap(dom_namednodemap *map, unsigned int *ite
*iterator = 0;
}
+void foreach_initialise_domhtmlcollection(dom_html_collection *coll, unsigned int *iterator)
+{
+ (void)coll;
+ *iterator = 0;
+}
bool _get_next_domnodelist(dom_nodelist *list, unsigned int *iterator, dom_node **ret)
{
@@ -97,3 +102,24 @@ bool _get_next_domnamednodemap(dom_namednodemap *map, unsigned int *iterator, do
return true;
}
+
+bool _get_next_domhtmlcollection(dom_html_collection *coll, unsigned int *iterator, dom_node **ret)
+{
+ dom_exception err;
+ unsigned long len;
+
+ err = dom_html_collection_get_length(coll, &len);
+ if (err != DOM_NO_ERR)
+ return false;
+
+ if (*iterator >= len)
+ return false;
+
+ err = dom_html_collection_item(coll, (*iterator), ret);
+ if (err != DOM_NO_ERR)
+ return false;
+
+ (*iterator)++;
+
+ return true;
+}
diff --git a/test/testutils/foreach.h b/test/testutils/foreach.h
index 75874bc..aa9543d 100644
--- a/test/testutils/foreach.h
+++ b/test/testutils/foreach.h
@@ -26,6 +26,7 @@
void foreach_initialise_domnodelist(dom_nodelist *list, unsigned int *iterator);
void foreach_initialise_list(list *list, unsigned int *iterator);
void foreach_initialise_domnamednodemap(dom_namednodemap *map, unsigned int *iterator);
+void foreach_initialise_domhtmlcollection(dom_html_collection *coll, unsigned int *iterator);
bool _get_next_domnodelist(dom_nodelist *list, unsigned int *iterator, dom_node **ret);
#define get_next_domnodelist(l, i, r) _get_next_domnodelist( \
@@ -37,5 +38,8 @@ bool _get_next_domnamednodemap(dom_namednodemap *map, unsigned int *iterator, do
#define get_next_domnamednodemap(m, i, r) _get_next_domnamednodemap( \
(dom_namednodemap *) (m), (unsigned int *) (i), (dom_node **) (r))
+bool _get_next_domhtmlcollection(dom_html_collection *coll, unsigned int *iterator, dom_node **ret);
+#define get_next_domhtmlcollection(c, i, r) _get_next_domhtmlcollection( \
+ (dom_html_collection *) (c), (unsigned int *) (i), (dom_node **) (r))
#endif