[EFL][WK2] Fix ewk_view_navigation test in EWK2ViewTest
authorgyuyoung.kim@samsung.com <gyuyoung.kim@samsung.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 13 May 2014 06:14:17 +0000 (06:14 +0000)
committergyuyoung.kim@samsung.com <gyuyoung.kim@samsung.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 13 May 2014 06:14:17 +0000 (06:14 +0000)
https://bugs.webkit.org/show_bug.cgi?id=132817

Reviewed by Dirk Schulze.

To load test html pages, call ewk_view_uri_set() instead of EWK2UnitTestServer.
Besides this patch adds test html page for ewk_view_navigation unit test.

* UIProcess/API/efl/tests/resources/Page1.html: Added.
* UIProcess/API/efl/tests/resources/Page2.html: Added.
* UIProcess/API/efl/tests/resources/Page3.html: Added.
* UIProcess/API/efl/tests/test_ewk2_view.cpp:
(TEST_F):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@168675 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/API/efl/tests/resources/Page1.html [new file with mode: 0644]
Source/WebKit2/UIProcess/API/efl/tests/resources/Page2.html [new file with mode: 0644]
Source/WebKit2/UIProcess/API/efl/tests/resources/Page3.html [new file with mode: 0644]
Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_view.cpp

index cec093a..c6d99e7 100644 (file)
@@ -1,5 +1,21 @@
 2014-05-12  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
 
+        [EFL][WK2] Fix ewk_view_navigation test in EWK2ViewTest 
+        https://bugs.webkit.org/show_bug.cgi?id=132817
+
+        Reviewed by Dirk Schulze.
+
+        To load test html pages, call ewk_view_uri_set() instead of EWK2UnitTestServer.
+        Besides this patch adds test html page for ewk_view_navigation unit test.
+
+        * UIProcess/API/efl/tests/resources/Page1.html: Added.
+        * UIProcess/API/efl/tests/resources/Page2.html: Added.
+        * UIProcess/API/efl/tests/resources/Page3.html: Added.
+        * UIProcess/API/efl/tests/test_ewk2_view.cpp:
+        (TEST_F):
+
+2014-05-12  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
+
         Unreviewed, EFL build fix since r168625.
 
         * UIProcess/efl/WebContextEfl.cpp:
diff --git a/Source/WebKit2/UIProcess/API/efl/tests/resources/Page1.html b/Source/WebKit2/UIProcess/API/efl/tests/resources/Page1.html
new file mode 100644 (file)
index 0000000..2e5050f
--- /dev/null
@@ -0,0 +1 @@
+<html><head><title>Page1</title></head></html>
diff --git a/Source/WebKit2/UIProcess/API/efl/tests/resources/Page2.html b/Source/WebKit2/UIProcess/API/efl/tests/resources/Page2.html
new file mode 100644 (file)
index 0000000..b11f94b
--- /dev/null
@@ -0,0 +1 @@
+<html><head><title>Page2</title></head></html>
diff --git a/Source/WebKit2/UIProcess/API/efl/tests/resources/Page3.html b/Source/WebKit2/UIProcess/API/efl/tests/resources/Page3.html
new file mode 100644 (file)
index 0000000..353978f
--- /dev/null
@@ -0,0 +1 @@
+<html><head><title>Page3</title></head></html>
index 30634d4..c50371f 100644 (file)
@@ -288,17 +288,16 @@ TEST_F(EWK2ViewTest, ewk_view_html_string_load)
 
 TEST_F(EWK2ViewTest, ewk_view_navigation)
 {
-    std::unique_ptr<EWK2UnitTestServer> httpServer = std::make_unique<EWK2UnitTestServer>();
-    httpServer->run(serverCallbackNavigation);
-
     // Visit Page1
-    ASSERT_TRUE(loadUrlSync(httpServer->getURLForPath("/Page1").data()));
+    ewk_view_url_set(webView(), environment->urlForResource("/Page1.html").data());
+    ASSERT_TRUE(waitUntilTitleChangedTo("Page1"));
     ASSERT_STREQ("Page1", ewk_view_title_get(webView()));
     ASSERT_FALSE(ewk_view_back_possible(webView()));
     ASSERT_FALSE(ewk_view_forward_possible(webView()));
 
     // Visit Page2
-    ASSERT_TRUE(loadUrlSync(httpServer->getURLForPath("/Page2").data()));
+    ewk_view_url_set(webView(), environment->urlForResource("/Page2.html").data());
+    ASSERT_TRUE(waitUntilTitleChangedTo("Page2"));
     ASSERT_STREQ("Page2", ewk_view_title_get(webView()));
     ASSERT_TRUE(ewk_view_back_possible(webView()));
     ASSERT_FALSE(ewk_view_forward_possible(webView()));
@@ -318,7 +317,7 @@ TEST_F(EWK2ViewTest, ewk_view_navigation)
     ASSERT_FALSE(ewk_view_forward_possible(webView()));
 
     // Visit Page3
-    ewk_view_url_set(webView(), httpServer->getURLForPath("/Page3").data());
+    ewk_view_url_set(webView(), environment->urlForResource("/Page3.html").data());
     ASSERT_TRUE(waitUntilTitleChangedTo("Page3"));
     ASSERT_STREQ("Page3", ewk_view_title_get(webView()));
     ASSERT_TRUE(ewk_view_back_possible(webView()));