static void testWebViewCustomCharset(WebViewTest* test, gconstpointer) { g_assert(!webkit_web_view_get_custom_charset(test->m_webView)); webkit_web_view_set_custom_charset(test->m_webView, "utf8"); g_assert_cmpstr(webkit_web_view_get_custom_charset(test->m_webView), ==, "utf8"); // Go back to the default charset. webkit_web_view_set_custom_charset(test->m_webView, 0); g_assert(!webkit_web_view_get_custom_charset(test->m_webView)); }
static void testWebViewCustomCharset(WebViewTest* test, gconstpointer) { test->loadURI(gServer->getURIForPath("/").data()); test->waitUntilLoadFinished(); g_assert(!webkit_web_view_get_custom_charset(test->m_webView)); webkit_web_view_set_custom_charset(test->m_webView, "utf8"); // Changing the charset reloads the page, so wait until reloaded. test->waitUntilLoadFinished(); g_assert_cmpstr(webkit_web_view_get_custom_charset(test->m_webView), ==, "utf8"); // Go back to the default charset and wait until reloaded. webkit_web_view_set_custom_charset(test->m_webView, nullptr); test->waitUntilLoadFinished(); g_assert(!webkit_web_view_get_custom_charset(test->m_webView)); }