GitLab is used only for code review, issue tracking and project management. Canonical locations for source code are still https://gitweb.torproject.org/ https://git.torproject.org/ and git-rw.torproject.org.

Commit d582cb8e authored by Alex Catarineu's avatar Alex Catarineu

Fix onion alias test for same reason as previous commit

parent 120a97eb
...@@ -7,6 +7,10 @@ import time ...@@ -7,6 +7,10 @@ import time
class Test(WindowManagerMixin, MarionetteTestCase): class Test(WindowManagerMixin, MarionetteTestCase):
def get_url(self):
with self.marionette.using_context('content'):
return self.marionette.execute_script("return document.location.href;")
def get_urlbar_value(self): def get_urlbar_value(self):
with self.marionette.using_context('chrome'): with self.marionette.using_context('chrome'):
return self.marionette.execute_script("return gURLBar.value;") return self.marionette.execute_script("return gURLBar.value;")
...@@ -23,7 +27,7 @@ class Test(WindowManagerMixin, MarionetteTestCase): ...@@ -23,7 +27,7 @@ class Test(WindowManagerMixin, MarionetteTestCase):
with m.using_context('content'): with m.using_context('content'):
# Navigating to a known .tor.onion should redirect and rewrite the urlbar with the alias. # Navigating to a known .tor.onion should redirect and rewrite the urlbar with the alias.
m.navigate('http://theintercept.securedrop.tor.onion') m.navigate('http://theintercept.securedrop.tor.onion')
self.assertEqual(m.get_url( self.assertEqual(self.get_url(
), 'http://xpxduj55x2j27l2qytu2tcetykyfxbjbafin3x4i3ywddzphkbrd3jyd.onion/') ), 'http://xpxduj55x2j27l2qytu2tcetykyfxbjbafin3x4i3ywddzphkbrd3jyd.onion/')
self.assertEqual(self.get_urlbar_value(), self.assertEqual(self.get_urlbar_value(),
'theintercept.securedrop.tor.onion') 'theintercept.securedrop.tor.onion')
...@@ -46,8 +50,8 @@ class Test(WindowManagerMixin, MarionetteTestCase): ...@@ -46,8 +50,8 @@ class Test(WindowManagerMixin, MarionetteTestCase):
lambda _: len(m.window_handles) > 1) lambda _: len(m.window_handles) > 1)
m.switch_to_window(m.window_handles[1]) m.switch_to_window(m.window_handles[1])
Wait(m, timeout=m.timeout.page_load).until( Wait(m, timeout=m.timeout.page_load).until(
lambda _: m.get_url() != 'about:blank') lambda _: self.get_url() != 'about:blank')
self.assertEqual(m.get_url( self.assertEqual(self.get_url(
), 'http://xpxduj55x2j27l2qytu2tcetykyfxbjbafin3x4i3ywddzphkbrd3jyd.onion/generate') ), 'http://xpxduj55x2j27l2qytu2tcetykyfxbjbafin3x4i3ywddzphkbrd3jyd.onion/generate')
self.assertEqual(self.get_urlbar_value(), self.assertEqual(self.get_urlbar_value(),
'theintercept.securedrop.tor.onion/generate') 'theintercept.securedrop.tor.onion/generate')
...@@ -59,7 +63,7 @@ class Test(WindowManagerMixin, MarionetteTestCase): ...@@ -59,7 +63,7 @@ class Test(WindowManagerMixin, MarionetteTestCase):
m.switch_to_window(new_tab) m.switch_to_window(new_tab)
m.navigate( m.navigate(
'http://xpxduj55x2j27l2qytu2tcetykyfxbjbafin3x4i3ywddzphkbrd3jyd.onion') 'http://xpxduj55x2j27l2qytu2tcetykyfxbjbafin3x4i3ywddzphkbrd3jyd.onion')
self.assertEqual(m.get_url( self.assertEqual(self.get_url(
), 'http://xpxduj55x2j27l2qytu2tcetykyfxbjbafin3x4i3ywddzphkbrd3jyd.onion/') ), 'http://xpxduj55x2j27l2qytu2tcetykyfxbjbafin3x4i3ywddzphkbrd3jyd.onion/')
self.assertEqual(self.get_urlbar_value( self.assertEqual(self.get_urlbar_value(
), 'xpxduj55x2j27l2qytu2tcetykyfxbjbafin3x4i3ywddzphkbrd3jyd.onion') ), 'xpxduj55x2j27l2qytu2tcetykyfxbjbafin3x4i3ywddzphkbrd3jyd.onion')
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment