Make HTTPRequestHandler in autopilot tests modular

Bug #1447557 reported by Ugo Riboni
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
webbrowser-app
Invalid
Medium
Unassigned
webbrowser-app (Ubuntu)
Confirmed
Medium
Unassigned

Bug Description

Currently the class http_server.HTTPRequestHandler in the autopilot tests has pieces of test code from all over the place.

It should instead allow to register arbitrary functions that will be called when the request path matches a certain criteria.

For example the setup for our current geolocation test would look something like this:

def geolocation_path_handler(server):
            server.send_response(200)
            html = '<html><body><script>navigator.geolocation.getCurrentPosition(function r(p) {});</script></body></html>'
            server.send_html(html)

self.server.register_path_handler("/geolocation", geolocation_path_handler)

Tags: autopilot
Olivier Tilloy (osomon)
Changed in webbrowser-app:
status: New → Confirmed
importance: Undecided → Medium
tags: added: autopilot
Olivier Tilloy (osomon)
Changed in webbrowser-app (Ubuntu):
status: New → Confirmed
importance: Undecided → Medium
Changed in webbrowser-app:
status: Confirmed → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.