You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by ma...@apache.org on 2013/08/27 17:39:23 UTC

[2/2] spec commit: [CB-4568] Disable pop-up messages when running test "XHR to within-package 11kb asset."

[CB-4568] Disable pop-up messages when running test "XHR to within-package 11kb asset."

When fetching a file from the local file system, the result status of
XMLHttpRequest should be compared to 0 for success instead of 200.
This is because the file and ftp schemes do not use HTTP result codes.

FYI:https://developer.mozilla.org/es/docs/XMLHttpRequest/Usar_XMLHttpReq
uest


Project: http://git-wip-us.apache.org/repos/asf/cordova-mobile-spec/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-mobile-spec/commit/e0a72bdc
Tree: http://git-wip-us.apache.org/repos/asf/cordova-mobile-spec/tree/e0a72bdc
Diff: http://git-wip-us.apache.org/repos/asf/cordova-mobile-spec/diff/e0a72bdc

Branch: refs/heads/3.0.x
Commit: e0a72bdc2c0167af85053e3b9d92376b78f0fe8e
Parents: e12609d
Author: lmnbeyond <lm...@gmail.com>
Authored: Wed Aug 14 19:54:21 2013 +0800
Committer: Max Woghiren <ma...@gmail.com>
Committed: Tue Aug 27 11:39:02 2013 -0400

----------------------------------------------------------------------
 benchmarks/autobench.html | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-mobile-spec/blob/e0a72bdc/benchmarks/autobench.html
----------------------------------------------------------------------
diff --git a/benchmarks/autobench.html b/benchmarks/autobench.html
index 9104f05..445a46d 100644
--- a/benchmarks/autobench.html
+++ b/benchmarks/autobench.html
@@ -127,7 +127,8 @@ function bench() {
         xhr.open("GET", "../LICENSE", true);
         xhr.onreadystatechange = function() {
             if (xhr.readyState == 4) {
-                if (xhr.status == 200) {
+                // The result status is being compared to 0 for success instead of 200. This is because the file and ftp schemes do not use HTTP result codes.
+                if (xhr.status == 0 && xhr.responseText.length > 0) {
                     next();
                 } else {
                     alert('There was a problem during XHR file read!');