From 6be4b74c59a8ef39a2dcfbdc49deb2c6abbd98b2 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Wed, 5 Oct 2016 15:36:25 +0200 Subject: [PATCH] tests: Fix redirect-later-continue with timeout --- tests/end2end/data/javascript/consolelog.html | 2 +- tests/end2end/features/hints.feature | 10 +++++++++- tests/end2end/fixtures/webserver_sub.py | 7 +++++-- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/tests/end2end/data/javascript/consolelog.html b/tests/end2end/data/javascript/consolelog.html index d8506862e..b25d58325 100644 --- a/tests/end2end/data/javascript/consolelog.html +++ b/tests/end2end/data/javascript/consolelog.html @@ -1,6 +1,6 @@ - +

This page logs a line via console.log

diff --git a/tests/end2end/features/hints.feature b/tests/end2end/features/hints.feature index d0622b9c0..aad42996a 100644 --- a/tests/end2end/features/hints.feature +++ b/tests/end2end/features/hints.feature @@ -70,7 +70,15 @@ Feature: Using hints Then the message "Command exited successfully." should be shown @posix - Scenario: Using :hint spawn with flags passed to the command (issue 797) + Scenario: Using :hint spawn with flags class Test + + log: (args...) -> + console.log "[Foo]", args... + + +test = new Test() +test.log("Hello World") +passed to the command (issue 797) When I open data/hints/html/simple.html And I hint with args "--rapid all spawn -v echo -e foo" and follow a Then the message "Command exited successfully." should be shown diff --git a/tests/end2end/fixtures/webserver_sub.py b/tests/end2end/fixtures/webserver_sub.py index 791faf9c3..0fa1d7139 100644 --- a/tests/end2end/fixtures/webserver_sub.py +++ b/tests/end2end/fixtures/webserver_sub.py @@ -80,8 +80,11 @@ def redirect_later(): @app.route('/custom/redirect-later-continue') def redirect_later_continue(): """Continue a redirect-later request.""" - _redirect_later_event.set() - return flask.Response(b'Continued redirect.') + if _redirect_later_event is None: + return flask.Response(b'Timed out or no redirect pending.') + else: + _redirect_later_event.set() + return flask.Response(b'Continued redirect.') @app.route('/custom/content-size')