testapplicationcache.c [plain text]
#include <glib.h>
#include <glib/gprintf.h>
#include <gtk/gtk.h>
#include <webkit/webkit.h>
#if GTK_CHECK_VERSION(2, 14, 0)
static void test_application_cache_maximum_size()
{
unsigned long long maxSize = 8192;
webkit_application_cache_set_maximum_size(maxSize);
WebKitWebView* webView = WEBKIT_WEB_VIEW(webkit_web_view_new());
g_object_ref_sink(webView);
g_object_unref(webView);
g_assert(maxSize == webkit_application_cache_get_maximum_size());
}
int main(int argc, char** argv)
{
g_thread_init(NULL);
gtk_test_init(&argc, &argv, NULL);
g_test_bug_base("https://bugs.webkit.org/");
g_test_add_func("/webkit/application_cache/maximum_size",
test_application_cache_maximum_size);
return g_test_run();
}
#else
int main(int argc, char** argv)
{
g_critical("You will need gtk-2.14.0 to run the unit tests. Doing nothing now.");
return 0;
}
#endif