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
492c6656
Unverified
Commit
492c6656
authored
May 09, 2016
by
boklm
Browse files
Bug 18597: Check that the Performance Observer API cannot be used
parent
a46250cc
Changes
2
Hide whitespace changes
Inline
Side-by-side
TBBTestSuite/TestSuite/BrowserBundleTests.pm
View file @
492c6656
...
...
@@ -336,6 +336,17 @@ our @tests = (
# 'dom.enable_user_timing' => 'true',
#},
},
{
name
=>
'
performance-observer
',
type
=>
'
marionette
',
descr
=>
'
Check that the Performance Observer API is really disabled
',
use_net
=>
1
,
# To check that the test fails when performance observer is enabled,
# uncomment this:
#prefs => {
# 'dom.enable_performance_observer' => 'true',
#},
},
{
name
=>
'
searchengines
',
type
=>
'
marionette
',
...
...
marionette/tor_browser_tests/test_performance-observer.py
0 → 100644
View file @
492c6656
# This test checks whether the Performance Observer API (see:
# https://w3c.github.io/performance-timeline/#the-performanceobserver-interface)
# is really disabled in the default Tor Browser.
# Setting |dom.enable_performance_observer| to |false| and testing that
# might not be sufficient.
from
marionette_driver
import
By
from
marionette_driver.errors
import
MarionetteException
from
marionette
import
MarionetteTestCase
class
Test
(
MarionetteTestCase
):
def
setUp
(
self
):
MarionetteTestCase
.
setUp
(
self
)
self
.
TEST_URL
=
"about:robots"
def
test_performance_observer
(
self
):
with
self
.
marionette
.
using_context
(
'content'
):
self
.
marionette
.
navigate
(
self
.
TEST_URL
)
err_msg
=
'performance observer is working'
self
.
assertTrue
(
self
.
marionette
.
execute_script
(
"""
var pass = false;
try {
var observer = new PerformanceObserver(function(list) { });
observer.observe({entryTypes: ['resource', 'mark', 'measure']});
} catch (e) {
pass = true;
}
return pass;
"""
),
msg
=
err_msg
)
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