Fix for rest of utc_blink_ewk_error* tests
authorLukasz Krok <l.krok@samsung.com>
Thu, 29 Jan 2015 12:23:57 +0000 (13:23 +0100)
committerYoungsoo Choi <kenshin.choi@samsung.com>
Tue, 10 Jul 2018 06:57:09 +0000 (06:57 +0000)
The utc_blink_ewk_error* tests previous implementation
intention was to cause load error by cancelling resource loading.
As cancelling loading is normal situation, it shouldn't be treated
as error. It was corrected in I8f4e828bfcc63377678e475f44131dbc749b9c7f
change. Because of the change utc_blink_ewk_error_code_get* tests
stopped to pass.
This commit removes resource loading cancellation from tests logic.
Instead of google.com, "page_that_does_not_exist" is now set as url.
Such url usage causes SERVICE_TEMPORARILY_UNAVAILABLE error code.
If device has no network connection, NETWORK_ERROR code is produced.

One test suite - utc_blink_ewk_error_code_get* was already adapted
with a change: I1503f966bd782815760ca6a7fbf129d1e1400102
This patch adapts rest of the tests which have this problem.

Bug: http://web.sec.samsung.net/bugzilla/show_bug.cgi?id=10191
Reviewed by: Antonio Gomes, Jaesik Chang, Janusz Majnert, Kamil Klimek

Change-Id: Idda9f18ecd9fbb0ba0b351c6abd65abc7782dad9
Signed-off-by: Lukasz Krok <l.krok@samsung.com>
tizen_src/ewk/unittest/utc_blink_ewk_error_description_get_func.cpp
tizen_src/ewk/unittest/utc_blink_ewk_error_type_get_func.cpp
tizen_src/ewk/unittest/utc_blink_ewk_error_url_get_func.cpp

index cabfa41..94eea08 100755 (executable)
@@ -11,7 +11,7 @@ protected:
   {
     utc_message("[load_error] :: ");
 
-    if(ewk_error_description_get(error)) {
+    if (ewk_error_description_get(error)) {
       EventLoopStop(utc_blink_ewk_base::Success);
       return true; // handled load error, supress default behaviour
     }
@@ -19,23 +19,19 @@ protected:
     return false; // fallback default behaviour
   }
 
-  /* Callback for load progress */
-  void LoadProgress(Evas_Object *webview, double progress)
-  {
-    ewk_view_stop(webview);
-  }
-
 protected:
   static const char* const test_url;
 };
 
-const char* const utc_blink_ewk_error_description_get::test_url = "http://google.com";
+const char* const utc_blink_ewk_error_description_get::test_url = "http://page_that_does_not_exist";
+
 /**
  * @brief Positive test case of ewk_error_description_get(). Page is loaded and stopped in between to generate loadError
  */
 TEST_F(utc_blink_ewk_error_description_get, POS_TEST)
 {
   Eina_Bool result = ewk_view_url_set(GetEwkWebView(), test_url);
+
   if (!result) {
     utc_fail();
   }
index 51fd697..275a072 100755 (executable)
@@ -20,18 +20,12 @@ class utc_blink_ewk_error_type_get : public utc_blink_ewk_base {
     return true;
   }
 
-  /* Callback for load progress */
-  void LoadProgress(Evas_Object* webview, double progress)
-  {
-    ewk_view_stop(webview);
-  }
-
 protected:
   Ewk_Error_Type error_type;
   static const char* const test_url;
 };
 
-const char* const utc_blink_ewk_error_type_get::test_url = "http://google.com";
+const char* const utc_blink_ewk_error_type_get::test_url = "http://page_that_does_not_exist";
 
 /**
  * @brief Positive test case of ewk_error_type_get(). Page is loaded and stopped in between to generate loadError
index bf6e8d3..924ee5b 100755 (executable)
@@ -10,7 +10,8 @@ class utc_blink_ewk_error_url_get : public utc_blink_ewk_base {
   bool LoadError(Evas_Object* webview, Ewk_Error* error)
   {
     utc_message("[load_error] :: ");
-    if(ewk_error_url_get(error)) {
+
+    if (ewk_error_url_get(error)) {
       EventLoopStop(utc_blink_ewk_base::Success);
       return true;
     }
@@ -18,17 +19,11 @@ class utc_blink_ewk_error_url_get : public utc_blink_ewk_base {
     return false;
   }
 
-  /* Callback for load progress */
-  void LoadProgress(Evas_Object* webview, double progress)
-  {
-    ewk_view_stop(webview);
-  }
-
 protected:
   static const char* const test_url;
 };
 
-const char* const utc_blink_ewk_error_url_get::test_url = "http://google.com";
+const char* const utc_blink_ewk_error_url_get::test_url = "http://page_that_does_not_exist";
 
 /**
  * @brief Positive test case of ewk_error_url_get(). Page is loaded and stopped in between to generate loadError