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 c7bb99cd authored by boklm's avatar boklm
Browse files

Convert the navigation-timing test to marionette

parent 25d3adf0
......@@ -312,7 +312,7 @@ our @tests = (
},
{
name => 'navigation-timing',
type => 'mozmill',
type => 'marionette',
descr => 'Check that the Navigation Timing API is really disabled',
use_net => 1,
},
......
# This test checks whether the Navigation Timing API (see:
# http://www.w3.org/TR/navigation-timing/) is really disabled in the default
# Tor Browser. Setting |dom.enable_performance| to |false| and testing that has
# been not sufficient. See bug 13186 for further details.
from marionette_driver import By
from marionette_driver.errors import MarionetteException
from firefox_ui_harness import FirefoxTestCase
class Test(FirefoxTestCase):
def setUp(self):
FirefoxTestCase.setUp(self)
self.TEST_URL = "https://www.mediawiki.org/wiki/MediaWiki"
self.ATTRIBUTES = {
"navigationStart": 0,
"unloadEventStart": 0,
"unloadEventEnd": 0,
"redirectStart": 0,
"redirectEnd": 0,
"fetchStart": 0,
"domainLookupStart": 0,
"domainLookupEnd": 0,
"connectStart": 0,
"connectEnd": 0,
# Not available in Firefox yet.
"secureConnectionStart": None,
"requestStart": 0,
"responseStart": 0,
"responseEnd": 0,
"domLoading": 0,
"domInteractive": 0,
"domContentLoadedEventStart": 0,
"domContentLoadedEventEnd": 0,
"domComplete": 0,
"loadEventStart": 0,
"loadEventEnd": 0,
}
def test_navigation_timing(self):
with self.marionette.using_context('content'):
self.marionette.navigate(self.TEST_URL)
for name, val in self.ATTRIBUTES.iteritems():
err_msg = '%s != %s' % (name, val)
self.assertTrue(self.marionette.execute_script(
'return document.defaultView.performance.timing[arguments[0]] == arguments[1];',
script_args=[name, val]), msg=err_msg)
// This test checks whether the Navigation Timing API (see:
// http://www.w3.org/TR/navigation-timing/) is really disabled in the default
// Tor Browser. Setting |dom.enable_performance| to |false| and testing that has
// been not sufficient. See bug 13186 for further details.
"use strict";
var {expect} = require("../mozilla-mozmill-tests/lib/assertions");
var common = require("../lib/common");
const TEST_URL = "https://www.mediawiki.org/wiki/MediaWiki";
const ATTRIBUTES = {
"navigationStart": 0,
"unloadEventStart": 0,
"unloadEventEnd": 0,
"redirectStart": 0,
"redirectEnd": 0,
"fetchStart": 0,
"domainLookupStart": 0,
"domainLookupEnd": 0,
"connectStart": 0,
"connectEnd": 0,
// Not available in Firefox yet.
"secureConnectionStart": undefined,
"requestStart": 0,
"responseStart": 0,
"responseEnd": 0,
"domLoading": 0,
"domInteractive": 0,
"domContentLoadedEventStart": 0,
"domContentLoadedEventEnd": 0,
"domComplete": 0,
"loadEventStart": 0,
"loadEventEnd": 0
};
var setupModule = function(aModule) {
aModule.controller = mozmill.getBrowserController();
}
var testNavigationTiming = function() {
common.load_page(controller, TEST_URL);
let timing = controller.tabs.activeTab.defaultView.performance.timing;
for (let attr in ATTRIBUTES) {
expect.equal(timing[attr], ATTRIBUTES[attr], attr);
}
}
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