Changeset 1864


Ignore:
Timestamp:
2011-02-23 13:16:35 (15 months ago)
Author:
mpo
Message:

This makes the tests work on chrome as well.
Note the required flag mentioned on the test-page though.

Location:
trunk/modules/kauri-forms/kauri-forms-framework/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/modules/kauri-forms/kauri-forms-framework/src/main/kauri/static-{build}.key/kauri.forms/basic-validators.js

    r1826 r1864  
    168168                 
    169169                var me = this; 
    170                 var result; 
    171                 var successHandler = function( response) { 
    172                  
    173                     if (response && response.valid == true) 
    174                         result = me.notifySuccess(); 
    175                     else if (response && response.valid == false) 
    176                         result = me.notifyFail(response.message, response.args); 
    177                     else 
    178                         result = me.notifyFail("i18n:Remote validation returned incompatible response!"); 
    179                     return result; 
     170                var successHandler = function( response, txtstatus, xhr) { 
     171                 
     172                    if (response == null && xhr.status == 0) { // for chrome  
     173                        return errorHandler(xhr, txtstatus, "empty response"); 
     174                    } 
     175                     
     176                    if (response && response.valid == true) { 
     177                        return me.notifySuccess(); 
     178                    } 
     179                     
     180                    if (response && response.valid == false) { 
     181                        return me.notifyFail(response.message, response.args); 
     182                    }  
     183                     
     184                    return me.notifyFail("i18n:Remote validation returned incompatible response!"); 
    180185                }; 
    181186                var errorHandler = function() { 
    182                  
    183                     result = me.notifyFail("i18n:Error while connecting to remote validation."); 
    184                     return result; 
     187                    return me.notifyFail("i18n:Error while connecting to remote validation."); 
    185188                }; 
    186189                try { 
     
    199202                } 
    200203             
    201                 return result; // will be undefined in the case of async calls 
     204                return; 
    202205            } 
    203206        } 
  • trunk/modules/kauri-forms/kauri-forms-framework/src/test/kauri.forms/test-basic-validators.js

    r1827 r1864  
    255255     
    256256    var report = "Checking result for validator/type: " + comp['org.kauriproject.registry-name'] +  
    257                 "- value= (" + val + ") - msg= (" + message + ")"; 
     257                "- value= (" + val + ") - msg= (" + message + ") - location (" + comp.location + ")"; 
    258258 
    259259    if (expectMessage)  
  • trunk/modules/kauri-forms/kauri-forms-framework/src/test/kauri.forms/testPage.html

    r1436 r1864  
    7777  <h2 id="banner"></h2> 
    7878  <h2 id="userAgent"></h2> 
     79  <h2>Note: to run these tests in google chrome: close all instances and start-up with --allow-file-access-from-files</h2> 
    7980 
    8081  <!-- Test HTML --> 
Note: See TracChangeset for help on using the changeset viewer.