Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test 0102 (Scripting Tests): xhr-030 False positive due to bad test #76

Closed
pettarin opened this issue Jan 17, 2015 · 1 comment
Closed
Assignees

Comments

@pettarin
Copy link

Current: the possibility of opening remote files via XHR is deemed available with the following code:

 request.onload = function() {
   txt = request.responseText;
   if (txt) {
     document.getElementById(testResultId).innerHTML = 'PASS';
   }

In other words, as soon as txt is truthy, the test PASSes.

This means that if the Reading System returns a spurious string in request.responseText (e.g., Cordova returns ERROR whitelist rejection: $URL if the requested URL is not in the app whitelist) the test PASSes, albeit the Reading System did not actually access the remote file.

Proposed: probing the response code instead, or -- even better -- testing against a precise (known a priori) value for txt, containing the expected text of the remote file.

Rationale: avoid false positives.

@OriIdan
Copy link
Contributor

OriIdan commented Jan 19, 2015

The best way would be a known file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants