aboutsummaryrefslogtreecommitdiffstats
path: root/plugin/icedteanp/IcedTeaPluginUtils.cc
diff options
context:
space:
mode:
Diffstat (limited to 'plugin/icedteanp/IcedTeaPluginUtils.cc')
-rw-r--r--plugin/icedteanp/IcedTeaPluginUtils.cc20
1 files changed, 20 insertions, 0 deletions
diff --git a/plugin/icedteanp/IcedTeaPluginUtils.cc b/plugin/icedteanp/IcedTeaPluginUtils.cc
index 6ed17bb..8e690bd 100644
--- a/plugin/icedteanp/IcedTeaPluginUtils.cc
+++ b/plugin/icedteanp/IcedTeaPluginUtils.cc
@@ -498,6 +498,14 @@ IcedTeaPluginUtilities::removeInstanceID(void* member_ptr)
instance_map->erase(member_ptr);
}
+/* Clear instance_map. Useful for tests. */
+void
+IcedTeaPluginUtilities::clearInstanceIDs()
+{
+ delete instance_map;
+ instance_map = new std::map<void*, NPP>();
+}
+
/**
* Removes all mappings to a given instance, and all associated objects
*/
@@ -603,6 +611,18 @@ IcedTeaPluginUtilities::removeObjectMapping(std::string key)
object_map->erase(key);
}
+/* Clear object_map. Useful for tests. */
+void
+IcedTeaPluginUtilities::clearObjectMapping()
+{
+ std::map<std::string, NPObject*>::iterator iter = object_map->begin();
+ for (; iter != object_map->end(); ++iter) {
+ browser_functions.releaseobject(iter->second);
+ }
+ delete object_map;
+ object_map = new std::map<std::string, NPObject*>();
+}
+
/*
* Similar to printStringVector, but takes a vector of string pointers instead
*