Commit a63a4323 authored by Georg Koppen's avatar Georg Koppen
Browse files

Bug 13024: Make sure resource timing is disabled.

This Mozmill test checks if it is possible to get resources with either
of the three available methods (getEntriesByType(), getEntriesByName()
and getEntries()). If so, it fails as this is a clear sign resource
timing has not been disabled properly and may still be active instead.
parent 5f68a966
......@@ -198,6 +198,11 @@ our @tests = (
type => 'mozmill',
descr => 'Check the list of DOM Objects exposed in the global namespace',
},
{
name => 'resource-timing',
type => 'mozmill',
descr => 'Check that the Resource Timing API is really disabled',
},
{
name => 'fp_screen_dimensions',
type => 'selenium',
......
// This test checks whether the Resource Timing API (see:
// http://www.w3.org/TR/resource-timing/) is really disabled in the default
// Tor Browser. Setting |dom.enable_resource_timing| to |false| and testing that
// might not be sufficient.
"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 RESOURCE_URL =
"https://upload.wikimedia.org/wikipedia/mediawiki/b/bc/Wiki.png";
var setupModule = function(aModule) {
aModule.controller = mozmill.getBrowserController();
}
var testNavigationTiming = function() {
var pass = false;
common.load_page(controller, TEST_URL);
// If resource timing is disabled we should not be able to get resource
// entries at all in the first place. We test all three methods for safety's
// sake.
// getEntriesByType()
try {
let resources = controller.tabs.activeTab.defaultView.performance.
getEntriesByType("resource")[0];
} catch (e) {
pass = true;
}
expect.ok(pass, "No resource entries found (getEntriesByType())");
// getEntriesByName()
pass = false;
try {
let resources = controller.tabs.activeTab.defaultView.performance.
getEntriesByName(RESOURCE_URL)[0];
} catch (e) {
pass = true;
}
expect.ok(pass, "No resource entries found (getEntriesByName())");
// getEntries()
pass = false;
try {
let resources = controller.tabs.activeTab.defaultView.performance.
getEntries()[0];
} catch (e) {
pass = true;
}
expect.ok(pass, "No resource entries found (getEntries())");
}
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