summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/old-tests/webdriver/navigation
diff options
context:
space:
mode:
authorMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
committerMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
commit5f8de423f190bbb79a62f804151bc24824fa32d8 (patch)
tree10027f336435511475e392454359edea8e25895d /testing/web-platform/tests/old-tests/webdriver/navigation
parent49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff)
downloadUXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip
Add m-esr52 at 52.6.0
Diffstat (limited to 'testing/web-platform/tests/old-tests/webdriver/navigation')
-rw-r--r--testing/web-platform/tests/old-tests/webdriver/navigation/__init__.py0
-rw-r--r--testing/web-platform/tests/old-tests/webdriver/navigation/auth_tests.py42
-rw-r--r--testing/web-platform/tests/old-tests/webdriver/navigation/forward.py24
-rw-r--r--testing/web-platform/tests/old-tests/webdriver/navigation/forwardToNothing.py20
-rw-r--r--testing/web-platform/tests/old-tests/webdriver/navigation/get_from_http_test.py60
-rw-r--r--testing/web-platform/tests/old-tests/webdriver/navigation/invalid_cert_test.py28
-rw-r--r--testing/web-platform/tests/old-tests/webdriver/navigation/refresh-page.py27
-rw-r--r--testing/web-platform/tests/old-tests/webdriver/navigation/refresh_page.py27
-rw-r--r--testing/web-platform/tests/old-tests/webdriver/navigation/res/1s-meta-redirect.html4
-rw-r--r--testing/web-platform/tests/old-tests/webdriver/navigation/res/60s-meta-redirect.html4
-rw-r--r--testing/web-platform/tests/old-tests/webdriver/navigation/res/authenticated.html5
-rw-r--r--testing/web-platform/tests/old-tests/webdriver/navigation/res/empty.html4
-rw-r--r--testing/web-platform/tests/old-tests/webdriver/navigation/res/forwardNext.html6
-rw-r--r--testing/web-platform/tests/old-tests/webdriver/navigation/res/forwardStart.html6
-rw-r--r--testing/web-platform/tests/old-tests/webdriver/navigation/res/fragment.html9
-rw-r--r--testing/web-platform/tests/old-tests/webdriver/navigation/res/instant-meta-redirect.html4
-rw-r--r--testing/web-platform/tests/old-tests/webdriver/navigation/res/refreshPageDynamic.html10
-rw-r--r--testing/web-platform/tests/old-tests/webdriver/navigation/res/refreshPageStatic.html6
-rw-r--r--testing/web-platform/tests/old-tests/webdriver/navigation/res/self-signed.key28
19 files changed, 314 insertions, 0 deletions
diff --git a/testing/web-platform/tests/old-tests/webdriver/navigation/__init__.py b/testing/web-platform/tests/old-tests/webdriver/navigation/__init__.py
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/old-tests/webdriver/navigation/__init__.py
diff --git a/testing/web-platform/tests/old-tests/webdriver/navigation/auth_tests.py b/testing/web-platform/tests/old-tests/webdriver/navigation/auth_tests.py
new file mode 100644
index 000000000..52a18cdb8
--- /dev/null
+++ b/testing/web-platform/tests/old-tests/webdriver/navigation/auth_tests.py
@@ -0,0 +1,42 @@
+import os
+import sys
+import unittest
+import ConfigParser
+
+sys.path.insert(1, os.path.abspath(os.path.join(__file__, "../..")))
+import base_test
+from selenium.common import exceptions
+from wptserve import server
+from wptserve.router import any_method
+from wptserve.handlers import basic_auth_handler
+
+class WebDriverAuthTest(unittest.TestCase):
+
+ # Set up class to start HTTP Server that responds to
+ # test URLs with various 401 responses
+ @classmethod
+ def setUpClass(cls):
+ cls.driver = base_test.create_driver()
+ cls.webserver = server.WebTestHttpd(routes=[(any_method, "*", basic_auth_handler)])
+ cls.webserver.start()
+
+ @classmethod
+ def tearDownClass(cls):
+ cls.driver.quit()
+ cls.webserver.stop()
+
+ # Test that when 401 is seen by browser, a WebDriver response is still sent
+ def test_response_401_auth_basic(self):
+ page = self.webserver.get_url('navigation/res/authenticated.html')
+ self.driver.set_page_load_timeout(5)
+ try:
+ self.driver.get( page )
+ # if we got a responses instead of timeout, that's success
+ self.assertTrue(True)
+ except exceptions.TimeoutException:
+ self.fail("Did not get response from browser.")
+ except:
+ self.fail("Unexpected failure. Please investigate.")
+
+if __name__ == "__main__":
+ unittest.main()
diff --git a/testing/web-platform/tests/old-tests/webdriver/navigation/forward.py b/testing/web-platform/tests/old-tests/webdriver/navigation/forward.py
new file mode 100644
index 000000000..67ca83227
--- /dev/null
+++ b/testing/web-platform/tests/old-tests/webdriver/navigation/forward.py
@@ -0,0 +1,24 @@
+import unittest
+import sys
+import os
+
+sys.path.insert(1, os.path.abspath(os.path.join(__file__, "../..")))
+import base_test
+
+
+class ForwardTest(base_test.WebDriverBaseTest):
+ # Get a static page that must be the same upon refresh
+ def test_forward(self):
+ self.driver.get(self.webserver.where_is('navigation/res/forwardStart.html'))
+ self.driver.get(self.webserver.where_is('navigation/res/forwardNext.html'))
+ nextbody = self.driver.find_element_by_css_selector("body").text
+ self.driver.back()
+ currbody = self.driver.find_element_by_css_selector("body").text
+ self.assertNotEqual(nextbody, currbody)
+ self.driver.forward()
+ currbody = self.driver.find_element_by_css_selector("body").text
+ self.assertEqual(nextbody, currbody)
+
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/testing/web-platform/tests/old-tests/webdriver/navigation/forwardToNothing.py b/testing/web-platform/tests/old-tests/webdriver/navigation/forwardToNothing.py
new file mode 100644
index 000000000..99759681a
--- /dev/null
+++ b/testing/web-platform/tests/old-tests/webdriver/navigation/forwardToNothing.py
@@ -0,0 +1,20 @@
+import os
+import sys
+import unittest
+
+sys.path.insert(1, os.path.abspath(os.path.join(__file__, "../..")))
+import base_test
+
+
+class ForwardToNothingTest(base_test.WebDriverBaseTest):
+ # Get a static page that must be the same upon refresh
+ def test_forwardToNothing(self):
+ self.driver.get(self.webserver.where_is('navigation/forwardStart.html'))
+ body = self.driver.find_element_by_css_selector("body").text
+ self.driver.forward()
+ currbody = self.driver.find_element_by_css_selector("body").text
+ self.assertEqual(body, currbody)
+
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/testing/web-platform/tests/old-tests/webdriver/navigation/get_from_http_test.py b/testing/web-platform/tests/old-tests/webdriver/navigation/get_from_http_test.py
new file mode 100644
index 000000000..d28a0d0b1
--- /dev/null
+++ b/testing/web-platform/tests/old-tests/webdriver/navigation/get_from_http_test.py
@@ -0,0 +1,60 @@
+import os
+import sys
+import unittest
+
+sys.path.insert(1, os.path.abspath(os.path.join(__file__, "../..")))
+import base_test
+
+
+class GetFromHttpTest(base_test.WebDriverBaseTest):
+ def testGetUrlWithNoRedirectionOverHttp(self):
+ page = self.webserver.where_is('navigation/res/empty.html')
+ self.driver.get(page)
+ url = self.driver.current_url
+ self.assertEquals(page, url)
+
+
+ def testGetWillFollowTheLocationHeader(self):
+ page = self.webserver.where_is('navigation/redirect')
+ self.driver.get(page)
+ expected = self.webserver.where_is('navigation/res/empty.html')
+ url = self.driver.current_url
+ self.assertEquals(expected, url)
+
+
+ def testGetWillFollowMetaRefreshThatRefreshesInstantly(self):
+ page = self.webserver.where_is('navigation/res/instant-meta-redirect.html')
+ self.driver.get(page)
+ expected = self.webserver.where_is('navigation/res/empty.html')
+ url = self.driver.current_url
+ self.assertEquals(expected, url)
+
+
+ def testGetWillFollowMetaRefreshThatRefreshesAfterOneSecond(self):
+ page = self.webserver.where_is('navigation/res/1s-meta-redirect.html')
+ self.driver.get(page)
+ expected = self.webserver.where_is('navigation/res/empty.html')
+ url = self.driver.current_url
+ self.assertEquals(expected, url)
+
+
+ def testGetWillNotFollowMetaRefreshThatRefreshesAfterMoreThanOneSecond(self):
+ page = self.webserver.where_is('navigation/res/60s-meta-redirect.html')
+ self.driver.get(page)
+ url = self.driver.current_url
+ self.assertEquals(page, url)
+
+
+ def testGetFragmentInCurrentDocumentDoesNotReloadPage(self):
+ page = self.webserver.where_is("navigation/res/fragment.html")
+ fragment_page = "%s#%s" % (page, "fragment")
+
+ self.driver.get(page)
+ self.driver.execute_script("state = true")
+
+ self.driver.get(fragment_page)
+ self.assertEquals(True, self.driver.execute_script("return state"))
+
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/testing/web-platform/tests/old-tests/webdriver/navigation/invalid_cert_test.py b/testing/web-platform/tests/old-tests/webdriver/navigation/invalid_cert_test.py
new file mode 100644
index 000000000..b980146ee
--- /dev/null
+++ b/testing/web-platform/tests/old-tests/webdriver/navigation/invalid_cert_test.py
@@ -0,0 +1,28 @@
+import BaseHTTPServer
+import os
+import ssl
+import sys
+import unittest
+
+sys.path.insert(1, os.path.abspath(os.path.join(__file__, "../..")))
+import base_test
+
+
+here = os.path.dirname(os.path.abspath(__file__))
+
+
+class InvalidCertTest(base_test.WebDriverBaseTest):
+ def testCanNavigateToSiteWithSelfSignedCert(self):
+ self.webserver.httpd.socket = ssl.wrap_socket(
+ self.webserver.httpd.socket,
+ certfile=os.path.join(here, 'res/self-signed.key'),
+ server_side=True)
+ expected = self.webserver.where_is(
+ 'navigation/res/empty.html').replace('http:', 'https:', 1)
+
+ self.driver.get(expected)
+ self.assertEquals(expected, self.driver.current_url)
+
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/testing/web-platform/tests/old-tests/webdriver/navigation/refresh-page.py b/testing/web-platform/tests/old-tests/webdriver/navigation/refresh-page.py
new file mode 100644
index 000000000..b0638e568
--- /dev/null
+++ b/testing/web-platform/tests/old-tests/webdriver/navigation/refresh-page.py
@@ -0,0 +1,27 @@
+import os
+import sys
+import unittest
+
+sys.path.insert(1, os.path.abspath(os.path.join(__file__, "../..")))
+import base_test
+
+
+class RefreshPageTest(base_test.WebDriverBaseTest):
+ # Get a static page that must be the same upon refresh
+ def test_refreshPage(self):
+ self.driver.get(self.webserver.where_is('navigation/res/refreshPageStatic.html'))
+ body = self.driver.find_element_by_css("body").text
+ self.driver.execute_script("document.getElementById('body').innerHTML=''")
+ self.driver.refresh()
+ newbody = self.driver.find_element_by_css("body").text
+ self.assertEqual(body, newbody)
+
+ self.driver.get(self.webserver.where_is('navigation/res/refreshPageDynamic.html'))
+ body = self.driver.find_element_by_css("body").text
+ self.driver.refresh()
+ newbody = self.driver.find_element_by_css("body").text
+ self.assertNotEqual(body, newbody)
+
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/testing/web-platform/tests/old-tests/webdriver/navigation/refresh_page.py b/testing/web-platform/tests/old-tests/webdriver/navigation/refresh_page.py
new file mode 100644
index 000000000..1e1899008
--- /dev/null
+++ b/testing/web-platform/tests/old-tests/webdriver/navigation/refresh_page.py
@@ -0,0 +1,27 @@
+import os
+import sys
+import unittest
+
+sys.path.insert(1, os.path.abspath(os.path.join(__file__, "../..")))
+import base_test
+
+
+class RefreshPageTest(base_test.WebDriverBaseTest):
+ # Get a static page that must be the same upon refresh
+ def test_refreshPage(self):
+ self.driver.get(self.webserver.where_is('navigation/res/refreshPageStatic.html'))
+ body = self.driver.find_element_by_css_selector("body").text
+ self.driver.execute_script("document.getElementById('body').innerHTML=''")
+ self.driver.refresh()
+ newbody = self.driver.find_element_by_css_selector("body").text
+ self.assertEqual(body, newbody)
+
+ self.driver.get(self.webserver.where_is('navigation/res/refreshPageDynamic.html'))
+ body = self.driver.find_element_by_css_selector("body").text
+ self.driver.refresh()
+ newbody = self.driver.find_element_by_css_selector("body").text
+ self.assertNotEqual(body, newbody)
+
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/testing/web-platform/tests/old-tests/webdriver/navigation/res/1s-meta-redirect.html b/testing/web-platform/tests/old-tests/webdriver/navigation/res/1s-meta-redirect.html
new file mode 100644
index 000000000..44fd332bd
--- /dev/null
+++ b/testing/web-platform/tests/old-tests/webdriver/navigation/res/1s-meta-redirect.html
@@ -0,0 +1,4 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<meta http-equiv="Refresh" content="1; URL=empty.html">
+<title>meta-redirect</title>
diff --git a/testing/web-platform/tests/old-tests/webdriver/navigation/res/60s-meta-redirect.html b/testing/web-platform/tests/old-tests/webdriver/navigation/res/60s-meta-redirect.html
new file mode 100644
index 000000000..9e56bc96a
--- /dev/null
+++ b/testing/web-platform/tests/old-tests/webdriver/navigation/res/60s-meta-redirect.html
@@ -0,0 +1,4 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<meta http-equiv="Refresh" content="60; URL=empty.html">
+<title>meta-redirect</title>
diff --git a/testing/web-platform/tests/old-tests/webdriver/navigation/res/authenticated.html b/testing/web-platform/tests/old-tests/webdriver/navigation/res/authenticated.html
new file mode 100644
index 000000000..c77449344
--- /dev/null
+++ b/testing/web-platform/tests/old-tests/webdriver/navigation/res/authenticated.html
@@ -0,0 +1,5 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+
+<title>authentication successful</title>
+<h1>You're in!</h1> \ No newline at end of file
diff --git a/testing/web-platform/tests/old-tests/webdriver/navigation/res/empty.html b/testing/web-platform/tests/old-tests/webdriver/navigation/res/empty.html
new file mode 100644
index 000000000..da58ac21d
--- /dev/null
+++ b/testing/web-platform/tests/old-tests/webdriver/navigation/res/empty.html
@@ -0,0 +1,4 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+
+<title>Cheese</title>
diff --git a/testing/web-platform/tests/old-tests/webdriver/navigation/res/forwardNext.html b/testing/web-platform/tests/old-tests/webdriver/navigation/res/forwardNext.html
new file mode 100644
index 000000000..edd77f866
--- /dev/null
+++ b/testing/web-platform/tests/old-tests/webdriver/navigation/res/forwardNext.html
@@ -0,0 +1,6 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<body id=body>
+This is the next page.
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/old-tests/webdriver/navigation/res/forwardStart.html b/testing/web-platform/tests/old-tests/webdriver/navigation/res/forwardStart.html
new file mode 100644
index 000000000..3ab4f3cdd
--- /dev/null
+++ b/testing/web-platform/tests/old-tests/webdriver/navigation/res/forwardStart.html
@@ -0,0 +1,6 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<body>
+This is the start page.
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/old-tests/webdriver/navigation/res/fragment.html b/testing/web-platform/tests/old-tests/webdriver/navigation/res/fragment.html
new file mode 100644
index 000000000..bd09434a6
--- /dev/null
+++ b/testing/web-platform/tests/old-tests/webdriver/navigation/res/fragment.html
@@ -0,0 +1,9 @@
+<!DOCTYPE html>
+<meta charset="utf-8" />
+<title>Fragment</title>
+
+<script>
+ var state = false;
+</script>
+
+<p id="fragment">I wish I were a pea, alas I am only a fragment.</p> \ No newline at end of file
diff --git a/testing/web-platform/tests/old-tests/webdriver/navigation/res/instant-meta-redirect.html b/testing/web-platform/tests/old-tests/webdriver/navigation/res/instant-meta-redirect.html
new file mode 100644
index 000000000..c6ad7c9f2
--- /dev/null
+++ b/testing/web-platform/tests/old-tests/webdriver/navigation/res/instant-meta-redirect.html
@@ -0,0 +1,4 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<meta http-equiv="Refresh" content="0; URL=empty.html">
+<title>meta-redirect</title>
diff --git a/testing/web-platform/tests/old-tests/webdriver/navigation/res/refreshPageDynamic.html b/testing/web-platform/tests/old-tests/webdriver/navigation/res/refreshPageDynamic.html
new file mode 100644
index 000000000..bedd20c35
--- /dev/null
+++ b/testing/web-platform/tests/old-tests/webdriver/navigation/res/refreshPageDynamic.html
@@ -0,0 +1,10 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<body id="body">
+This is a dynamic page. It will always have different content if refreshed.
+<div id="dynamic"></div>
+</body>
+</html>
+<script>
+document.getElementById('dynamic').innerHTML = Math.random();
+</script> \ No newline at end of file
diff --git a/testing/web-platform/tests/old-tests/webdriver/navigation/res/refreshPageStatic.html b/testing/web-platform/tests/old-tests/webdriver/navigation/res/refreshPageStatic.html
new file mode 100644
index 000000000..7d339aa9d
--- /dev/null
+++ b/testing/web-platform/tests/old-tests/webdriver/navigation/res/refreshPageStatic.html
@@ -0,0 +1,6 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<body id="body">
+This is a static page. It will always have the same content if refreshed.
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/old-tests/webdriver/navigation/res/self-signed.key b/testing/web-platform/tests/old-tests/webdriver/navigation/res/self-signed.key
new file mode 100644
index 000000000..bca61cdf7
--- /dev/null
+++ b/testing/web-platform/tests/old-tests/webdriver/navigation/res/self-signed.key
@@ -0,0 +1,28 @@
+-----BEGIN RSA PRIVATE KEY-----
+MIICXAIBAAKBgQDoww50sF8aKYNe1owbtsEilK2KOZx2F1Iv+EElpO7N2hDarIBu
+9f87H+03b5RpI9oCSFCo67wTdCJ0A4B8SLwV2SUZY78CGJB1A8kXqP04tz0S0SYD
+2TQRliwTxx1r7pDv1VmLc7XZRE6n6FFKTEjKmdUhCwHuQfC1sOkCXqSzFQIDAQAB
+AoGAS5XcAeSsXXCRqqB9SxqjyTkCydo/htG37L/vV+whaFOiGYDfDClyQp7xh4kC
+Zsovp4IYP2Kd5qtV7NqeRL3R5Z/Dxf6+6G4HdbI7np5m7A7cU32hMIzxi5M55Lo6
+gveNgHb3uy+R+tZTyab6saUxFy1DqbMh/2ga4lbatRm7JdkCQQD9C8+Q3nN8FkH4
+sKbOnHsKEV27459EYz7WnENiwhcYByBt7vw9BPM/LrO4UzWtgNjtRtxBpFeVT/V+
+dF7OZuH/AkEA63qhJcs6Ru3G29R3kJ82ttyHU1INawB/7od3bKp3rE+jUwNG7ZbQ
+mtRdPTI02/OOeqZKeo46JX3D57gfMRDC6wJABZk/TGs/jt1HNGNkLWoU5tIfisqs
+eWzgtQrcCtFUhXmS5BvHhOoZH6q+2zMsGtyg8A8DTIiAT5NnURbuCg8IrQJAd3kh
+d85zw/byFSjofPz6wq6DDngsDKUVQ42BvyWCUG+bewvHmdYSAuxKXjkx7oLVQE9M
+rH+q6sizc8bMNJW/fwJBAPcobQ59ZGAEWrnDdtbWnNS1ieSV8p6u7sg20HvrUIPS
+TIQXeems9IKu0xs0dnLXNucm4ur8MnE7snkvWZnx2C8=
+-----END RSA PRIVATE KEY-----
+-----BEGIN CERTIFICATE-----
+MIICAzCCAWwCCQCc6Lx6zkc0BDANBgkqhkiG9w0BAQUFADBFMQswCQYDVQQGEwJV
+UzETMBEGA1UECAwKQ2FsaWZvcm5pYTEhMB8GA1UECgwYSW50ZXJuZXQgV2lkZ2l0
+cyBQdHkgTHRkMCAXDTEzMDcxMjIyMzMxNVoYDzIyODcwNDI2MjIzMzE1WjBFMQsw
+CQYDVQQGEwJVUzETMBEGA1UECAwKQ2FsaWZvcm5pYTEhMB8GA1UECgwYSW50ZXJu
+ZXQgV2lkZ2l0cyBQdHkgTHRkMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDo
+ww50sF8aKYNe1owbtsEilK2KOZx2F1Iv+EElpO7N2hDarIBu9f87H+03b5RpI9oC
+SFCo67wTdCJ0A4B8SLwV2SUZY78CGJB1A8kXqP04tz0S0SYD2TQRliwTxx1r7pDv
+1VmLc7XZRE6n6FFKTEjKmdUhCwHuQfC1sOkCXqSzFQIDAQABMA0GCSqGSIb3DQEB
+BQUAA4GBAD6atn+xbACigA9+EmcZo2bpAzxLAuXOAVEBM6J7Nrd8pk1D3PRP0QPg
+UxjIDQ7ZqEWwLAcKb6AIfWwJ2Wj7q5LSX5nEFnUXggpywfUNTuZaR/fquUVnhMaO
+tF8fQB9AYSa1WjqUbIKlns3Z2RhUv2DSEifi6UNjsf2UpmDTxtkN
+-----END CERTIFICATE-----