Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ca501d20 authored by Steve Block's avatar Steve Block
Browse files

Fix DumpRenderTree2 to not attempt to read expected results over HTTPS

This is required now that we have HTTPS tests in the triaged set of
tests.

Change-Id: I650518a4536ed903f637a44c0901b1e38bdc1a84
parent cda94482
Loading
Loading
Loading
Loading
+5 −4
Original line number Original line Diff line number Diff line
@@ -243,8 +243,7 @@ public class FileFilter {
     * Currently we run .html and .xhtml tests.
     * Currently we run .html and .xhtml tests.
     *
     *
     * @param testName
     * @param testName
     * @return
     * @return if the file is a test
     *      if the file is a test
     */
     */
    public static boolean isTestFile(String testName) {
    public static boolean isTestFile(String testName) {
        return testName.endsWith(".html") || testName.endsWith(".xhtml");
        return testName.endsWith(".html") || testName.endsWith(".xhtml");
@@ -254,9 +253,11 @@ public class FileFilter {
     * Return a URL of the test on the server.
     * Return a URL of the test on the server.
     *
     *
     * @param relativePath
     * @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
     * @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);
        String urlBase = ForwarderManager.getHostSchemePort(false);


        /**
        /**
@@ -265,7 +266,7 @@ public class FileFilter {
         */
         */
        if (relativePath.startsWith(HTTP_TESTS_PATH)) {
        if (relativePath.startsWith(HTTP_TESTS_PATH)) {
            relativePath = relativePath.substring(HTTP_TESTS_PATH.length());
            relativePath = relativePath.substring(HTTP_TESTS_PATH.length());
            if (relativePath.startsWith(SSL_PATH)) {
            if (relativePath.startsWith(SSL_PATH) && allowHttps) {
                urlBase = ForwarderManager.getHostSchemePort(true);
                urlBase = ForwarderManager.getHostSchemePort(true);
            }
            }
        } else {
        } else {
+1 −1
Original line number Original line Diff line number Diff line
@@ -439,7 +439,7 @@ public class LayoutTestsExecutor extends Activity {
        Log.i(LOG_TAG, "runNextTest(): Start: " + mCurrentTestRelativePath +
        Log.i(LOG_TAG, "runNextTest(): Start: " + mCurrentTestRelativePath +
                " (" + mCurrentTestIndex + ")");
                " (" + mCurrentTestIndex + ")");


        mCurrentTestUri = FileFilter.getUrl(mCurrentTestRelativePath).toString();
        mCurrentTestUri = FileFilter.getUrl(mCurrentTestRelativePath, true).toString();


        reset();
        reset();


+1 −1
Original line number Original line Diff line number Diff line
@@ -262,7 +262,7 @@ public class ManagerService extends Service {
        int size = EXPECTED_RESULT_LOCATION_RELATIVE_DIR_PREFIXES.size();
        int size = EXPECTED_RESULT_LOCATION_RELATIVE_DIR_PREFIXES.size();
        for (int i = 0; bytes == null && i < size; i++) {
        for (int i = 0; bytes == null && i < size; i++) {
            relativePath = locations.get(i) + originalRelativePath;
            relativePath = locations.get(i) + originalRelativePath;
            bytes = FsUtils.readDataFromUrl(FileFilter.getUrl(relativePath));
            bytes = FsUtils.readDataFromUrl(FileFilter.getUrl(relativePath, false));
        }
        }


        mLastExpectedResultPathFetched = bytes == null ? null : relativePath;
        mLastExpectedResultPathFetched = bytes == null ? null : relativePath;