Skip to content
This repository has been archived by the owner on Sep 19, 2018. It is now read-only.

Make HTTPS tests fail if they are loaded over HTTP #255

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tidoust
Copy link
Member

@tidoust tidoust commented Mar 30, 2017

This PR replaces PR #207. Same goal: make the test harness fail HTTPS-only tests when they are loaded over HTTP with a "Test page must be loaded over HTTPS" message.

The new PR addresses the request from @jgraham to relax the check and look for https within the file name without assuming that the extension will be .html, and without assuming https will be the last dot flag before the extension.

Note I stuck to indexOf(".https.") because I think that reads better than .split(".").slice(1).slice(0, -1).indexOf("https"). This should yield the same result.


This change is Reviewable

Test files that contain ".https." trigger a check on the current protocol.
If the current protocol is not "https:", all tests in this test file fail with
a "Test page must be loaded over HTTPS" message.
@jgraham
Copy link
Member

jgraham commented Mar 30, 2017

Note that the new PR still does not address @jgraham's comment that he would like to "just run the check and make it throw so that the harness status comes back error". As said above, I do not know how to do that properly with the current code.

Just throw an exception before any tests run, not inside test.step

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

Successfully merging this pull request may close these issues.

2 participants