[tbb-commits] [tor-browser-bundle-testsuite/master] Fix onion alias test for same reason as previous commit
gk at torproject.org
gk at torproject.org
Thu Oct 15 18:41:27 UTC 2020
commit d582cb8edb59ba625c24586a2b8b202a83440e11
Author: Alex Catarineu <acat at torproject.org>
Date: Thu Aug 27 22:28:26 2020 +0200
Fix onion alias test for same reason as previous commit
---
marionette/tor_browser_tests/test_onion_alias.py | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/marionette/tor_browser_tests/test_onion_alias.py b/marionette/tor_browser_tests/test_onion_alias.py
index 1495906..39dcc49 100644
--- a/marionette/tor_browser_tests/test_onion_alias.py
+++ b/marionette/tor_browser_tests/test_onion_alias.py
@@ -7,6 +7,10 @@ import time
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):
with self.marionette.using_context('chrome'):
return self.marionette.execute_script("return gURLBar.value;")
@@ -23,7 +27,7 @@ class Test(WindowManagerMixin, MarionetteTestCase):
with m.using_context('content'):
# Navigating to a known .tor.onion should redirect and rewrite the urlbar with the alias.
m.navigate('http://theintercept.securedrop.tor.onion')
- self.assertEqual(m.get_url(
+ self.assertEqual(self.get_url(
), 'http://xpxduj55x2j27l2qytu2tcetykyfxbjbafin3x4i3ywddzphkbrd3jyd.onion/')
self.assertEqual(self.get_urlbar_value(),
'theintercept.securedrop.tor.onion')
@@ -46,8 +50,8 @@ class Test(WindowManagerMixin, MarionetteTestCase):
lambda _: len(m.window_handles) > 1)
m.switch_to_window(m.window_handles[1])
Wait(m, timeout=m.timeout.page_load).until(
- lambda _: m.get_url() != 'about:blank')
- self.assertEqual(m.get_url(
+ lambda _: self.get_url() != 'about:blank')
+ self.assertEqual(self.get_url(
), 'http://xpxduj55x2j27l2qytu2tcetykyfxbjbafin3x4i3ywddzphkbrd3jyd.onion/generate')
self.assertEqual(self.get_urlbar_value(),
'theintercept.securedrop.tor.onion/generate')
@@ -59,7 +63,7 @@ class Test(WindowManagerMixin, MarionetteTestCase):
m.switch_to_window(new_tab)
m.navigate(
'http://xpxduj55x2j27l2qytu2tcetykyfxbjbafin3x4i3ywddzphkbrd3jyd.onion')
- self.assertEqual(m.get_url(
+ self.assertEqual(self.get_url(
), 'http://xpxduj55x2j27l2qytu2tcetykyfxbjbafin3x4i3ywddzphkbrd3jyd.onion/')
self.assertEqual(self.get_urlbar_value(
), 'xpxduj55x2j27l2qytu2tcetykyfxbjbafin3x4i3ywddzphkbrd3jyd.onion')
More information about the tbb-commits
mailing list