static GtkWidget *
_webkit_web_view_new (OAuthAskAuthorizationDialog *self)
{
	WebKitWebContext    *context;
	GtkWidget           *view;
	WebKitSettings      *settings;
	WebKitCookieManager *cookie_manager;
	GFile               *file;
	char                *cookie_filename;

	context = webkit_web_context_get_default ();
	view = webkit_web_view_new_with_context (context);

	settings = webkit_settings_new ();
	webkit_settings_set_enable_javascript (settings, TRUE);
	webkit_settings_set_javascript_can_open_windows_automatically (settings, TRUE);
	webkit_web_view_set_settings (WEBKIT_WEB_VIEW (view), settings);

	file = gth_user_dir_get_file_for_write (GTH_DIR_CACHE, GTHUMB_DIR, "cookies", NULL);
	cookie_filename = g_file_get_path (file);

	cookie_manager = webkit_web_context_get_cookie_manager (context);
	webkit_cookie_manager_set_accept_policy (cookie_manager, WEBKIT_COOKIE_POLICY_ACCEPT_ALWAYS);
	webkit_cookie_manager_set_persistent_storage (cookie_manager, cookie_filename, WEBKIT_COOKIE_PERSISTENT_STORAGE_TEXT);
	webkit_web_context_set_cache_model (context, WEBKIT_CACHE_MODEL_DOCUMENT_BROWSER);

	g_free (cookie_filename);
	g_object_unref (file);

	g_signal_connect (view,
			  "create",
			  G_CALLBACK (webkit_view_create_cb),
			  self);
	g_signal_connect (view,
			  "ready-to-show",
			  G_CALLBACK (webkit_view_ready_to_show_cb),
			  self);

	return view;
}
static void testWebKitSettings(Test*, gconstpointer)
{
    WebKitSettings* settings = webkit_settings_new();

    // JavaScript is enabled by default.
    g_assert(webkit_settings_get_enable_javascript(settings));
    webkit_settings_set_enable_javascript(settings, FALSE);
    g_assert(!webkit_settings_get_enable_javascript(settings));

    // By default auto-load-image is true.
    g_assert(webkit_settings_get_auto_load_images(settings));
    webkit_settings_set_auto_load_images(settings, FALSE);
    g_assert(!webkit_settings_get_auto_load_images(settings));

    // load-icons-ignoring-image-load-setting is false by default.
    g_assert(!webkit_settings_get_load_icons_ignoring_image_load_setting(settings));
    webkit_settings_set_load_icons_ignoring_image_load_setting(settings, TRUE);
    g_assert(webkit_settings_get_load_icons_ignoring_image_load_setting(settings));
    
    // Offline application cache is true by default.
    g_assert(webkit_settings_get_enable_offline_web_application_cache(settings));
    webkit_settings_set_enable_offline_web_application_cache(settings, FALSE);
    g_assert(!webkit_settings_get_enable_offline_web_application_cache(settings));

    // Local storage is enable by default.
    g_assert(webkit_settings_get_enable_html5_local_storage(settings));
    webkit_settings_set_enable_html5_local_storage(settings, FALSE);
    g_assert(!webkit_settings_get_enable_html5_local_storage(settings));

    // HTML5 database is enabled by default.
    g_assert(webkit_settings_get_enable_html5_database(settings));
    webkit_settings_set_enable_html5_database(settings, FALSE);
    g_assert(!webkit_settings_get_enable_html5_database(settings));

    // XSS Auditor is enabled by default.
    g_assert(webkit_settings_get_enable_xss_auditor(settings));
    webkit_settings_set_enable_xss_auditor(settings, FALSE);
    g_assert(!webkit_settings_get_enable_xss_auditor(settings));

    // Frame flattening is disabled by default.
    g_assert(!webkit_settings_get_enable_frame_flattening(settings));
    webkit_settings_set_enable_frame_flattening(settings, TRUE);
    g_assert(webkit_settings_get_enable_frame_flattening(settings));

    // Plugins are enabled by default.
    g_assert(webkit_settings_get_enable_plugins(settings));
    webkit_settings_set_enable_plugins(settings, FALSE);
    g_assert(!webkit_settings_get_enable_plugins(settings));

    // Java is enabled by default.
    g_assert(webkit_settings_get_enable_java(settings));
    webkit_settings_set_enable_java(settings, FALSE);
    g_assert(!webkit_settings_get_enable_java(settings));

    // By default, JavaScript can open windows automatically is disabled.
    g_assert(!webkit_settings_get_javascript_can_open_windows_automatically(settings));
    webkit_settings_set_javascript_can_open_windows_automatically(settings, TRUE);
    g_assert(webkit_settings_get_javascript_can_open_windows_automatically(settings));

    // By default hyper link auditing is disabled.
    g_assert(!webkit_settings_get_enable_hyperlink_auditing(settings));
    webkit_settings_set_enable_hyperlink_auditing(settings, TRUE);
    g_assert(webkit_settings_get_enable_hyperlink_auditing(settings));

    // Default font family is "sans-serif".
    g_assert_cmpstr(webkit_settings_get_default_font_family(settings), ==, "sans-serif");
    webkit_settings_set_default_font_family(settings, "monospace");
    g_assert_cmpstr(webkit_settings_get_default_font_family(settings), ==, "monospace");

    // Default monospace font family font family is "monospace".
    g_assert_cmpstr(webkit_settings_get_monospace_font_family(settings), ==, "monospace");
    webkit_settings_set_monospace_font_family(settings, "sans-serif");
    g_assert_cmpstr(webkit_settings_get_monospace_font_family(settings), ==, "sans-serif");

    // Default serif font family is "serif".
    g_assert_cmpstr(webkit_settings_get_serif_font_family(settings), ==, "serif");
    webkit_settings_set_serif_font_family(settings, "sans-serif");
    g_assert_cmpstr(webkit_settings_get_serif_font_family(settings), ==, "sans-serif");

    // Default sans serif font family is "sans-serif".
    g_assert_cmpstr(webkit_settings_get_sans_serif_font_family(settings), ==, "sans-serif");
    webkit_settings_set_sans_serif_font_family(settings, "serif");
    g_assert_cmpstr(webkit_settings_get_sans_serif_font_family(settings), ==, "serif");

    // Default cursive font family "serif".
    g_assert_cmpstr(webkit_settings_get_cursive_font_family(settings), ==, "serif");
    webkit_settings_set_cursive_font_family(settings, "sans-serif");
    g_assert_cmpstr(webkit_settings_get_cursive_font_family(settings), ==, "sans-serif");

    // Default fantasy font family is "serif".
    g_assert_cmpstr(webkit_settings_get_fantasy_font_family(settings), ==, "serif");
    webkit_settings_set_fantasy_font_family(settings, "sans-serif");
    g_assert_cmpstr(webkit_settings_get_fantasy_font_family(settings), ==, "sans-serif");

    // Default pictograph font family is "serif".
    g_assert_cmpstr(webkit_settings_get_pictograph_font_family(settings), ==, "serif");
    webkit_settings_set_pictograph_font_family(settings, "sans-serif");
    g_assert_cmpstr(webkit_settings_get_pictograph_font_family(settings), ==, "sans-serif");

    // Default font size is 16.
    g_assert_cmpuint(webkit_settings_get_default_font_size(settings), ==, 16);
    webkit_settings_set_default_font_size(settings, 14);
    g_assert_cmpuint(webkit_settings_get_default_font_size(settings), ==, 14);

    // Default monospace font size is 13.
    g_assert_cmpuint(webkit_settings_get_default_monospace_font_size(settings), ==, 13);
    webkit_settings_set_default_monospace_font_size(settings, 10);
    g_assert_cmpuint(webkit_settings_get_default_monospace_font_size(settings), ==, 10);

    // Default minimum font size is 0.
    g_assert_cmpuint(webkit_settings_get_minimum_font_size(settings), ==, 0);
    webkit_settings_set_minimum_font_size(settings, 7);
    g_assert_cmpuint(webkit_settings_get_minimum_font_size(settings), ==, 7);

    // Default charset is "iso-8859-1".
    g_assert_cmpstr(webkit_settings_get_default_charset(settings), ==, "iso-8859-1");
    webkit_settings_set_default_charset(settings, "utf8");
    g_assert_cmpstr(webkit_settings_get_default_charset(settings), ==, "utf8");

    g_assert(!webkit_settings_get_enable_private_browsing(settings));
    webkit_settings_set_enable_private_browsing(settings, TRUE);
    g_assert(webkit_settings_get_enable_private_browsing(settings));

    g_assert(!webkit_settings_get_enable_developer_extras(settings));
    webkit_settings_set_enable_developer_extras(settings, TRUE);
    g_assert(webkit_settings_get_enable_developer_extras(settings));

    g_assert(webkit_settings_get_enable_resizable_text_areas(settings));
    webkit_settings_set_enable_resizable_text_areas(settings, FALSE);
    g_assert(!webkit_settings_get_enable_resizable_text_areas(settings));

    g_assert(webkit_settings_get_enable_tabs_to_links(settings));
    webkit_settings_set_enable_tabs_to_links(settings, FALSE);
    g_assert(!webkit_settings_get_enable_tabs_to_links(settings));

    g_assert(!webkit_settings_get_enable_dns_prefetching(settings));
    webkit_settings_set_enable_dns_prefetching(settings, TRUE);
    g_assert(webkit_settings_get_enable_dns_prefetching(settings));

    // Caret browsing is disabled by default.
    g_assert(!webkit_settings_get_enable_caret_browsing(settings));
    webkit_settings_set_enable_caret_browsing(settings, TRUE);
    g_assert(webkit_settings_get_enable_caret_browsing(settings));

    // Fullscreen JavaScript API is enabled by default.
    g_assert(webkit_settings_get_enable_fullscreen(settings));
    webkit_settings_set_enable_fullscreen(settings, FALSE);
    g_assert(!webkit_settings_get_enable_fullscreen(settings));

    // Print backgrounds is enabled by default
    g_assert(webkit_settings_get_print_backgrounds(settings));
    webkit_settings_set_print_backgrounds(settings, FALSE);
    g_assert(!webkit_settings_get_print_backgrounds(settings));

    // WebAudio is disabled by default.
    g_assert(!webkit_settings_get_enable_webaudio(settings));
    webkit_settings_set_enable_webaudio(settings, TRUE);
    g_assert(webkit_settings_get_enable_webaudio(settings));

    // WebGL is disabled by default.
    g_assert(!webkit_settings_get_enable_webgl(settings));
    webkit_settings_set_enable_webgl(settings, TRUE);
    g_assert(webkit_settings_get_enable_webgl(settings));

    // Allow Modal Dialogs is disabled by default.
    g_assert(!webkit_settings_get_allow_modal_dialogs(settings));
    webkit_settings_set_allow_modal_dialogs(settings, TRUE);
    g_assert(webkit_settings_get_allow_modal_dialogs(settings));

    // Zoom text only is disabled by default.
    g_assert(!webkit_settings_get_zoom_text_only(settings));
    webkit_settings_set_zoom_text_only(settings, TRUE);
    g_assert(webkit_settings_get_zoom_text_only(settings));

    // By default, JavaScript cannot access the clipboard.
    g_assert(!webkit_settings_get_javascript_can_access_clipboard(settings));
    webkit_settings_set_javascript_can_access_clipboard(settings, TRUE);
    g_assert(webkit_settings_get_javascript_can_access_clipboard(settings));

    // By default, media playback doesn't require user gestures.
    g_assert(!webkit_settings_get_media_playback_requires_user_gesture(settings));
    webkit_settings_set_media_playback_requires_user_gesture(settings, TRUE);
    g_assert(webkit_settings_get_media_playback_requires_user_gesture(settings));

    // By default, inline media playback is allowed
    g_assert(webkit_settings_get_media_playback_allows_inline(settings));
    webkit_settings_set_media_playback_allows_inline(settings, FALSE);
    g_assert(!webkit_settings_get_media_playback_allows_inline(settings));

    // By default, debug indicators are disabled.
    g_assert(!webkit_settings_get_draw_compositing_indicators(settings));
    webkit_settings_set_draw_compositing_indicators(settings, TRUE);
    g_assert(webkit_settings_get_draw_compositing_indicators(settings));

    // By default, site specific quirks are enabled.
    g_assert(webkit_settings_get_enable_site_specific_quirks(settings));
    webkit_settings_set_enable_site_specific_quirks(settings, FALSE);
    g_assert(!webkit_settings_get_enable_site_specific_quirks(settings));

    // By default, page cache is enabled.
    g_assert(webkit_settings_get_enable_page_cache(settings));
    webkit_settings_set_enable_page_cache(settings, FALSE);
    g_assert(!webkit_settings_get_enable_page_cache(settings));

    // By default, smooth scrolling is disabled.
    g_assert(!webkit_settings_get_enable_smooth_scrolling(settings));
    webkit_settings_set_enable_smooth_scrolling(settings, TRUE);
    g_assert(webkit_settings_get_enable_smooth_scrolling(settings));

    // By default, accelerated 2D canvas is disabled.
    g_assert(!webkit_settings_get_enable_accelerated_2d_canvas(settings));
    webkit_settings_set_enable_accelerated_2d_canvas(settings, TRUE);
    g_assert(webkit_settings_get_enable_accelerated_2d_canvas(settings));

    // By default, writing of console messages to stdout is disabled.
    g_assert(!webkit_settings_get_enable_write_console_messages_to_stdout(settings));
    webkit_settings_set_enable_write_console_messages_to_stdout(settings, TRUE);
    g_assert(webkit_settings_get_enable_write_console_messages_to_stdout(settings));

    // MediaStream is disabled by default.
    g_assert(!webkit_settings_get_enable_media_stream(settings));
    webkit_settings_set_enable_media_stream(settings, TRUE);
    g_assert(webkit_settings_get_enable_media_stream(settings));

    // By default, SpatialNavigation is disabled
    g_assert(!webkit_settings_get_enable_spatial_navigation(settings));
    webkit_settings_set_enable_spatial_navigation(settings, TRUE);
    g_assert(webkit_settings_get_enable_spatial_navigation(settings));

    // MediaSource is disabled by default
    g_assert(!webkit_settings_get_enable_mediasource(settings));
    webkit_settings_set_enable_mediasource(settings, TRUE);
    g_assert(webkit_settings_get_enable_mediasource(settings));

    // File access from file URLs is not allowed by default.
    g_assert(!webkit_settings_get_allow_file_access_from_file_urls(settings));
    webkit_settings_set_allow_file_access_from_file_urls(settings, TRUE);
    g_assert(webkit_settings_get_allow_file_access_from_file_urls(settings));

    // Universal access from file URLs is not allowed by default.
    g_assert(!webkit_settings_get_allow_universal_access_from_file_urls(settings));
    webkit_settings_set_allow_universal_access_from_file_urls(settings, TRUE);
    g_assert(webkit_settings_get_allow_universal_access_from_file_urls(settings));

    g_object_unref(G_OBJECT(settings));
}
Example #3
0
int main(int argn, char **argv)
{
    config = config_init(argn, argv);

	gtk_init(0, NULL);
    //GtkWidget * window = gtk_offscreen_window_new();
    GtkWidget * window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
    gtk_window_set_default_size(GTK_WINDOW(window), 900, 600);
    GdkScreen* screen = gtk_window_get_screen(GTK_WINDOW(window));
    GdkVisual* rgba_visual = gdk_screen_get_rgba_visual(screen);
    WebKitSettings * setting;
    WebKitWebView *webView;
    if (rgba_visual) {
        gtk_widget_set_visual(window, rgba_visual);
    }
    gtk_widget_set_app_paintable(window, TRUE);

	WebKitWebContext* context = webkit_web_context_get_default();
	//webkit_web_context_set_process_model(context, WEBKIT_PROCESS_MODEL_MULTIPLE_SECONDARY_PROCESSES);
	//webkit_web_context_set_process_model(context, WEBKIT_PROCESS_MODEL_SHARED_SECONDARY_PROCESS);
	//webkit_web_context_set_cache_model(context, WEBKIT_CACHE_MODEL_WEB_BROWSER);
    webkit_web_context_set_disk_cache_directory(context, "/tmp/cache");
    webkit_web_context_set_process_model(context, WEBKIT_PROCESS_MODEL_MULTIPLE_SECONDARY_PROCESSES);
	webkit_web_context_set_cache_model(context, WEBKIT_CACHE_MODEL_DOCUMENT_VIEWER);
	webkit_web_context_set_tls_errors_policy(context, WEBKIT_TLS_ERRORS_POLICY_IGNORE);

    webkit_web_context_clear_cache(context);

	webView = WEBKIT_WEB_VIEW(
            webkit_web_view_new_with_user_content_manager(webkit_user_content_manager_new()));
    //webView =WEBKIT_WEB_VIEW(webkit_web_view_new_with_context(context));
    setting = webkit_web_view_get_settings(webView);
    webkit_settings_set_enable_page_cache(setting, false);
    webkit_settings_set_enable_javascript(setting, true);
    webkit_settings_set_enable_offline_web_application_cache(setting, false);
	//webView = WEBKIT_WEB_VIEW(webkit_web_view_new_with_settings(setting));
    g_object_set(setting,
	//	"enable-private-browsing", NanBooleanOptionValue(opts, H("private"), false),
		"enable-plugins", FALSE,
		"print-backgrounds", TRUE,
		"enable-javascript", TRUE,
		"enable-html5-database", FALSE,
		"enable-html5-local-storage", FALSE,
		"enable-java", FALSE,
		"enable-page-cache", FALSE,
		"enable-write-console-messages-to-stdout", TRUE,
		"enable-offline-web-application-cache", FALSE,
	//	"auto-load-images", NanBooleanOptionValue(opts, H("images"), true),
		"zoom-text-only", FALSE,
		"media-playback-requires-user-gesture", FALSE, // effectively disables media playback ?
	//	"user-agent", ua,
        NULL
	);

	gtk_container_add(GTK_CONTAINER(window), GTK_WIDGET(webView));
	g_signal_connect(webView, "ready-to-show", G_CALLBACK(ready_to_show), NULL);
	g_signal_connect(webView, "load-changed", G_CALLBACK(web_view_load_changed), NULL);
	g_signal_connect(webView, "web-view-ready", G_CALLBACK(ready_to_show), NULL);

    g_signal_connect(webView, "resource-load-started", G_CALLBACK(resource_started), window);

    g_signal_connect(window, "destroy", G_CALLBACK(destroyWindowCb), NULL);
    g_signal_connect(webView, "close-web-view", G_CALLBACK(closeWebViewCb), window);

    webkit_web_view_load_uri(webView, config->url);
	//gtk_widget_show_all(window);

    gtk_main();

    return 0;
}
Example #4
0
static void testWebKitSettings(Test*, gconstpointer)
{
    WebKitSettings* settings = webkit_settings_new();

    // JavaScript is enabled by default.
    g_assert(webkit_settings_get_enable_javascript(settings));
    webkit_settings_set_enable_javascript(settings, FALSE);
    g_assert(!webkit_settings_get_enable_javascript(settings));

    // By default auto-load-image is true.
    g_assert(webkit_settings_get_auto_load_images(settings));
    webkit_settings_set_auto_load_images(settings, FALSE);
    g_assert(!webkit_settings_get_auto_load_images(settings));

    // load-icons-ignoring-image-load-setting is false by default.
    g_assert(!webkit_settings_get_load_icons_ignoring_image_load_setting(settings));
    webkit_settings_set_load_icons_ignoring_image_load_setting(settings, TRUE);
    g_assert(webkit_settings_get_load_icons_ignoring_image_load_setting(settings));
    
    // Offline application cache is true by default.
    g_assert(webkit_settings_get_enable_offline_web_application_cache(settings));
    webkit_settings_set_enable_offline_web_application_cache(settings, FALSE);
    g_assert(!webkit_settings_get_enable_offline_web_application_cache(settings));

    // Local storage is enable by default.
    g_assert(webkit_settings_get_enable_html5_local_storage(settings));
    webkit_settings_set_enable_html5_local_storage(settings, FALSE);
    g_assert(!webkit_settings_get_enable_html5_local_storage(settings));

    // HTML5 database is enabled by default.
    g_assert(webkit_settings_get_enable_html5_database(settings));
    webkit_settings_set_enable_html5_database(settings, FALSE);
    g_assert(!webkit_settings_get_enable_html5_database(settings));

    // XSS Auditor is enabled by default.
    g_assert(webkit_settings_get_enable_xss_auditor(settings));
    webkit_settings_set_enable_xss_auditor(settings, FALSE);
    g_assert(!webkit_settings_get_enable_xss_auditor(settings));

    // Frame flattening is disabled by default.
    g_assert(!webkit_settings_get_enable_frame_flattening(settings));
    webkit_settings_set_enable_frame_flattening(settings, TRUE);
    g_assert(webkit_settings_get_enable_frame_flattening(settings));

    // Plugins are enabled by default.
    g_assert(webkit_settings_get_enable_plugins(settings));
    webkit_settings_set_enable_plugins(settings, FALSE);
    g_assert(!webkit_settings_get_enable_plugins(settings));

    // Java is enabled by default.
    g_assert(webkit_settings_get_enable_java(settings));
    webkit_settings_set_enable_java(settings, FALSE);
    g_assert(!webkit_settings_get_enable_java(settings));

    // By default, JavaScript can open windows automatically is disabled.
    g_assert(!webkit_settings_get_javascript_can_open_windows_automatically(settings));
    webkit_settings_set_javascript_can_open_windows_automatically(settings, TRUE);
    g_assert(webkit_settings_get_javascript_can_open_windows_automatically(settings));

    // By default hyper link auditing is disabled.
    g_assert(!webkit_settings_get_enable_hyperlink_auditing(settings));
    webkit_settings_set_enable_hyperlink_auditing(settings, TRUE);
    g_assert(webkit_settings_get_enable_hyperlink_auditing(settings));

    // Default font family is "sans-serif".
    g_assert_cmpstr(webkit_settings_get_default_font_family(settings), ==, "sans-serif");
    webkit_settings_set_default_font_family(settings, "monospace");
    g_assert_cmpstr(webkit_settings_get_default_font_family(settings), ==, "monospace");

    // Default monospace font family font family is "monospace".
    g_assert_cmpstr(webkit_settings_get_monospace_font_family(settings), ==, "monospace");
    webkit_settings_set_monospace_font_family(settings, "sans-serif");
    g_assert_cmpstr(webkit_settings_get_monospace_font_family(settings), ==, "sans-serif");

    // Default serif font family is "serif".
    g_assert_cmpstr(webkit_settings_get_serif_font_family(settings), ==, "serif");
    webkit_settings_set_serif_font_family(settings, "sans-serif");
    g_assert_cmpstr(webkit_settings_get_serif_font_family(settings), ==, "sans-serif");

    // Default sans serif font family is "sans-serif".
    g_assert_cmpstr(webkit_settings_get_sans_serif_font_family(settings), ==, "sans-serif");
    webkit_settings_set_sans_serif_font_family(settings, "serif");
    g_assert_cmpstr(webkit_settings_get_sans_serif_font_family(settings), ==, "serif");

    // Default cursive font family "serif".
    g_assert_cmpstr(webkit_settings_get_cursive_font_family(settings), ==, "serif");
    webkit_settings_set_cursive_font_family(settings, "sans-serif");
    g_assert_cmpstr(webkit_settings_get_cursive_font_family(settings), ==, "sans-serif");

    // Default fantasy font family is "serif".
    g_assert_cmpstr(webkit_settings_get_fantasy_font_family(settings), ==, "serif");
    webkit_settings_set_fantasy_font_family(settings, "sans-serif");
    g_assert_cmpstr(webkit_settings_get_fantasy_font_family(settings), ==, "sans-serif");

    // Default pictograph font family is "serif".
    g_assert_cmpstr(webkit_settings_get_pictograph_font_family(settings), ==, "serif");
    webkit_settings_set_pictograph_font_family(settings, "sans-serif");
    g_assert_cmpstr(webkit_settings_get_pictograph_font_family(settings), ==, "sans-serif");

    // Default font size is 16.
    g_assert_cmpuint(webkit_settings_get_default_font_size(settings), ==, 16);
    webkit_settings_set_default_font_size(settings, 14);
    g_assert_cmpuint(webkit_settings_get_default_font_size(settings), ==, 14);

    // Default monospace font size is 13.
    g_assert_cmpuint(webkit_settings_get_default_monospace_font_size(settings), ==, 13);
    webkit_settings_set_default_monospace_font_size(settings, 10);
    g_assert_cmpuint(webkit_settings_get_default_monospace_font_size(settings), ==, 10);

    // Default minimum font size is 0.
    g_assert_cmpuint(webkit_settings_get_minimum_font_size(settings), ==, 0);
    webkit_settings_set_minimum_font_size(settings, 7);
    g_assert_cmpuint(webkit_settings_get_minimum_font_size(settings), ==, 7);

    // Default charset is "iso-8859-1".
    g_assert_cmpstr(webkit_settings_get_default_charset(settings), ==, "iso-8859-1");
    webkit_settings_set_default_charset(settings, "utf8");
    g_assert_cmpstr(webkit_settings_get_default_charset(settings), ==, "utf8");

    g_assert(!webkit_settings_get_enable_private_browsing(settings));
    webkit_settings_set_enable_private_browsing(settings, TRUE);
    g_assert(webkit_settings_get_enable_private_browsing(settings));

    g_assert(!webkit_settings_get_enable_developer_extras(settings));
    webkit_settings_set_enable_developer_extras(settings, TRUE);
    g_assert(webkit_settings_get_enable_developer_extras(settings));

    g_assert(webkit_settings_get_enable_resizable_text_areas(settings));
    webkit_settings_set_enable_resizable_text_areas(settings, FALSE);
    g_assert(!webkit_settings_get_enable_resizable_text_areas(settings));

    g_assert(webkit_settings_get_enable_tabs_to_links(settings));
    webkit_settings_set_enable_tabs_to_links(settings, FALSE);
    g_assert(!webkit_settings_get_enable_tabs_to_links(settings));

    g_assert(!webkit_settings_get_enable_dns_prefetching(settings));
    webkit_settings_set_enable_dns_prefetching(settings, TRUE);
    g_assert(webkit_settings_get_enable_dns_prefetching(settings));

    // Caret browsing is disabled by default.
    g_assert(!webkit_settings_get_enable_caret_browsing(settings));
    webkit_settings_set_enable_caret_browsing(settings, TRUE);
    g_assert(webkit_settings_get_enable_caret_browsing(settings));

    // Fullscreen JavaScript API is disabled by default.
    g_assert(!webkit_settings_get_enable_fullscreen(settings));
    webkit_settings_set_enable_fullscreen(settings, TRUE);
    g_assert(webkit_settings_get_enable_fullscreen(settings));

    g_object_unref(G_OBJECT(settings));
}