merge fx-team to mozilla-central

This commit is contained in:
Carsten "Tomcat" Book 2014-02-03 13:00:40 +01:00
commit b122f5d919
3 changed files with 46 additions and 2 deletions

View File

@ -142,6 +142,15 @@ var BrowserUI = {
return IndexedDB.receiveMessage(aMessage);
});
// hook up telemetry ping for UI data
try {
UITelemetry.addSimpleMeasureFunction("metro-ui",
BrowserUI._getMeasures.bind(BrowserUI));
} catch (ex) {
// swallow exception that occurs if metro-appbar measure is already set up
dump("Failed to addSimpleMeasureFunction in browser-ui: " + ex.message + "\n");
}
// Delay the panel UI and Sync initialization
window.addEventListener("UIReadyDelayed", function delayedInit(aEvent) {
Util.dumpLn("* delay load started...");
@ -379,7 +388,7 @@ var BrowserUI = {
// Delay doing the fixup so the raw URI is passed to loadURIWithFlags
// and the proper third-party fixup can be done
let fixupFlags = Ci.nsIURIFixup.FIXUP_FLAG_ALLOW_KEYWORD_LOOKUP |
let fixupFlags = Ci.nsIURIFixup.FIXUP_FLAG_ALLOW_KEYWORD_LOOKUP |
Ci.nsIURIFixup.FIXUP_FLAG_FIX_SCHEME_TYPOS;
let uri = gURIFixup.createFixupURI(aURI, fixupFlags);
gHistSvc.markPageAsTyped(uri);
@ -746,6 +755,14 @@ var BrowserUI = {
}
},
_getMeasures: function() {
let dimensions = {
"window-width": ContentAreaObserver.width,
"window-height": ContentAreaObserver.height
};
return dimensions;
},
/*********************************
* Event handling
*/
@ -1131,7 +1148,7 @@ var BrowserUI = {
let clearbutton = bundle.GetStringFromName("clearPrivateData.clearButton");
let prefsClearButton = document.getElementById("prefs-clear-data");
prefsClearButton.disabled = true;
prefsClearButton.disabled = true;
let buttonPressed = Services.prompt.confirmEx(
null,

View File

@ -0,0 +1,26 @@
// -*- Mode: js2; tab-width: 2; indent-tabs-mode: nil; js2-basic-offset: 2; js2-skip-preprocessor-directives: t; -*-
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
function test() {
runTests();
}
function getSimpleMeasurementsFromTelemetryPing() {
return Cu.import("resource://gre/modules/TelemetryPing.jsm", {}).
TelemetryPing.getPayload().simpleMeasurements;
}
gTests.push({
desc: "Test browser-ui telemetry",
run: function testBrowserUITelemetry() {
// startup should have registered simple measures function
let simpleMeasurements = getSimpleMeasurementsFromTelemetryPing();
ok(simpleMeasurements, "simpleMeasurements are truthy");
ok(simpleMeasurements.UITelemetry["metro-ui"]["window-width"], "window-width measurement was captured");
ok(simpleMeasurements.UITelemetry["metro-ui"]["window-height"], "window-height measurement was captured");
}
});

View File

@ -66,6 +66,7 @@ support-files =
[browser_test.js]
[browser_tiles.js]
[browser_topsites.js]
[browser_ui_telemetry.js]
[browser_urlbar.js]
[browser_urlbar_highlightURLs.js]
[browser_urlbar_trimURLs.js]