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.

Unverified Commit 492c6656 authored by boklm's avatar boklm
Browse files

Bug 18597: Check that the Performance Observer API cannot be used

parent a46250cc
......@@ -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',
......
# 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)
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