* Currently we run .html and .xhtml tests.
*
* @param testName
- * @return
- * if the file is a test
+ * @return if the file is a test
*/
public static boolean isTestFile(String testName) {
return testName.endsWith(".html") || testName.endsWith(".xhtml");
* Return a URL of the test on the server.
*
* @param relativePath
+ * @param allowHttps Whether to allow the use of HTTPS, even if the file is in the SSL
+ * directory.
* @return a URL of the test on the server
*/
- public static URL getUrl(String relativePath) {
+ public static URL getUrl(String relativePath, boolean allowHttps) {
String urlBase = ForwarderManager.getHostSchemePort(false);
/**
*/
if (relativePath.startsWith(HTTP_TESTS_PATH)) {
relativePath = relativePath.substring(HTTP_TESTS_PATH.length());
- if (relativePath.startsWith(SSL_PATH)) {
+ if (relativePath.startsWith(SSL_PATH) && allowHttps) {
urlBase = ForwarderManager.getHostSchemePort(true);
}
} else {
Log.i(LOG_TAG, "runNextTest(): Start: " + mCurrentTestRelativePath +
" (" + mCurrentTestIndex + ")");
- mCurrentTestUri = FileFilter.getUrl(mCurrentTestRelativePath).toString();
+ mCurrentTestUri = FileFilter.getUrl(mCurrentTestRelativePath, true).toString();
reset();
int size = EXPECTED_RESULT_LOCATION_RELATIVE_DIR_PREFIXES.size();
for (int i = 0; bytes == null && i < size; i++) {
relativePath = locations.get(i) + originalRelativePath;
- bytes = FsUtils.readDataFromUrl(FileFilter.getUrl(relativePath));
+ bytes = FsUtils.readDataFromUrl(FileFilter.getUrl(relativePath, false));
}
mLastExpectedResultPathFetched = bytes == null ? null : relativePath;