cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ste...@apache.org
Subject [03/11] cordova-plugin-test-framework git commit: CB-11124 Fixing cordova-ios build failure due to unnecessary post calls to couchdb and adding handlers to xhr call
Date Fri, 09 Sep 2016 23:22:34 GMT
CB-11124 Fixing cordova-ios build failure due to unnecessary post calls to couchdb and adding
handlers to xhr call

 This closes #20


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-test-framework/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-test-framework/commit/56945a7b
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-test-framework/tree/56945a7b
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-test-framework/diff/56945a7b

Branch: refs/heads/1.1.x
Commit: 56945a7bb2eb49fd1c9f242ada9f48628869f91d
Parents: 9d75c5d
Author: Raghav Katyal <rakatyal@microsoft.com>
Authored: Wed Apr 20 17:40:23 2016 -0700
Committer: Omar Mefire <omefire@gmail.com>
Committed: Thu Apr 21 09:54:32 2016 -0700

----------------------------------------------------------------------
 www/assets/jasmine-medic.js | 12 ++++++++++++
 www/main.js                 |  3 ---
 www/medic.js                |  9 ---------
 3 files changed, 12 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-test-framework/blob/56945a7b/www/assets/jasmine-medic.js
----------------------------------------------------------------------
diff --git a/www/assets/jasmine-medic.js b/www/assets/jasmine-medic.js
index 1b00c5b..e2738e3 100644
--- a/www/assets/jasmine-medic.js
+++ b/www/assets/jasmine-medic.js
@@ -114,6 +114,18 @@ jasmineRequire.MedicReporter = function(j$) {
       var doc_id = [options.sha, json.version, json.model].map(encodeURIComponent).join('__');
       var doc_url = serverurl + '/mobilespec_results/' + doc_id;
       xhr.open("PUT", doc_url, true);
+      xhr.onload = function (e) {
+        if (xhr.readyState === 4) {
+          if (xhr.status === 200) {
+            console.log("Posting results to CouchDB succeeded: " + xhr.responseText);
+          } else {
+            console.log("Error posting to CouchDB: " + xhr.statusText);
+          }
+        }
+      };
+      xhr.onerror = function (e) {
+        console.log("Error posting to CouchDB: " + xhr.statusText);
+      };
       xhr.setRequestHeader("Content-Type","application/json");
       xhr.send(JSON.stringify(json));
     };

http://git-wip-us.apache.org/repos/asf/cordova-plugin-test-framework/blob/56945a7b/www/main.js
----------------------------------------------------------------------
diff --git a/www/main.js b/www/main.js
index 954af80..7e17efd 100644
--- a/www/main.js
+++ b/www/main.js
@@ -143,11 +143,8 @@ exports.wrapConsole = function() {
   }
 
   function createCustomLogger(type) {
-    var medic = require('cordova-plugin-test-framework.medic');
     return function() {
       origConsole[type].apply(origConsole, arguments);
-      // TODO: encode log type somehow for medic logs?
-      medic.log.apply(medic, arguments);
       appendToOnscreenLog(type, arguments);
       setLogVisibility(true);
     };

http://git-wip-us.apache.org/repos/asf/cordova-plugin-test-framework/blob/56945a7b/www/medic.js
----------------------------------------------------------------------
diff --git a/www/medic.js b/www/medic.js
index 47f261f..f656bc7 100644
--- a/www/medic.js
+++ b/www/medic.js
@@ -26,15 +26,6 @@ exports.logurl = 'http://127.0.0.1:7800';
 
 exports.enabled = false;
 
-exports.log = function() {
-  if (!exports.enabled)
-    return;
-  var xhr = new XMLHttpRequest();
-  xhr.open("POST", exports.logurl, true);
-  xhr.setRequestHeader("Content-Type", "text/plain");
-  xhr.send(Array.prototype.slice.apply(arguments));
-};
-
 exports.load = function (callback) {
   var cfg = null;
 


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


Mime
View raw message