Title: [123545] trunk/Source/WebKit2
Revision
123545
Author
[email protected]
Date
2012-07-24 15:54:03 -0700 (Tue, 24 Jul 2012)

Log Message

[EFL][WK2] Add unit tests for custom text encoding setting
https://bugs.webkit.org/show_bug.cgi?id=91983

Patch by Sudarsana Nagineni <[email protected]> on 2012-07-24
Reviewed by Dirk Pranke.

Add unit tests for get and set custom text encoding methods. Also, fix
a style nit for r123177.

* UIProcess/API/efl/ewk_view.cpp:
(ewk_view_setting_encoding_custom_set): Fix a style nit - add newline
before return.
* UIProcess/API/efl/tests/test_ewk2_view.cpp:
(TEST_F):

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (123544 => 123545)


--- trunk/Source/WebKit2/ChangeLog	2012-07-24 22:51:05 UTC (rev 123544)
+++ trunk/Source/WebKit2/ChangeLog	2012-07-24 22:54:03 UTC (rev 123545)
@@ -1,3 +1,19 @@
+2012-07-24  Sudarsana Nagineni  <[email protected]>
+
+        [EFL][WK2] Add unit tests for custom text encoding setting
+        https://bugs.webkit.org/show_bug.cgi?id=91983
+
+        Reviewed by Dirk Pranke.
+
+        Add unit tests for get and set custom text encoding methods. Also, fix
+        a style nit for r123177.
+
+        * UIProcess/API/efl/ewk_view.cpp:
+        (ewk_view_setting_encoding_custom_set): Fix a style nit - add newline
+        before return.
+        * UIProcess/API/efl/tests/test_ewk2_view.cpp:
+        (TEST_F):
+
 2012-07-24  Ryosuke Niwa  <[email protected]>
 
         WinCairo build fix attempt.

Modified: trunk/Source/WebKit2/UIProcess/API/efl/ewk_view.cpp (123544 => 123545)


--- trunk/Source/WebKit2/UIProcess/API/efl/ewk_view.cpp	2012-07-24 22:51:05 UTC (rev 123544)
+++ trunk/Source/WebKit2/UIProcess/API/efl/ewk_view.cpp	2012-07-24 22:54:03 UTC (rev 123545)
@@ -986,5 +986,6 @@
     WKRetainPtr<WKStringRef> wkEncodingName = encoding ? adoptWK(WKStringCreateWithUTF8CString(encoding)) : 0;
     if (eina_stringshare_replace(&priv->customEncoding, encoding))
         WKPageSetCustomTextEncodingName(toAPI(priv->pageClient->page()), wkEncodingName.get());
+
     return true;
 }

Modified: trunk/Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_view.cpp (123544 => 123545)


--- trunk/Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_view.cpp	2012-07-24 22:51:05 UTC (rev 123544)
+++ trunk/Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_view.cpp	2012-07-24 22:54:03 UTC (rev 123545)
@@ -33,3 +33,13 @@
     loadUrlSync(environment->defaultTestPageUrl());
     EXPECT_STREQ(ewk_view_uri_get(webView()), environment->defaultTestPageUrl());
 }
+
+TEST_F(EWK2UnitTestBase, ewk_view_setting_encoding_custom)
+{
+    ASSERT_FALSE(ewk_view_setting_encoding_custom_get(webView()));
+    ASSERT_TRUE(ewk_view_setting_encoding_custom_set(webView(), "UTF-8"));
+    ASSERT_STREQ(ewk_view_setting_encoding_custom_get(webView()), "UTF-8");
+    // Set the default charset.
+    ASSERT_TRUE(ewk_view_setting_encoding_custom_set(webView(), 0));
+    ASSERT_FALSE(ewk_view_setting_encoding_custom_get(webView()));
+}
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to