Public bug reported:

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)

** Affects: webbrowser-app
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
WebApps bug tracking, which is subscribed to webbrowser-app.
https://bugs.launchpad.net/bugs/1447557

Title:
  Make HTTPRequestHandler in autopilot tests modular

Status in Web Browser App:
  New

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)

To manage notifications about this bug go to:
https://bugs.launchpad.net/webbrowser-app/+bug/1447557/+subscriptions

-- 
Mailing list: https://launchpad.net/~ubuntu-webapps-bugs
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~ubuntu-webapps-bugs
More help   : https://help.launchpad.net/ListHelp

Reply via email to