Unverified Commit 8b22a3de authored by boklm's avatar boklm
Browse files

Merge remote-tracking branch 'gk/bug_13024'

Conflicts:
	TBBTestSuite/BrowserBundleTests.pm
parents e9847587 a63a4323
......@@ -203,6 +203,11 @@ our @tests = (
type => 'mozmill',
descr => 'Check that the Navigation Timing API is really disabled',
},
{
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())");
}
......@@ -4,8 +4,11 @@
"use strict";
Cu.import("resource://gre/modules/Services.jsm");
var {expect} = require("../mozilla-mozmill-tests/lib/assertions");
var prefs = require("../mozilla-mozmill-tests/firefox/lib/prefs");
var utils = require("../mozilla-mozmill-tests/firefox/lib/utils");
// Most of the following checks and comments are taken from
// https://github.com/arthuredelstein/tor-browser/blob/12620/tbb-tests/browser_tor_TB4.js
......@@ -173,6 +176,13 @@ const SETTINGS = {
// "torbrowser.version": "UNKNOWN", // TODO: Should we check version using a regexp?
};
// Adding these preferences to SETTINGS breaks ESR 24 based browsers which do
// not have them. Thus, we check the version of the Tor Browser to test and iff
// it is equal or larger to 31.0 the preferences are tested.
const SETTINGS_NEW = {
"dom.enable_resource_timing": false,
}
var setupModule = function(aModule) {
aModule.controller = mozmill.getBrowserController();
}
......@@ -191,5 +201,10 @@ var testTBBSettings = function() {
var prefSrv = prefs.preferences;
for (let prefname in SETTINGS)
expect.equal(prefSrv.getPref(prefname, dval(SETTINGS[prefname])),
SETTINGS[prefname], prefname);
SETTINGS[prefname], prefname);
if (Services.vc.compare(utils.appInfo.version, "31.0") >= 0) {
for (let prefname in SETTINGS_NEW)
expect.equal(prefSrv.getPref(prefname, dval(SETTINGS_NEW[prefname])),
SETTINGS_NEW[prefname], prefname);
}
}
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