Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
The Tor Project
Applications
tor-browser-bundle-testsuite
Commits
59782207
Unverified
Commit
59782207
authored
Sep 19, 2016
by
boklm
Browse files
Bug 20149: add public key pinning test
parent
76acd0bc
Changes
2
Hide whitespace changes
Inline
Side-by-side
TBBTestSuite/TestSuite/BrowserBundleTests.pm
View file @
59782207
...
...
@@ -438,6 +438,13 @@ our @tests = (
descr
=>
'
Check if download of PDF is working (#19402)
',
use_net
=>
1
,
},
{
name
=>
'
pinning_now
',
type
=>
'
marionette
',
descr
=>
'
Check if static public key pinning is working (#20149)
',
marionette_test
=>
'
pinning
',
use_net
=>
1
,
},
);
sub
toggle_https_everywhere
{
...
...
marionette/tor_browser_tests/test_pinning.py
0 → 100644
View file @
59782207
from
marionette_driver
import
By
,
Actions
from
marionette_driver.errors
import
MarionetteException
,
JavascriptException
from
marionette
import
MarionetteTestCase
import
testsuite
class
Test
(
MarionetteTestCase
):
def
setUp
(
self
):
MarionetteTestCase
.
setUp
(
self
)
ts
=
testsuite
.
TestSuite
()
self
.
ts
=
ts
self
.
URL
=
'https://pinning-test.badssl.com/'
def
test_pinning
(
self
):
m
=
self
.
marionette
with
m
.
using_context
(
'content'
):
res
=
False
try
:
m
.
navigate
(
self
.
URL
)
except
Exception
:
res
=
True
self
.
assertTrue
(
res
,
msg
=
"Page could be loaded"
)
if
res
:
errorCode
=
m
.
find_element
(
'id'
,
'errorCode'
)
self
.
assertEqual
(
errorCode
.
get_attribute
(
'title'
),
'MOZILLA_PKIX_ERROR_KEY_PINNING_FAILURE'
,
msg
=
'Wrong error code'
)
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment