Merge mozilla-central to mozilla-inbound.

--HG--
rename : devtools/client/shared/multi-e10s-helper.js => devtools/shared/multi-e10s-helper.js
rename : toolkit/themes/shared/numberbox.css => toolkit/themes/shared/numberinput.css
extra : rebase_source : 3aa7c3b9f560aaa47259594ce1e52f1bfbbad169
This commit is contained in:
Cosmin Sabou 2019-01-09 18:16:13 +02:00
Родитель cf8dd0e68b ad04ab5446
Коммит 1e50aa1d21
90 изменённых файлов: 814 добавлений и 1042 удалений

Просмотреть файл

@ -238,7 +238,7 @@
<checkbox id="rememberHistoryDays"
label="Remember "
aria-labelledby="rememberHistoryDays historyDays rememberAfter"/>
<textbox id="historyDays" type="number" value="3"
<textbox id="historyDays" value="3"
aria-labelledby="rememberHistoryDays historyDays rememberAfter"/>
<label id="rememberAfter">days</label>

Просмотреть файл

@ -68,8 +68,8 @@
<textbox id="networkProxyHTTP" flex="1"
preference="network.proxy.http" onsyncfrompreference="return gConnectionsDialog.readHTTPProxyServer();"/>
<label data-l10n-id="connection-proxy-http-port" control="networkProxyHTTP_Port" />
<textbox id="networkProxyHTTP_Port" class="proxy-port-input" type="number" max="65535" hidespinbuttons="true"
preference="network.proxy.http_port" onsyncfrompreference="return gConnectionsDialog.readHTTPProxyPort();"/>
<html:input id="networkProxyHTTP_Port" class="proxy-port-input" hidespinbuttons="true" type="number" min="0" max="65535"
preference="network.proxy.http_port" onsyncfrompreference="return gConnectionsDialog.readHTTPProxyPort();"/>
</hbox>
</row>
<row>
@ -88,8 +88,8 @@
<textbox id="networkProxySSL" flex="1" preference="network.proxy.ssl"
onsyncfrompreference="return gConnectionsDialog.readProxyProtocolPref('ssl', false);"/>
<label data-l10n-id="connection-proxy-ssl-port" control="networkProxySSL_Port" />
<textbox id="networkProxySSL_Port" class="proxy-port-input" type="number" max="65535" size="5" preference="network.proxy.ssl_port"
hidespinbuttons="true" onsyncfrompreference="return gConnectionsDialog.readProxyProtocolPref('ssl', true);"/>
<html:input id="networkProxySSL_Port" class="proxy-port-input" hidespinbuttons="true" type="number" min="0" max="65535" size="5"
preference="network.proxy.ssl_port" onsyncfrompreference="return gConnectionsDialog.readProxyProtocolPref('ssl', true);"/>
</hbox>
</row>
<row align="center">
@ -100,8 +100,8 @@
<textbox id="networkProxyFTP" flex="1" preference="network.proxy.ftp"
onsyncfrompreference="return gConnectionsDialog.readProxyProtocolPref('ftp', false);"/>
<label data-l10n-id="connection-proxy-ftp-port" control="networkProxyFTP_Port"/>
<textbox id="networkProxyFTP_Port" class="proxy-port-input" type="number" max="65535" size="5" preference="network.proxy.ftp_port"
hidespinbuttons="true" onsyncfrompreference="return gConnectionsDialog.readProxyProtocolPref('ftp', true);"/>
<html:input id="networkProxyFTP_Port" class="proxy-port-input" hidespinbuttons="true" type="number" min="0" max="65535" size="5"
preference="network.proxy.ftp_port" onsyncfrompreference="return gConnectionsDialog.readProxyProtocolPref('ftp', true);"/>
</hbox>
</row>
<row align="center">
@ -112,8 +112,8 @@
<textbox id="networkProxySOCKS" flex="1" preference="network.proxy.socks"
onsyncfrompreference="return gConnectionsDialog.readProxyProtocolPref('socks', false);"/>
<label data-l10n-id="connection-proxy-socks-port" control="networkProxySOCKS_Port"/>
<textbox id="networkProxySOCKS_Port" class="proxy-port-input" type="number" max="65535" size="5" preference="network.proxy.socks_port"
hidespinbuttons="true" onsyncfrompreference="return gConnectionsDialog.readProxyProtocolPref('socks', true);"/>
<html:input id="networkProxySOCKS_Port" class="proxy-port-input" hidespinbuttons="true" type="number" min="0" max="65535" size="5"
preference="network.proxy.socks_port" onsyncfrompreference="return gConnectionsDialog.readProxyProtocolPref('socks', true);"/>
</hbox>
</row>
<row>

Просмотреть файл

@ -95,7 +95,7 @@ chrome/toolkit/skin/classic/global/global.css
chrome/toolkit/skin/classic/global/icons/close-win7.png
chrome/toolkit/skin/classic/global/menu.css
chrome/toolkit/skin/classic/global/menulist.css
chrome/toolkit/skin/classic/global/numberbox.css
chrome/toolkit/skin/classic/global/numberinput.css
chrome/toolkit/skin/classic/global/popup.css
chrome/toolkit/skin/classic/global/preferences.css
chrome/toolkit/skin/classic/global/radio.css

Просмотреть файл

@ -20,23 +20,24 @@ Services.obs.notifyObservers(null, TELEMETRY_SUBSESSION_TOPIC);
* Get a snapshot of the scalars and check them against the provided values.
*/
let checkScalars = (countsObject) => {
const scalars = getParentProcessScalars(Ci.nsITelemetry.DATASET_RELEASE_CHANNEL_OPTIN);
const scalars = TelemetryTestUtils.getParentProcessScalars(
Ci.nsITelemetry.DATASET_RELEASE_CHANNEL_OPTIN);
// Check the expected values. Scalars that are never set must not be reported.
checkScalar(scalars, MAX_CONCURRENT_TABS, countsObject.maxTabs,
"The maximum tab count must match the expected value.");
checkScalar(scalars, TAB_EVENT_COUNT, countsObject.tabOpenCount,
"The number of open tab event count must match the expected value.");
checkScalar(scalars, MAX_CONCURRENT_WINDOWS, countsObject.maxWindows,
"The maximum window count must match the expected value.");
checkScalar(scalars, WINDOW_OPEN_COUNT, countsObject.windowsOpenCount,
"The number of window open event count must match the expected value.");
checkScalar(scalars, TOTAL_URI_COUNT, countsObject.totalURIs,
"The total URI count must match the expected value.");
checkScalar(scalars, UNIQUE_DOMAINS_COUNT, countsObject.domainCount,
"The unique domains count must match the expected value.");
checkScalar(scalars, UNFILTERED_URI_COUNT, countsObject.totalUnfilteredURIs,
"The unfiltered URI count must match the expected value.");
TelemetryTestUtils.assertScalar(scalars, MAX_CONCURRENT_TABS, countsObject.maxTabs,
"The maximum tab count must match the expected value.");
TelemetryTestUtils.assertScalar(scalars, TAB_EVENT_COUNT, countsObject.tabOpenCount,
"The number of open tab event count must match the expected value.");
TelemetryTestUtils.assertScalar(scalars, MAX_CONCURRENT_WINDOWS, countsObject.maxWindows,
"The maximum window count must match the expected value.");
TelemetryTestUtils.assertScalar(scalars, WINDOW_OPEN_COUNT, countsObject.windowsOpenCount,
"The number of window open event count must match the expected value.");
TelemetryTestUtils.assertScalar(scalars, TOTAL_URI_COUNT, countsObject.totalURIs,
"The total URI count must match the expected value.");
TelemetryTestUtils.assertScalar(scalars, UNIQUE_DOMAINS_COUNT, countsObject.domainCount,
"The unique domains count must match the expected value.");
TelemetryTestUtils.assertScalar(scalars, UNFILTERED_URI_COUNT, countsObject.totalUnfilteredURIs,
"The unfiltered URI count must match the expected value.");
};
add_task(async function test_tabsAndWindows() {
@ -141,7 +142,7 @@ function checkTabCountHistogram(result, expected, message) {
add_task(async function test_tabsHistogram() {
let openedTabs = [];
let tabCountHist = getAndClearHistogram("TAB_COUNT");
let tabCountHist = TelemetryTestUtils.getAndClearHistogram("TAB_COUNT");
checkTabCountHistogram(tabCountHist.snapshot(), {}, "TAB_COUNT telemetry - initial tab counts");

Просмотреть файл

@ -49,7 +49,7 @@ add_task(async function test_context_menu() {
// Let's reset the Telemetry data.
Services.telemetry.clearScalars();
Services.telemetry.clearEvents();
let search_hist = getAndClearKeyedHistogram("SEARCH_COUNTS");
let search_hist = TelemetryTestUtils.getAndClearKeyedHistogram("SEARCH_COUNTS");
// Open a new tab with a page containing some text.
let tab =
@ -75,18 +75,21 @@ add_task(async function test_context_menu() {
searchItem.click();
info("Validate the search metrics.");
const scalars = getParentProcessScalars(Ci.nsITelemetry.DATASET_RELEASE_CHANNEL_OPTIN, true, false);
checkKeyedScalar(scalars, SCALAR_CONTEXT_MENU, "search", 1);
const scalars = TelemetryTestUtils.getParentProcessScalars(
Ci.nsITelemetry.DATASET_RELEASE_CHANNEL_OPTIN, true, false);
TelemetryTestUtils.assertKeyedScalar(scalars, SCALAR_CONTEXT_MENU, "search", 1);
Assert.equal(Object.keys(scalars[SCALAR_CONTEXT_MENU]).length, 1,
"This search must only increment one entry in the scalar.");
// Make sure SEARCH_COUNTS contains identical values.
checkKeyedHistogram(search_hist, "other-MozSearch.contextmenu", 1);
TelemetryTestUtils.assertKeyedHistogramSum(search_hist, "other-MozSearch.contextmenu", 1);
// Also check events.
let events = Services.telemetry.snapshotEvents(Ci.nsITelemetry.DATASET_RELEASE_CHANNEL_OPTIN, false);
events = (events.parent || []).filter(e => e[1] == "navigation" && e[2] == "search");
checkEvents(events, [["navigation", "search", "contextmenu", null, {engine: "other-MozSearch"}]]);
TelemetryTestUtils.assertEvents(events, [
["navigation", "search", "contextmenu", null, {engine: "other-MozSearch"}],
]);
contextMenu.hidePopup();
BrowserTestUtils.removeTab(gBrowser.selectedTab);
@ -97,7 +100,7 @@ add_task(async function test_about_newtab() {
// Let's reset the counts.
Services.telemetry.clearScalars();
Services.telemetry.clearEvents();
let search_hist = getAndClearKeyedHistogram("SEARCH_COUNTS");
let search_hist = TelemetryTestUtils.getAndClearKeyedHistogram("SEARCH_COUNTS");
let tab = await BrowserTestUtils.openNewForegroundTab(gBrowser, "about:newtab", false);
await ContentTask.spawn(tab.linkedBrowser, null, async function() {
@ -111,18 +114,21 @@ add_task(async function test_about_newtab() {
await p;
// Check if the scalars contain the expected values.
const scalars = getParentProcessScalars(Ci.nsITelemetry.DATASET_RELEASE_CHANNEL_OPTIN, true, false);
checkKeyedScalar(scalars, SCALAR_ABOUT_NEWTAB, "search_enter", 1);
const scalars = TelemetryTestUtils.getParentProcessScalars(
Ci.nsITelemetry.DATASET_RELEASE_CHANNEL_OPTIN, true, false);
TelemetryTestUtils.assertKeyedScalar(scalars, SCALAR_ABOUT_NEWTAB, "search_enter", 1);
Assert.equal(Object.keys(scalars[SCALAR_ABOUT_NEWTAB]).length, 1,
"This search must only increment one entry in the scalar.");
// Make sure SEARCH_COUNTS contains identical values.
checkKeyedHistogram(search_hist, "other-MozSearch.newtab", 1);
TelemetryTestUtils.assertKeyedHistogramSum(search_hist, "other-MozSearch.newtab", 1);
// Also check events.
let events = Services.telemetry.snapshotEvents(Ci.nsITelemetry.DATASET_RELEASE_CHANNEL_OPTIN, false);
events = (events.parent || []).filter(e => e[1] == "navigation" && e[2] == "search");
checkEvents(events, [["navigation", "search", "about_newtab", "enter", {engine: "other-MozSearch"}]]);
TelemetryTestUtils.assertEvents(events, [
["navigation", "search", "about_newtab", "enter", {engine: "other-MozSearch"}],
]);
BrowserTestUtils.removeTab(tab);
});

Просмотреть файл

@ -49,7 +49,7 @@ add_task(async function test_abouthome_activitystream_simpleQuery() {
// Let's reset the counts.
Services.telemetry.clearScalars();
Services.telemetry.clearEvents();
let search_hist = getAndClearKeyedHistogram("SEARCH_COUNTS");
let search_hist = TelemetryTestUtils.getAndClearKeyedHistogram("SEARCH_COUNTS");
let tab = await BrowserTestUtils.openNewForegroundTab(gBrowser);
@ -69,18 +69,21 @@ add_task(async function test_abouthome_activitystream_simpleQuery() {
await p;
// Check if the scalars contain the expected values.
const scalars = getParentProcessScalars(Ci.nsITelemetry.DATASET_RELEASE_CHANNEL_OPTIN, true, false);
checkKeyedScalar(scalars, SCALAR_ABOUT_HOME, "search_enter", 1);
const scalars = TelemetryTestUtils.getParentProcessScalars(
Ci.nsITelemetry.DATASET_RELEASE_CHANNEL_OPTIN, true, false);
TelemetryTestUtils.assertKeyedScalar(scalars, SCALAR_ABOUT_HOME, "search_enter", 1);
Assert.equal(Object.keys(scalars[SCALAR_ABOUT_HOME]).length, 1,
"This search must only increment one entry in the scalar.");
// Make sure SEARCH_COUNTS contains identical values.
checkKeyedHistogram(search_hist, "other-MozSearch.abouthome", 1);
TelemetryTestUtils.assertKeyedHistogramSum(search_hist, "other-MozSearch.abouthome", 1);
// Also check events.
let events = Services.telemetry.snapshotEvents(Ci.nsITelemetry.DATASET_RELEASE_CHANNEL_OPTIN, false);
events = (events.parent || []).filter(e => e[1] == "navigation" && e[2] == "search");
checkEvents(events, [["navigation", "search", "about_home", "enter", {engine: "other-MozSearch"}]]);
TelemetryTestUtils.assertEvents(events, [
["navigation", "search", "about_home", "enter", {engine: "other-MozSearch"}],
]);
BrowserTestUtils.removeTab(tab);
});

Просмотреть файл

@ -11,7 +11,7 @@ add_task(async function test_aboutRestartRequired() {
Services.telemetry.clearScalars();
let scalars =
getParentProcessScalars(Ci.nsITelemetry.DATASET_RELEASE_CHANNEL_OPTOUT);
TelemetryTestUtils.getParentProcessScalars(Ci.nsITelemetry.DATASET_RELEASE_CHANNEL_OPTOUT);
// Check preconditions
is(scalars[SCALAR_BUILDID_MISMATCH], undefined,
@ -23,7 +23,7 @@ add_task(async function test_aboutRestartRequired() {
gBrowser.selectedTab.linkedBrowser);
scalars =
getParentProcessScalars(Ci.nsITelemetry.DATASET_RELEASE_CHANNEL_OPTOUT);
TelemetryTestUtils.getParentProcessScalars(Ci.nsITelemetry.DATASET_RELEASE_CHANNEL_OPTOUT);
is(scalars[SCALAR_BUILDID_MISMATCH], 1,
"Build ID mismatch count should be 1.");

Просмотреть файл

@ -49,13 +49,14 @@ add_task(async function test_URIAndDomainCounts() {
let checkCounts = (countsObject) => {
// Get a snapshot of the scalars and then clear them.
const scalars = getParentProcessScalars(Ci.nsITelemetry.DATASET_RELEASE_CHANNEL_OPTIN);
checkScalar(scalars, TOTAL_URI_COUNT, countsObject.totalURIs,
"The URI scalar must contain the expected value.");
checkScalar(scalars, UNIQUE_DOMAINS_COUNT, countsObject.domainCount,
"The unique domains scalar must contain the expected value.");
checkScalar(scalars, UNFILTERED_URI_COUNT, countsObject.totalUnfilteredURIs,
"The unfiltered URI scalar must contain the expected value.");
const scalars = TelemetryTestUtils.getParentProcessScalars(
Ci.nsITelemetry.DATASET_RELEASE_CHANNEL_OPTIN);
TelemetryTestUtils.assertScalar(scalars, TOTAL_URI_COUNT, countsObject.totalURIs,
"The URI scalar must contain the expected value.");
TelemetryTestUtils.assertScalar(scalars, UNIQUE_DOMAINS_COUNT, countsObject.domainCount,
"The unique domains scalar must contain the expected value.");
TelemetryTestUtils.assertScalar(scalars, UNFILTERED_URI_COUNT, countsObject.totalUnfilteredURIs,
"The unfiltered URI scalar must contain the expected value.");
};
// Check that about:blank doesn't get counted in the URI total.

Просмотреть файл

@ -30,7 +30,8 @@ add_task(async function test_privateMode() {
await BrowserTestUtils.browserLoaded(privateWin.gBrowser.selectedBrowser);
// Check that tab and window count is recorded.
const scalars = getParentProcessScalars(Ci.nsITelemetry.DATASET_RELEASE_CHANNEL_OPTIN);
const scalars = TelemetryTestUtils.getParentProcessScalars(
Ci.nsITelemetry.DATASET_RELEASE_CHANNEL_OPTIN);
ok(!(TOTAL_URI_COUNT in scalars), "We should not track URIs in private mode.");
ok(!(UNFILTERED_URI_COUNT in scalars), "We should not track URIs in private mode.");
@ -79,7 +80,8 @@ add_task(async function test_sessionRestore() {
await tabRestored;
// Check that the URI is not recorded.
const scalars = getParentProcessScalars(Ci.nsITelemetry.DATASET_RELEASE_CHANNEL_OPTIN);
const scalars = TelemetryTestUtils.getParentProcessScalars(
Ci.nsITelemetry.DATASET_RELEASE_CHANNEL_OPTIN);
ok(!(TOTAL_URI_COUNT in scalars), "We should not track URIs from restored sessions.");
ok(!(UNFILTERED_URI_COUNT in scalars), "We should not track URIs from restored sessions.");

Просмотреть файл

@ -97,8 +97,10 @@ add_task(async function test_plainQuery() {
// Let's reset the counts.
Services.telemetry.clearScalars();
Services.telemetry.clearEvents();
let resultMethodHist = getAndClearHistogram("FX_SEARCHBAR_SELECTED_RESULT_METHOD");
let search_hist = getAndClearKeyedHistogram("SEARCH_COUNTS");
let resultMethodHist =
TelemetryTestUtils.getAndClearHistogram("FX_SEARCHBAR_SELECTED_RESULT_METHOD");
let search_hist =
TelemetryTestUtils.getAndClearKeyedHistogram("SEARCH_COUNTS");
let tab = await BrowserTestUtils.openNewForegroundTab(gBrowser, "about:blank");
@ -109,18 +111,21 @@ add_task(async function test_plainQuery() {
await p;
// Check if the scalars contain the expected values.
const scalars = getParentProcessScalars(Ci.nsITelemetry.DATASET_RELEASE_CHANNEL_OPTIN, true, false);
checkKeyedScalar(scalars, SCALAR_SEARCHBAR, "search_enter", 1);
const scalars = TelemetryTestUtils.getParentProcessScalars(
Ci.nsITelemetry.DATASET_RELEASE_CHANNEL_OPTIN, true, false);
TelemetryTestUtils.assertKeyedScalar(scalars, SCALAR_SEARCHBAR, "search_enter", 1);
Assert.equal(Object.keys(scalars[SCALAR_SEARCHBAR]).length, 1,
"This search must only increment one entry in the scalar.");
// Make sure SEARCH_COUNTS contains identical values.
checkKeyedHistogram(search_hist, "other-MozSearch.searchbar", 1);
TelemetryTestUtils.assertKeyedHistogramSum(search_hist, "other-MozSearch.searchbar", 1);
// Also check events.
let events = Services.telemetry.snapshotEvents(Ci.nsITelemetry.DATASET_RELEASE_CHANNEL_OPTIN, false);
events = (events.parent || []).filter(e => e[1] == "navigation" && e[2] == "search");
checkEvents(events, [["navigation", "search", "searchbar", "enter", {engine: "other-MozSearch"}]]);
TelemetryTestUtils.assertEvents(events, [
["navigation", "search", "searchbar", "enter", {engine: "other-MozSearch"}],
]);
// Check the histograms as well.
let resultMethods = resultMethodHist.snapshot();
@ -137,8 +142,10 @@ add_task(async function test_oneOff_enter() {
// Let's reset the counts.
Services.telemetry.clearScalars();
Services.telemetry.clearEvents();
let resultMethodHist = getAndClearHistogram("FX_SEARCHBAR_SELECTED_RESULT_METHOD");
let search_hist = getAndClearKeyedHistogram("SEARCH_COUNTS");
let resultMethodHist =
TelemetryTestUtils.getAndClearHistogram("FX_SEARCHBAR_SELECTED_RESULT_METHOD");
let search_hist =
TelemetryTestUtils.getAndClearKeyedHistogram("SEARCH_COUNTS");
let tab = await BrowserTestUtils.openNewForegroundTab(gBrowser, "about:blank");
@ -152,18 +159,21 @@ add_task(async function test_oneOff_enter() {
await p;
// Check if the scalars contain the expected values.
const scalars = getParentProcessScalars(Ci.nsITelemetry.DATASET_RELEASE_CHANNEL_OPTIN, true, false);
checkKeyedScalar(scalars, SCALAR_SEARCHBAR, "search_oneoff", 1);
const scalars = TelemetryTestUtils.getParentProcessScalars(
Ci.nsITelemetry.DATASET_RELEASE_CHANNEL_OPTIN, true, false);
TelemetryTestUtils.assertKeyedScalar(scalars, SCALAR_SEARCHBAR, "search_oneoff", 1);
Assert.equal(Object.keys(scalars[SCALAR_SEARCHBAR]).length, 1,
"This search must only increment one entry in the scalar.");
// Make sure SEARCH_COUNTS contains identical values.
checkKeyedHistogram(search_hist, "other-MozSearch2.searchbar", 1);
TelemetryTestUtils.assertKeyedHistogramSum(search_hist, "other-MozSearch2.searchbar", 1);
// Also check events.
let events = Services.telemetry.snapshotEvents(Ci.nsITelemetry.DATASET_RELEASE_CHANNEL_OPTIN, false);
events = (events.parent || []).filter(e => e[1] == "navigation" && e[2] == "search");
checkEvents(events, [["navigation", "search", "searchbar", "oneoff", {engine: "other-MozSearch2"}]]);
TelemetryTestUtils.assertEvents(events, [
["navigation", "search", "searchbar", "oneoff", {engine: "other-MozSearch2"}],
]);
// Check the histograms as well.
let resultMethods = resultMethodHist.snapshot();
@ -180,7 +190,8 @@ add_task(async function test_oneOff_enter() {
add_task(async function test_oneOff_enterSelection() {
// Let's reset the counts.
Services.telemetry.clearScalars();
let resultMethodHist = getAndClearHistogram("FX_SEARCHBAR_SELECTED_RESULT_METHOD");
let resultMethodHist =
TelemetryTestUtils.getAndClearHistogram("FX_SEARCHBAR_SELECTED_RESULT_METHOD");
// Create an engine to generate search suggestions and add it as default
// for this test.
@ -223,7 +234,8 @@ add_task(async function test_oneOff_enterSelection() {
add_task(async function test_oneOff_click() {
// Let's reset the counts.
Services.telemetry.clearScalars();
let resultMethodHist = getAndClearHistogram("FX_SEARCHBAR_SELECTED_RESULT_METHOD");
let resultMethodHist =
TelemetryTestUtils.getAndClearHistogram("FX_SEARCHBAR_SELECTED_RESULT_METHOD");
let tab = await BrowserTestUtils.openNewForegroundTab(gBrowser, "about:blank");
@ -247,8 +259,10 @@ add_task(async function test_suggestion_click() {
// Let's reset the counts.
Services.telemetry.clearScalars();
Services.telemetry.clearEvents();
let resultMethodHist = getAndClearHistogram("FX_SEARCHBAR_SELECTED_RESULT_METHOD");
let search_hist = getAndClearKeyedHistogram("SEARCH_COUNTS");
let resultMethodHist =
TelemetryTestUtils.getAndClearHistogram("FX_SEARCHBAR_SELECTED_RESULT_METHOD");
let search_hist =
TelemetryTestUtils.getAndClearKeyedHistogram("SEARCH_COUNTS");
// Create an engine to generate search suggestions and add it as default
// for this test.
@ -273,19 +287,22 @@ add_task(async function test_suggestion_click() {
await p;
// Check if the scalars contain the expected values.
const scalars = getParentProcessScalars(Ci.nsITelemetry.DATASET_RELEASE_CHANNEL_OPTIN, true, false);
checkKeyedScalar(scalars, SCALAR_SEARCHBAR, "search_suggestion", 1);
const scalars = TelemetryTestUtils.getParentProcessScalars(
Ci.nsITelemetry.DATASET_RELEASE_CHANNEL_OPTIN, true, false);
TelemetryTestUtils.assertKeyedScalar(scalars, SCALAR_SEARCHBAR, "search_suggestion", 1);
Assert.equal(Object.keys(scalars[SCALAR_SEARCHBAR]).length, 1,
"This search must only increment one entry in the scalar.");
// Make sure SEARCH_COUNTS contains identical values.
let searchEngineId = "other-" + suggestionEngine.name;
checkKeyedHistogram(search_hist, searchEngineId + ".searchbar", 1);
TelemetryTestUtils.assertKeyedHistogramSum(search_hist, searchEngineId + ".searchbar", 1);
// Also check events.
let events = Services.telemetry.snapshotEvents(Ci.nsITelemetry.DATASET_RELEASE_CHANNEL_OPTIN, false);
events = (events.parent || []).filter(e => e[1] == "navigation" && e[2] == "search");
checkEvents(events, [["navigation", "search", "searchbar", "suggestion", {engine: searchEngineId}]]);
TelemetryTestUtils.assertEvents(events, [
["navigation", "search", "searchbar", "suggestion", {engine: searchEngineId}],
]);
// Check the histograms as well.
let resultMethods = resultMethodHist.snapshot();
@ -305,7 +322,8 @@ add_task(async function test_suggestion_click() {
add_task(async function test_suggestion_enterSelection() {
// Let's reset the counts.
Services.telemetry.clearScalars();
let resultMethodHist = getAndClearHistogram("FX_SEARCHBAR_SELECTED_RESULT_METHOD");
let resultMethodHist =
TelemetryTestUtils.getAndClearHistogram("FX_SEARCHBAR_SELECTED_RESULT_METHOD");
// Create an engine to generate search suggestions and add it as default
// for this test.

Просмотреть файл

@ -17,18 +17,6 @@ ChromeUtils.defineModuleGetter(this, "URLBAR_SELECTED_RESULT_METHODS",
ChromeUtils.defineModuleGetter(this, "SearchTelemetry",
"resource:///modules/SearchTelemetry.jsm");
function checkHistogramResults(resultIndexes, expected, histogram) {
for (let [i, val] of Object.entries(resultIndexes.values)) {
if (i == expected) {
Assert.equal(val, 1,
`expected counts should match for ${histogram} index ${i}`);
} else {
Assert.equal(!!val, false,
`unexpected counts should be zero for ${histogram} index ${i}`);
}
}
}
let searchInAwesomebar = async function(inputText, win = window) {
await new Promise(r => waitForFocus(r, win));
// Write the search query in the urlbar.
@ -159,11 +147,11 @@ add_task(async function test_simpleQuery() {
Services.telemetry.clearScalars();
Services.telemetry.clearEvents();
let resultIndexHist = getAndClearHistogram("FX_URLBAR_SELECTED_RESULT_INDEX");
let resultTypeHist = getAndClearHistogram("FX_URLBAR_SELECTED_RESULT_TYPE");
let resultIndexByTypeHist = getAndClearKeyedHistogram("FX_URLBAR_SELECTED_RESULT_INDEX_BY_TYPE");
let resultMethodHist = getAndClearHistogram("FX_URLBAR_SELECTED_RESULT_METHOD");
let search_hist = getAndClearKeyedHistogram("SEARCH_COUNTS");
let resultIndexHist = TelemetryTestUtils.getAndClearHistogram("FX_URLBAR_SELECTED_RESULT_INDEX");
let resultTypeHist = TelemetryTestUtils.getAndClearHistogram("FX_URLBAR_SELECTED_RESULT_TYPE");
let resultIndexByTypeHist = TelemetryTestUtils.getAndClearKeyedHistogram("FX_URLBAR_SELECTED_RESULT_INDEX_BY_TYPE");
let resultMethodHist = TelemetryTestUtils.getAndClearHistogram("FX_URLBAR_SELECTED_RESULT_METHOD");
let search_hist = TelemetryTestUtils.getAndClearKeyedHistogram("SEARCH_COUNTS");
let tab = await BrowserTestUtils.openNewForegroundTab(gBrowser, "about:blank");
@ -174,38 +162,31 @@ add_task(async function test_simpleQuery() {
await p;
// Check if the scalars contain the expected values.
const scalars = getParentProcessScalars(Ci.nsITelemetry.DATASET_RELEASE_CHANNEL_OPTIN, true, false);
checkKeyedScalar(scalars, SCALAR_URLBAR, "search_enter", 1);
const scalars = TelemetryTestUtils.getParentProcessScalars(Ci.nsITelemetry.DATASET_RELEASE_CHANNEL_OPTIN, true, false);
TelemetryTestUtils.assertKeyedScalar(scalars, SCALAR_URLBAR, "search_enter", 1);
Assert.equal(Object.keys(scalars[SCALAR_URLBAR]).length, 1,
"This search must only increment one entry in the scalar.");
// Make sure SEARCH_COUNTS contains identical values.
checkKeyedHistogram(search_hist, "other-MozSearch.urlbar", 1);
checkKeyedHistogram(search_hist, "other-MozSearch.alias", undefined);
TelemetryTestUtils.assertKeyedHistogramSum(search_hist, "other-MozSearch.urlbar", 1);
TelemetryTestUtils.assertKeyedHistogramSum(search_hist, "other-MozSearch.alias", undefined);
// Also check events.
let events = Services.telemetry.snapshotEvents(Ci.nsITelemetry.DATASET_RELEASE_CHANNEL_OPTIN, false);
events = (events.parent || []).filter(e => e[1] == "navigation" && e[2] == "search");
checkEvents(events, [["navigation", "search", "urlbar", "enter", {engine: "other-MozSearch"}]]);
TelemetryTestUtils.assertEvents(events, [["navigation", "search", "urlbar", "enter", {engine: "other-MozSearch"}]]);
// Check the histograms as well.
let resultIndexes = resultIndexHist.snapshot();
checkHistogramResults(resultIndexes, 0, "FX_URLBAR_SELECTED_RESULT_INDEX");
TelemetryTestUtils.assertHistogram(resultIndexHist, 0, 1);
let resultTypes = resultTypeHist.snapshot();
checkHistogramResults(resultTypes,
URLBAR_SELECTED_RESULT_TYPES.searchengine,
"FX_URLBAR_SELECTED_RESULT_TYPE");
TelemetryTestUtils.assertHistogram(resultTypeHist,
URLBAR_SELECTED_RESULT_TYPES.searchengine, 1);
let resultIndexByType = resultIndexByTypeHist.snapshot().searchengine;
checkHistogramResults(resultIndexByType,
0,
"FX_URLBAR_SELECTED_RESULT_INDEX_BY_TYPE");
TelemetryTestUtils.assertKeyedHistogramValue(resultIndexByTypeHist,
"searchengine", 0, 1);
let resultMethods = resultMethodHist.snapshot();
checkHistogramResults(resultMethods,
URLBAR_SELECTED_RESULT_METHODS.enter,
"FX_URLBAR_SELECTED_RESULT_METHOD");
TelemetryTestUtils.assertHistogram(resultMethodHist,
URLBAR_SELECTED_RESULT_METHODS.enter, 1);
BrowserTestUtils.removeTab(tab);
});
@ -214,11 +195,11 @@ add_task(async function test_searchAlias() {
Services.telemetry.clearScalars();
Services.telemetry.clearEvents();
let resultIndexHist = getAndClearHistogram("FX_URLBAR_SELECTED_RESULT_INDEX");
let resultTypeHist = getAndClearHistogram("FX_URLBAR_SELECTED_RESULT_TYPE");
let resultIndexByTypeHist = getAndClearKeyedHistogram("FX_URLBAR_SELECTED_RESULT_INDEX_BY_TYPE");
let resultMethodHist = getAndClearHistogram("FX_URLBAR_SELECTED_RESULT_METHOD");
let search_hist = getAndClearKeyedHistogram("SEARCH_COUNTS");
let resultIndexHist = TelemetryTestUtils.getAndClearHistogram("FX_URLBAR_SELECTED_RESULT_INDEX");
let resultTypeHist = TelemetryTestUtils.getAndClearHistogram("FX_URLBAR_SELECTED_RESULT_TYPE");
let resultIndexByTypeHist = TelemetryTestUtils.getAndClearKeyedHistogram("FX_URLBAR_SELECTED_RESULT_INDEX_BY_TYPE");
let resultMethodHist = TelemetryTestUtils.getAndClearHistogram("FX_URLBAR_SELECTED_RESULT_METHOD");
let search_hist = TelemetryTestUtils.getAndClearKeyedHistogram("SEARCH_COUNTS");
let tab = await BrowserTestUtils.openNewForegroundTab(gBrowser, "about:blank");
@ -229,44 +210,37 @@ add_task(async function test_searchAlias() {
await p;
// Check if the scalars contain the expected values.
const scalars = getParentProcessScalars(Ci.nsITelemetry.DATASET_RELEASE_CHANNEL_OPTIN, true, false);
checkKeyedScalar(scalars, SCALAR_URLBAR, "search_alias", 1);
const scalars = TelemetryTestUtils.getParentProcessScalars(Ci.nsITelemetry.DATASET_RELEASE_CHANNEL_OPTIN, true, false);
TelemetryTestUtils.assertKeyedScalar(scalars, SCALAR_URLBAR, "search_alias", 1);
Assert.equal(Object.keys(scalars[SCALAR_URLBAR]).length, 1,
"This search must only increment one entry in the scalar.");
// Make sure SEARCH_COUNTS contains identical values.
checkKeyedHistogram(search_hist, "other-MozSearch.urlbar", 1);
checkKeyedHistogram(search_hist, "other-MozSearch.alias", undefined);
TelemetryTestUtils.assertKeyedHistogramSum(search_hist, "other-MozSearch.urlbar", 1);
TelemetryTestUtils.assertKeyedHistogramSum(search_hist, "other-MozSearch.alias", undefined);
// Also check events.
let events = Services.telemetry.snapshotEvents(Ci.nsITelemetry.DATASET_RELEASE_CHANNEL_OPTIN, false);
events = (events.parent || []).filter(e => e[1] == "navigation" && e[2] == "search");
checkEvents(events, [["navigation", "search", "urlbar", "alias", {engine: "other-MozSearch"}]]);
TelemetryTestUtils.assertEvents(events, [["navigation", "search", "urlbar", "alias", {engine: "other-MozSearch"}]]);
// Check the histograms as well.
let resultIndexes = resultIndexHist.snapshot();
checkHistogramResults(resultIndexes, 0, "FX_URLBAR_SELECTED_RESULT_INDEX");
TelemetryTestUtils.assertHistogram(resultIndexHist, 0, 1);
let resultTypes = resultTypeHist.snapshot();
checkHistogramResults(resultTypes,
URLBAR_SELECTED_RESULT_TYPES.searchengine,
"FX_URLBAR_SELECTED_RESULT_TYPE");
TelemetryTestUtils.assertHistogram(resultTypeHist,
URLBAR_SELECTED_RESULT_TYPES.searchengine, 1);
let resultIndexByType = resultIndexByTypeHist.snapshot().searchengine;
checkHistogramResults(resultIndexByType,
0,
"FX_URLBAR_SELECTED_RESULT_INDEX_BY_TYPE");
TelemetryTestUtils.assertKeyedHistogramValue(resultIndexByTypeHist,
"searchengine", 0, 1);
let resultMethods = resultMethodHist.snapshot();
checkHistogramResults(resultMethods,
URLBAR_SELECTED_RESULT_METHODS.enter,
"FX_URLBAR_SELECTED_RESULT_METHOD");
TelemetryTestUtils.assertHistogram(resultMethodHist,
URLBAR_SELECTED_RESULT_METHODS.enter, 1);
BrowserTestUtils.removeTab(tab);
});
add_task(async function test_internalSearchAlias() {
let search_hist = getAndClearKeyedHistogram("SEARCH_COUNTS");
let search_hist = TelemetryTestUtils.getAndClearKeyedHistogram("SEARCH_COUNTS");
let tab = await BrowserTestUtils.openNewForegroundTab(gBrowser, "about:blank");
@ -276,8 +250,8 @@ add_task(async function test_internalSearchAlias() {
EventUtils.synthesizeKey("KEY_Enter");
await p;
checkKeyedHistogram(search_hist, "other-MozSearch.urlbar", 1);
checkKeyedHistogram(search_hist, "other-MozSearch.alias", 1);
TelemetryTestUtils.assertKeyedHistogramSum(search_hist, "other-MozSearch.urlbar", 1);
TelemetryTestUtils.assertKeyedHistogramSum(search_hist, "other-MozSearch.alias", 1);
info("Search using the other internal search alias.");
p = BrowserTestUtils.browserLoaded(tab.linkedBrowser);
@ -285,8 +259,8 @@ add_task(async function test_internalSearchAlias() {
EventUtils.synthesizeKey("KEY_Enter");
await p;
checkKeyedHistogram(search_hist, "other-MozSearch.urlbar", 2);
checkKeyedHistogram(search_hist, "other-MozSearch.alias", 2);
TelemetryTestUtils.assertKeyedHistogramSum(search_hist, "other-MozSearch.urlbar", 2);
TelemetryTestUtils.assertKeyedHistogramSum(search_hist, "other-MozSearch.alias", 2);
BrowserTestUtils.removeTab(tab);
});
@ -297,11 +271,11 @@ add_task(async function test_oneOff_enter() {
Services.telemetry.clearScalars();
Services.telemetry.clearEvents();
let resultIndexHist = getAndClearHistogram("FX_URLBAR_SELECTED_RESULT_INDEX");
let resultTypeHist = getAndClearHistogram("FX_URLBAR_SELECTED_RESULT_TYPE");
let resultIndexByTypeHist = getAndClearKeyedHistogram("FX_URLBAR_SELECTED_RESULT_INDEX_BY_TYPE");
let resultMethodHist = getAndClearHistogram("FX_URLBAR_SELECTED_RESULT_METHOD");
let search_hist = getAndClearKeyedHistogram("SEARCH_COUNTS");
let resultIndexHist = TelemetryTestUtils.getAndClearHistogram("FX_URLBAR_SELECTED_RESULT_INDEX");
let resultTypeHist = TelemetryTestUtils.getAndClearHistogram("FX_URLBAR_SELECTED_RESULT_TYPE");
let resultIndexByTypeHist = TelemetryTestUtils.getAndClearKeyedHistogram("FX_URLBAR_SELECTED_RESULT_INDEX_BY_TYPE");
let resultMethodHist = TelemetryTestUtils.getAndClearHistogram("FX_URLBAR_SELECTED_RESULT_METHOD");
let search_hist = TelemetryTestUtils.getAndClearKeyedHistogram("SEARCH_COUNTS");
let tab = await BrowserTestUtils.openNewForegroundTab(gBrowser, "about:blank");
@ -315,38 +289,31 @@ add_task(async function test_oneOff_enter() {
await p;
// Check if the scalars contain the expected values.
const scalars = getParentProcessScalars(Ci.nsITelemetry.DATASET_RELEASE_CHANNEL_OPTIN, true, false);
checkKeyedScalar(scalars, SCALAR_URLBAR, "search_oneoff", 1);
const scalars = TelemetryTestUtils.getParentProcessScalars(Ci.nsITelemetry.DATASET_RELEASE_CHANNEL_OPTIN, true, false);
TelemetryTestUtils.assertKeyedScalar(scalars, SCALAR_URLBAR, "search_oneoff", 1);
Assert.equal(Object.keys(scalars[SCALAR_URLBAR]).length, 1,
"This search must only increment one entry in the scalar.");
// Make sure SEARCH_COUNTS contains identical values.
checkKeyedHistogram(search_hist, "other-MozSearch.urlbar", 1);
checkKeyedHistogram(search_hist, "other-MozSearch.alias", undefined);
TelemetryTestUtils.assertKeyedHistogramSum(search_hist, "other-MozSearch.urlbar", 1);
TelemetryTestUtils.assertKeyedHistogramSum(search_hist, "other-MozSearch.alias", undefined);
// Also check events.
let events = Services.telemetry.snapshotEvents(Ci.nsITelemetry.DATASET_RELEASE_CHANNEL_OPTIN, false);
events = (events.parent || []).filter(e => e[1] == "navigation" && e[2] == "search");
checkEvents(events, [["navigation", "search", "urlbar", "oneoff", {engine: "other-MozSearch"}]]);
TelemetryTestUtils.assertEvents(events, [["navigation", "search", "urlbar", "oneoff", {engine: "other-MozSearch"}]]);
// Check the histograms as well.
let resultIndexes = resultIndexHist.snapshot();
checkHistogramResults(resultIndexes, 0, "FX_URLBAR_SELECTED_RESULT_INDEX");
TelemetryTestUtils.assertHistogram(resultIndexHist, 0, 1);
let resultTypes = resultTypeHist.snapshot();
checkHistogramResults(resultTypes,
URLBAR_SELECTED_RESULT_TYPES.searchengine,
"FX_URLBAR_SELECTED_RESULT_TYPE");
TelemetryTestUtils.assertHistogram(resultTypeHist,
URLBAR_SELECTED_RESULT_TYPES.searchengine, 1);
let resultIndexByType = resultIndexByTypeHist.snapshot().searchengine;
checkHistogramResults(resultIndexByType,
0,
"FX_URLBAR_SELECTED_RESULT_INDEX_BY_TYPE");
TelemetryTestUtils.assertKeyedHistogramValue(resultIndexByTypeHist,
"searchengine", 0, 1);
let resultMethods = resultMethodHist.snapshot();
checkHistogramResults(resultMethods,
URLBAR_SELECTED_RESULT_METHODS.enter,
"FX_URLBAR_SELECTED_RESULT_METHOD");
TelemetryTestUtils.assertHistogram(resultMethodHist,
URLBAR_SELECTED_RESULT_METHODS.enter, 1);
BrowserTestUtils.removeTab(tab);
});
@ -356,7 +323,7 @@ add_task(async function test_oneOff_enter() {
// since test_oneOff_enter covers everything else.
add_task(async function test_oneOff_enterSelection() {
Services.telemetry.clearScalars();
let resultMethodHist = getAndClearHistogram("FX_URLBAR_SELECTED_RESULT_METHOD");
let resultMethodHist = TelemetryTestUtils.getAndClearHistogram("FX_URLBAR_SELECTED_RESULT_METHOD");
await withNewSearchEngine(async function() {
let tab = await BrowserTestUtils.openNewForegroundTab(gBrowser, "about:blank");
@ -371,10 +338,8 @@ add_task(async function test_oneOff_enterSelection() {
EventUtils.synthesizeKey("KEY_Enter");
await p;
let resultMethods = resultMethodHist.snapshot();
checkHistogramResults(resultMethods,
URLBAR_SELECTED_RESULT_METHODS.arrowEnterSelection,
"FX_URLBAR_SELECTED_RESULT_METHOD");
TelemetryTestUtils.assertHistogram(resultMethodHist,
URLBAR_SELECTED_RESULT_METHODS.arrowEnterSelection, 1);
BrowserTestUtils.removeTab(tab);
});
@ -386,7 +351,7 @@ add_task(async function test_oneOff_enterSelection() {
add_task(async function test_oneOff_click() {
Services.telemetry.clearScalars();
let resultMethodHist = getAndClearHistogram("FX_URLBAR_SELECTED_RESULT_METHOD");
let resultMethodHist = TelemetryTestUtils.getAndClearHistogram("FX_URLBAR_SELECTED_RESULT_METHOD");
let tab = await BrowserTestUtils.openNewForegroundTab(gBrowser, "about:blank");
@ -397,10 +362,8 @@ add_task(async function test_oneOff_click() {
gURLBar.popup.oneOffSearchButtons.getSelectableButtons(false)[0].click();
await p;
let resultMethods = resultMethodHist.snapshot();
checkHistogramResults(resultMethods,
URLBAR_SELECTED_RESULT_METHODS.click,
"FX_URLBAR_SELECTED_RESULT_METHOD");
TelemetryTestUtils.assertHistogram(resultMethodHist,
URLBAR_SELECTED_RESULT_METHODS.click, 1);
BrowserTestUtils.removeTab(tab);
});
@ -410,11 +373,11 @@ add_task(async function test_suggestion_click() {
Services.telemetry.clearScalars();
Services.telemetry.clearEvents();
let resultIndexHist = getAndClearHistogram("FX_URLBAR_SELECTED_RESULT_INDEX");
let resultTypeHist = getAndClearHistogram("FX_URLBAR_SELECTED_RESULT_TYPE");
let resultIndexByTypeHist = getAndClearKeyedHistogram("FX_URLBAR_SELECTED_RESULT_INDEX_BY_TYPE");
let resultMethodHist = getAndClearHistogram("FX_URLBAR_SELECTED_RESULT_METHOD");
let search_hist = getAndClearKeyedHistogram("SEARCH_COUNTS");
let resultIndexHist = TelemetryTestUtils.getAndClearHistogram("FX_URLBAR_SELECTED_RESULT_INDEX");
let resultTypeHist = TelemetryTestUtils.getAndClearHistogram("FX_URLBAR_SELECTED_RESULT_TYPE");
let resultIndexByTypeHist = TelemetryTestUtils.getAndClearKeyedHistogram("FX_URLBAR_SELECTED_RESULT_INDEX_BY_TYPE");
let resultMethodHist = TelemetryTestUtils.getAndClearHistogram("FX_URLBAR_SELECTED_RESULT_METHOD");
let search_hist = TelemetryTestUtils.getAndClearKeyedHistogram("SEARCH_COUNTS");
await withNewSearchEngine(async function(engine) {
let tab = await BrowserTestUtils.openNewForegroundTab(gBrowser, "about:blank");
@ -427,38 +390,31 @@ add_task(async function test_suggestion_click() {
await p;
// Check if the scalars contain the expected values.
const scalars = getParentProcessScalars(Ci.nsITelemetry.DATASET_RELEASE_CHANNEL_OPTIN, true, false);
checkKeyedScalar(scalars, SCALAR_URLBAR, "search_suggestion", 1);
const scalars = TelemetryTestUtils.getParentProcessScalars(Ci.nsITelemetry.DATASET_RELEASE_CHANNEL_OPTIN, true, false);
TelemetryTestUtils.assertKeyedScalar(scalars, SCALAR_URLBAR, "search_suggestion", 1);
Assert.equal(Object.keys(scalars[SCALAR_URLBAR]).length, 1,
"This search must only increment one entry in the scalar.");
// Make sure SEARCH_COUNTS contains identical values.
let searchEngineId = "other-" + engine.name;
checkKeyedHistogram(search_hist, searchEngineId + ".urlbar", 1);
TelemetryTestUtils.assertKeyedHistogramSum(search_hist, searchEngineId + ".urlbar", 1);
// Also check events.
let events = Services.telemetry.snapshotEvents(Ci.nsITelemetry.DATASET_RELEASE_CHANNEL_OPTIN, false);
events = (events.parent || []).filter(e => e[1] == "navigation" && e[2] == "search");
checkEvents(events, [["navigation", "search", "urlbar", "suggestion", {engine: searchEngineId}]]);
TelemetryTestUtils.assertEvents(events, [["navigation", "search", "urlbar", "suggestion", {engine: searchEngineId}]]);
// Check the histograms as well.
let resultIndexes = resultIndexHist.snapshot();
checkHistogramResults(resultIndexes, 3, "FX_URLBAR_SELECTED_RESULT_INDEX");
TelemetryTestUtils.assertHistogram(resultIndexHist, 3, 1);
let resultTypes = resultTypeHist.snapshot();
checkHistogramResults(resultTypes,
URLBAR_SELECTED_RESULT_TYPES.searchsuggestion,
"FX_URLBAR_SELECTED_RESULT_TYPE");
TelemetryTestUtils.assertHistogram(resultTypeHist,
URLBAR_SELECTED_RESULT_TYPES.searchsuggestion, 1);
let resultIndexByType = resultIndexByTypeHist.snapshot().searchsuggestion;
checkHistogramResults(resultIndexByType,
3,
"FX_URLBAR_SELECTED_RESULT_INDEX_BY_TYPE");
TelemetryTestUtils.assertKeyedHistogramValue(resultIndexByTypeHist,
"searchsuggestion", 3, 1);
let resultMethods = resultMethodHist.snapshot();
checkHistogramResults(resultMethods,
URLBAR_SELECTED_RESULT_METHODS.click,
"FX_URLBAR_SELECTED_RESULT_METHOD");
TelemetryTestUtils.assertHistogram(resultMethodHist,
URLBAR_SELECTED_RESULT_METHODS.click, 1);
BrowserTestUtils.removeTab(tab);
});
@ -469,7 +425,7 @@ add_task(async function test_suggestion_click() {
// histogram since test_suggestion_click covers everything else.
add_task(async function test_suggestion_arrowEnterSelection() {
Services.telemetry.clearScalars();
let resultMethodHist = getAndClearHistogram("FX_URLBAR_SELECTED_RESULT_METHOD");
let resultMethodHist = TelemetryTestUtils.getAndClearHistogram("FX_URLBAR_SELECTED_RESULT_METHOD");
await withNewSearchEngine(async function() {
let tab = await BrowserTestUtils.openNewForegroundTab(gBrowser, "about:blank");
@ -482,10 +438,8 @@ add_task(async function test_suggestion_arrowEnterSelection() {
EventUtils.synthesizeKey("KEY_Enter");
await p;
let resultMethods = resultMethodHist.snapshot();
checkHistogramResults(resultMethods,
URLBAR_SELECTED_RESULT_METHODS.arrowEnterSelection,
"FX_URLBAR_SELECTED_RESULT_METHOD");
TelemetryTestUtils.assertHistogram(resultMethodHist,
URLBAR_SELECTED_RESULT_METHODS.arrowEnterSelection, 1);
BrowserTestUtils.removeTab(tab);
});
@ -495,7 +449,7 @@ add_task(async function test_suggestion_arrowEnterSelection() {
// suggestion offered by the test search engine.
add_task(async function test_suggestion_tabEnterSelection() {
Services.telemetry.clearScalars();
let resultMethodHist = getAndClearHistogram("FX_URLBAR_SELECTED_RESULT_METHOD");
let resultMethodHist = TelemetryTestUtils.getAndClearHistogram("FX_URLBAR_SELECTED_RESULT_METHOD");
await withNewSearchEngine(async function() {
let tab = await BrowserTestUtils.openNewForegroundTab(gBrowser, "about:blank");
@ -508,10 +462,8 @@ add_task(async function test_suggestion_tabEnterSelection() {
EventUtils.synthesizeKey("KEY_Enter");
await p;
let resultMethods = resultMethodHist.snapshot();
checkHistogramResults(resultMethods,
URLBAR_SELECTED_RESULT_METHODS.tabEnterSelection,
"FX_URLBAR_SELECTED_RESULT_METHOD");
TelemetryTestUtils.assertHistogram(resultMethodHist,
URLBAR_SELECTED_RESULT_METHODS.tabEnterSelection, 1);
BrowserTestUtils.removeTab(tab);
});
@ -521,7 +473,7 @@ add_task(async function test_suggestion_tabEnterSelection() {
// suggestion offered by the test search engine.
add_task(async function test_suggestion_enterSelection() {
Services.telemetry.clearScalars();
let resultMethodHist = getAndClearHistogram("FX_URLBAR_SELECTED_RESULT_METHOD");
let resultMethodHist = TelemetryTestUtils.getAndClearHistogram("FX_URLBAR_SELECTED_RESULT_METHOD");
await withNewSearchEngine(async function() {
let tab = await BrowserTestUtils.openNewForegroundTab(gBrowser, "about:blank");
@ -534,10 +486,8 @@ add_task(async function test_suggestion_enterSelection() {
EventUtils.synthesizeKey("KEY_Enter");
await p;
let resultMethods = resultMethodHist.snapshot();
checkHistogramResults(resultMethods,
URLBAR_SELECTED_RESULT_METHODS.enterSelection,
"FX_URLBAR_SELECTED_RESULT_METHOD");
TelemetryTestUtils.assertHistogram(resultMethodHist,
URLBAR_SELECTED_RESULT_METHODS.enterSelection, 1);
BrowserTestUtils.removeTab(tab);
});
@ -546,7 +496,7 @@ add_task(async function test_suggestion_enterSelection() {
// Selects through mouse right button and press the Return (Enter) key.
add_task(async function test_suggestion_rightclick() {
Services.telemetry.clearScalars();
let resultMethodHist = getAndClearHistogram("FX_URLBAR_SELECTED_RESULT_METHOD");
let resultMethodHist = TelemetryTestUtils.getAndClearHistogram("FX_URLBAR_SELECTED_RESULT_METHOD");
await withNewSearchEngine(async function() {
let tab = await BrowserTestUtils.openNewForegroundTab(gBrowser, "about:blank");
@ -559,10 +509,8 @@ add_task(async function test_suggestion_rightclick() {
EventUtils.synthesizeKey("KEY_Enter");
await p;
let resultMethods = resultMethodHist.snapshot();
checkHistogramResults(resultMethods,
URLBAR_SELECTED_RESULT_METHODS.rightClickEnter,
"FX_URLBAR_SELECTED_RESULT_METHOD");
TelemetryTestUtils.assertHistogram(resultMethodHist,
URLBAR_SELECTED_RESULT_METHODS.rightClickEnter, 1);
BrowserTestUtils.removeTab(tab);
});
@ -579,7 +527,7 @@ add_task(async function test_privateWindow() {
},
});
let search_hist = getAndClearKeyedHistogram("SEARCH_COUNTS");
let search_hist = TelemetryTestUtils.getAndClearKeyedHistogram("SEARCH_COUNTS");
// First, do a bunch of searches in a private window.
let win = await BrowserTestUtils.openNewBrowserWindow({ private: true });
@ -591,8 +539,8 @@ add_task(async function test_privateWindow() {
await p;
// SEARCH_COUNTS should be incremented.
checkKeyedHistogram(search_hist, "other-MozSearch.urlbar", 1);
checkKeyedHistogram(search_hist, "example.in-content:organic:none", 1);
TelemetryTestUtils.assertKeyedHistogramSum(search_hist, "other-MozSearch.urlbar", 1);
TelemetryTestUtils.assertKeyedHistogramSum(search_hist, "example.in-content:organic:none", 1);
info("Search again in a private window after setting the pref to true");
Services.prefs.setBoolPref("browser.engagement.search_counts.pbm", true);
@ -602,8 +550,8 @@ add_task(async function test_privateWindow() {
await p;
// SEARCH_COUNTS should *not* be incremented.
checkKeyedHistogram(search_hist, "other-MozSearch.urlbar", 1);
checkKeyedHistogram(search_hist, "example.in-content:organic:none", 1);
TelemetryTestUtils.assertKeyedHistogramSum(search_hist, "other-MozSearch.urlbar", 1);
TelemetryTestUtils.assertKeyedHistogramSum(search_hist, "example.in-content:organic:none", 1);
info("Search again in a private window after setting the pref to false");
Services.prefs.setBoolPref("browser.engagement.search_counts.pbm", false);
@ -613,8 +561,8 @@ add_task(async function test_privateWindow() {
await p;
// SEARCH_COUNTS should be incremented.
checkKeyedHistogram(search_hist, "other-MozSearch.urlbar", 2);
checkKeyedHistogram(search_hist, "example.in-content:organic:none", 2);
TelemetryTestUtils.assertKeyedHistogramSum(search_hist, "other-MozSearch.urlbar", 2);
TelemetryTestUtils.assertKeyedHistogramSum(search_hist, "example.in-content:organic:none", 2);
info("Search again in a private window after clearing the pref");
Services.prefs.clearUserPref("browser.engagement.search_counts.pbm");
@ -624,8 +572,8 @@ add_task(async function test_privateWindow() {
await p;
// SEARCH_COUNTS should be incremented.
checkKeyedHistogram(search_hist, "other-MozSearch.urlbar", 3);
checkKeyedHistogram(search_hist, "example.in-content:organic:none", 3);
TelemetryTestUtils.assertKeyedHistogramSum(search_hist, "other-MozSearch.urlbar", 3);
TelemetryTestUtils.assertKeyedHistogramSum(search_hist, "example.in-content:organic:none", 3);
await BrowserTestUtils.closeWindow(win);
@ -640,8 +588,8 @@ add_task(async function test_privateWindow() {
await p;
// SEARCH_COUNTS should be incremented.
checkKeyedHistogram(search_hist, "other-MozSearch.urlbar", 4);
checkKeyedHistogram(search_hist, "example.in-content:organic:none", 4);
TelemetryTestUtils.assertKeyedHistogramSum(search_hist, "other-MozSearch.urlbar", 4);
TelemetryTestUtils.assertKeyedHistogramSum(search_hist, "example.in-content:organic:none", 4);
info("Search again in a non-private window after setting the pref to true");
Services.prefs.setBoolPref("browser.engagement.search_counts.pbm", true);
@ -651,8 +599,8 @@ add_task(async function test_privateWindow() {
await p;
// SEARCH_COUNTS should be incremented.
checkKeyedHistogram(search_hist, "other-MozSearch.urlbar", 5);
checkKeyedHistogram(search_hist, "example.in-content:organic:none", 5);
TelemetryTestUtils.assertKeyedHistogramSum(search_hist, "other-MozSearch.urlbar", 5);
TelemetryTestUtils.assertKeyedHistogramSum(search_hist, "example.in-content:organic:none", 5);
info("Search again in a non-private window after setting the pref to false");
Services.prefs.setBoolPref("browser.engagement.search_counts.pbm", false);
@ -662,8 +610,8 @@ add_task(async function test_privateWindow() {
await p;
// SEARCH_COUNTS should be incremented.
checkKeyedHistogram(search_hist, "other-MozSearch.urlbar", 6);
checkKeyedHistogram(search_hist, "example.in-content:organic:none", 6);
TelemetryTestUtils.assertKeyedHistogramSum(search_hist, "other-MozSearch.urlbar", 6);
TelemetryTestUtils.assertKeyedHistogramSum(search_hist, "example.in-content:organic:none", 6);
info("Search again in a non-private window after clearing the pref");
Services.prefs.clearUserPref("browser.engagement.search_counts.pbm");
@ -673,8 +621,8 @@ add_task(async function test_privateWindow() {
await p;
// SEARCH_COUNTS should be incremented.
checkKeyedHistogram(search_hist, "other-MozSearch.urlbar", 7);
checkKeyedHistogram(search_hist, "example.in-content:organic:none", 7);
TelemetryTestUtils.assertKeyedHistogramSum(search_hist, "other-MozSearch.urlbar", 7);
TelemetryTestUtils.assertKeyedHistogramSum(search_hist, "example.in-content:organic:none", 7);
await BrowserTestUtils.closeWindow(win);

Просмотреть файл

@ -1,6 +1,8 @@
ChromeUtils.defineModuleGetter(this, "PlacesTestUtils",
"resource://testing-common/PlacesTestUtils.jsm");
ChromeUtils.defineModuleGetter(this, "TelemetryTestUtils",
"resource://testing-common/TelemetryTestUtils.jsm");
const SINGLE_TRY_TIMEOUT = 100;
const NUMBER_OF_TRIES = 30;
@ -35,49 +37,6 @@ function waitForCondition(condition, nextTest, errorMsg) {
});
}
/**
* Checks if the snapshotted keyed scalars contain the expected
* data.
*
* @param {Object} scalars
* The snapshot of the keyed scalars.
* @param {String} scalarName
* The name of the keyed scalar to check.
* @param {String} key
* The key that must be within the keyed scalar.
* @param {String|Boolean|Number} expectedValue
* The expected value for the provided key in the scalar.
*/
function checkKeyedScalar(scalars, scalarName, key, expectedValue) {
Assert.ok(scalarName in scalars,
scalarName + " must be recorded.");
Assert.ok(key in scalars[scalarName],
scalarName + " must contain the '" + key + "' key.");
Assert.equal(scalars[scalarName][key], expectedValue,
scalarName + "['" + key + "'] must contain the expected value");
}
/**
* An helper that checks the value of a scalar if it's expected to be > 0,
* otherwise makes sure that the scalar it's not reported.
*
* @param {Object} scalars
* The snapshot of the scalars.
* @param {String} scalarName
* The name of the scalar to check.
* @param {Number} value
* The expected value for the provided scalar.
* @param {String} msg
* The message to print when checking the value.
*/
let checkScalar = (scalars, scalarName, value, msg) => {
if (value > 0) {
is(scalars[scalarName], value, msg);
return;
}
ok(!(scalarName in scalars), scalarName + " must not be reported.");
};
/**
* An utility function to write some text in the search input box
* in a content page.
@ -97,74 +56,6 @@ let typeInSearchField = async function(browser, text, fieldName) {
});
};
/**
* Clear and get the named histogram
* @param {String} name
* The name of the histogram
*/
function getAndClearHistogram(name) {
let histogram = Services.telemetry.getHistogramById(name);
histogram.clear();
return histogram;
}
/**
* Clear and get the named keyed histogram
* @param {String} name
* The name of the keyed histogram
*/
function getAndClearKeyedHistogram(name) {
let histogram = Services.telemetry.getKeyedHistogramById(name);
histogram.clear();
return histogram;
}
/**
* Check that the keyed histogram contains the right value.
*/
function checkKeyedHistogram(h, key, expectedValue) {
const snapshot = h.snapshot();
if (expectedValue === undefined) {
Assert.ok(!(key in snapshot), `The histogram must not contain ${key}.`);
return;
}
Assert.ok(key in snapshot, `The histogram must contain ${key}.`);
Assert.equal(snapshot[key].sum, expectedValue, `The key ${key} must contain ${expectedValue}.`);
}
/**
* Return the scalars from the parent-process.
*/
function getParentProcessScalars(aChannel, aKeyed = false, aClear = false) {
const extended = aChannel == Ci.nsITelemetry.DATASET_RELEASE_CHANNEL_OPTIN;
const currentExtended = Services.telemetry.canRecordExtended;
Services.telemetry.canRecordExtended = extended;
const scalars = aKeyed ?
Services.telemetry.getSnapshotForKeyedScalars("main", aClear).parent :
Services.telemetry.getSnapshotForScalars("main", aClear).parent;
Services.telemetry.canRecordExtended = currentExtended;
return scalars || {};
}
function checkEvents(events, expectedEvents) {
if (!Services.telemetry.canRecordExtended) {
// Currently we only collect the tested events when extended Telemetry is enabled.
return;
}
Assert.equal(events.length, expectedEvents.length, "Should have matching amount of events.");
// Strip timestamps from the events for easier comparison.
events = events.map(e => e.slice(1));
for (let i = 0; i < events.length; ++i) {
Assert.deepEqual(events[i], expectedEvents[i], "Events should match.");
}
}
/**
* Given a <xul:browser> at some non-internal web page,
* return something that resembles an nsIContentPermissionRequest,

Просмотреть файл

@ -47,10 +47,6 @@
outline: 1px solid var(--arrowpanel-dimmed-further);
}
.downloadsPanelFooterButton > .button-box {
padding: 0;
}
@notKeyfocus@ .downloadsPanelFooterButton:-moz-focusring {
outline: none;
}

Просмотреть файл

@ -849,7 +849,8 @@ menulist[indicator=true] > menupopup menuitem[indicator=true]:not([image]) > .me
/* Proxy port input */
.proxy-port-input {
width: calc(5ch + 22px); /* 5 chars + 11px padding on both sides */
width: calc(5ch + 18px); /* 5 chars + (8px padding + 1px border) on both sides */
margin-inline-start: 4px;
}
#defaultBrowserLanguage {

Просмотреть файл

@ -1,15 +1,15 @@
{
"llvm_revision": "342383",
"llvm_revision": "349247",
"stages": "2",
"build_libcxx": true,
"build_type": "Release",
"assertions": false,
"llvm_repo": "https://llvm.org/svn/llvm-project/llvm/tags/RELEASE_700/final",
"clang_repo": "https://llvm.org/svn/llvm-project/cfe/tags/RELEASE_700/final",
"lld_repo": "https://llvm.org/svn/llvm-project/lld/tags/RELEASE_700/final",
"compiler_repo": "https://llvm.org/svn/llvm-project/compiler-rt/tags/RELEASE_700/final",
"libcxx_repo": "https://llvm.org/svn/llvm-project/libcxx/tags/RELEASE_700/final",
"libcxxabi_repo": "https://llvm.org/svn/llvm-project/libcxxabi/tags/RELEASE_700/final",
"llvm_repo": "https://llvm.org/svn/llvm-project/llvm/tags/RELEASE_701/final",
"clang_repo": "https://llvm.org/svn/llvm-project/cfe/tags/RELEASE_701/final",
"lld_repo": "https://llvm.org/svn/llvm-project/lld/tags/RELEASE_701/final",
"compiler_repo": "https://llvm.org/svn/llvm-project/compiler-rt/tags/RELEASE_701/final",
"libcxx_repo": "https://llvm.org/svn/llvm-project/libcxx/tags/RELEASE_701/final",
"libcxxabi_repo": "https://llvm.org/svn/llvm-project/libcxxabi/tags/RELEASE_701/final",
"python_path": "/usr/bin/python2.7",
"gcc_dir": "/builds/worker/workspace/build/src/gcc",
"cc": "/builds/worker/workspace/build/src/gcc/bin/gcc",

Просмотреть файл

@ -1,15 +1,15 @@
{
"llvm_revision": "342383",
"llvm_revision": "349247",
"stages": "3",
"build_libcxx": true,
"build_type": "Release",
"assertions": false,
"llvm_repo": "https://llvm.org/svn/llvm-project/llvm/tags/RELEASE_700/final",
"clang_repo": "https://llvm.org/svn/llvm-project/cfe/tags/RELEASE_700/final",
"lld_repo": "https://llvm.org/svn/llvm-project/lld/tags/RELEASE_700/final",
"compiler_repo": "https://llvm.org/svn/llvm-project/compiler-rt/tags/RELEASE_700/final",
"libcxx_repo": "https://llvm.org/svn/llvm-project/libcxx/tags/RELEASE_700/final",
"libcxxabi_repo": "https://llvm.org/svn/llvm-project/libcxxabi/tags/RELEASE_700/final",
"llvm_repo": "https://llvm.org/svn/llvm-project/llvm/tags/RELEASE_701/final",
"clang_repo": "https://llvm.org/svn/llvm-project/cfe/tags/RELEASE_701/final",
"lld_repo": "https://llvm.org/svn/llvm-project/lld/tags/RELEASE_701/final",
"compiler_repo": "https://llvm.org/svn/llvm-project/compiler-rt/tags/RELEASE_701/final",
"libcxx_repo": "https://llvm.org/svn/llvm-project/libcxx/tags/RELEASE_701/final",
"libcxxabi_repo": "https://llvm.org/svn/llvm-project/libcxxabi/tags/RELEASE_701/final",
"python_path": "/usr/bin/python2.7",
"gcc_dir": "/builds/worker/workspace/build/src/gcc",
"cc": "/builds/worker/workspace/build/src/gcc/bin/gcc",

Просмотреть файл

@ -1,16 +1,16 @@
{
"llvm_revision": "342383",
"llvm_revision": "349247",
"stages": "1",
"build_libcxx": true,
"build_type": "Release",
"assertions": false,
"osx_cross_compile": true,
"llvm_repo": "https://llvm.org/svn/llvm-project/llvm/tags/RELEASE_700/final",
"clang_repo": "https://llvm.org/svn/llvm-project/cfe/tags/RELEASE_700/final",
"lld_repo": "https://llvm.org/svn/llvm-project/lld/tags/RELEASE_700/final",
"compiler_repo": "https://llvm.org/svn/llvm-project/compiler-rt/tags/RELEASE_700/final",
"libcxx_repo": "https://llvm.org/svn/llvm-project/libcxx/tags/RELEASE_700/final",
"libcxxabi_repo": "https://llvm.org/svn/llvm-project/libcxxabi/tags/RELEASE_700/final",
"llvm_repo": "https://llvm.org/svn/llvm-project/llvm/tags/RELEASE_701/final",
"clang_repo": "https://llvm.org/svn/llvm-project/cfe/tags/RELEASE_701/final",
"lld_repo": "https://llvm.org/svn/llvm-project/lld/tags/RELEASE_701/final",
"compiler_repo": "https://llvm.org/svn/llvm-project/compiler-rt/tags/RELEASE_701/final",
"libcxx_repo": "https://llvm.org/svn/llvm-project/libcxx/tags/RELEASE_701/final",
"libcxxabi_repo": "https://llvm.org/svn/llvm-project/libcxxabi/tags/RELEASE_701/final",
"python_path": "/usr/bin/python2.7",
"gcc_dir": "/builds/worker/workspace/build/src/gcc",
"cc": "/builds/worker/workspace/build/src/clang/bin/clang",

Просмотреть файл

@ -1,15 +1,15 @@
{
"llvm_revision": "342383",
"llvm_revision": "349247",
"stages": "1",
"build_libcxx": true,
"build_type": "Release",
"assertions": false,
"build_clang_tidy": true,
"llvm_repo": "https://llvm.org/svn/llvm-project/llvm/tags/RELEASE_700/final/",
"clang_repo": "https://llvm.org/svn/llvm-project/cfe/tags/RELEASE_700/final/",
"extra_repo": "https://llvm.org/svn/llvm-project/clang-tools-extra/tags/RELEASE_700/final/",
"libcxx_repo": "https://llvm.org/svn/llvm-project/libcxx/tags/RELEASE_700/final/",
"libcxxabi_repo": "https://llvm.org/svn/llvm-project/libcxxabi/tags/RELEASE_700/final/",
"llvm_repo": "https://llvm.org/svn/llvm-project/llvm/tags/RELEASE_701/final/",
"clang_repo": "https://llvm.org/svn/llvm-project/cfe/tags/RELEASE_701/final/",
"extra_repo": "https://llvm.org/svn/llvm-project/clang-tools-extra/tags/RELEASE_701/final/",
"libcxx_repo": "https://llvm.org/svn/llvm-project/libcxx/tags/RELEASE_701/final/",
"libcxxabi_repo": "https://llvm.org/svn/llvm-project/libcxxabi/tags/RELEASE_701/final/",
"python_path": "/usr/bin/python2.7",
"gcc_dir": "/builds/worker/workspace/build/src/gcc",
"cc": "/builds/worker/workspace/build/src/gcc/bin/gcc",

Просмотреть файл

@ -1,16 +1,16 @@
{
"llvm_revision": "342383",
"llvm_revision": "349247",
"stages": "1",
"build_libcxx": true,
"build_type": "Release",
"assertions": false,
"build_clang_tidy": true,
"osx_cross_compile": true,
"llvm_repo": "https://llvm.org/svn/llvm-project/llvm/tags/RELEASE_700/final",
"clang_repo": "https://llvm.org/svn/llvm-project/cfe/tags/RELEASE_700/final",
"extra_repo": "https://llvm.org/svn/llvm-project/clang-tools-extra/tags/RELEASE_700/final",
"libcxx_repo": "https://llvm.org/svn/llvm-project/libcxx/tags/RELEASE_700/final",
"libcxxabi_repo": "https://llvm.org/svn/llvm-project/libcxxabi/tags/RELEASE_700/final",
"llvm_repo": "https://llvm.org/svn/llvm-project/llvm/tags/RELEASE_701/final",
"clang_repo": "https://llvm.org/svn/llvm-project/cfe/tags/RELEASE_701/final",
"extra_repo": "https://llvm.org/svn/llvm-project/clang-tools-extra/tags/RELEASE_701/final",
"libcxx_repo": "https://llvm.org/svn/llvm-project/libcxx/tags/RELEASE_701/final",
"libcxxabi_repo": "https://llvm.org/svn/llvm-project/libcxxabi/tags/RELEASE_701/final",
"python_path": "/usr/bin/python2.7",
"gcc_dir": "/builds/worker/workspace/build/src/gcc",
"cc": "/builds/worker/workspace/build/src/clang/bin/clang",

Просмотреть файл

@ -1,15 +1,15 @@
{
"llvm_revision": "342383",
"llvm_revision": "349247",
"stages": "1",
"build_libcxx": false,
"build_type": "Release",
"assertions": false,
"build_clang_tidy": true,
"llvm_repo": "https://llvm.org/svn/llvm-project/llvm/tags/RELEASE_700/final",
"clang_repo": "https://llvm.org/svn/llvm-project/cfe/tags/RELEASE_700/final",
"extra_repo": "https://llvm.org/svn/llvm-project/clang-tools-extra/tags/RELEASE_700/final",
"compiler_repo": "https://llvm.org/svn/llvm-project/compiler-rt/tags/RELEASE_700/final",
"libcxx_repo": "https://llvm.org/svn/llvm-project/libcxx/tags/RELEASE_700/final",
"llvm_repo": "https://llvm.org/svn/llvm-project/llvm/tags/RELEASE_701/final",
"clang_repo": "https://llvm.org/svn/llvm-project/cfe/tags/RELEASE_701/final",
"extra_repo": "https://llvm.org/svn/llvm-project/clang-tools-extra/tags/RELEASE_701/final",
"compiler_repo": "https://llvm.org/svn/llvm-project/compiler-rt/tags/RELEASE_701/final",
"libcxx_repo": "https://llvm.org/svn/llvm-project/libcxx/tags/RELEASE_701/final",
"python_path": "c:/mozilla-build/python/python.exe",
"cc": "cl.exe",
"cxx": "cl.exe",

Просмотреть файл

@ -1,15 +1,15 @@
{
"llvm_revision": "342383",
"llvm_revision": "349247",
"stages": "1",
"build_libcxx": false,
"build_type": "Release",
"assertions": false,
"build_clang_tidy": true,
"llvm_repo": "https://llvm.org/svn/llvm-project/llvm/tags/RELEASE_700/final",
"clang_repo": "https://llvm.org/svn/llvm-project/cfe/tags/RELEASE_700/final",
"extra_repo": "https://llvm.org/svn/llvm-project/clang-tools-extra/tags/RELEASE_700/final",
"compiler_repo": "https://llvm.org/svn/llvm-project/compiler-rt/tags/RELEASE_700/final",
"libcxx_repo": "https://llvm.org/svn/llvm-project/libcxx/tags/RELEASE_700/final",
"llvm_repo": "https://llvm.org/svn/llvm-project/llvm/tags/RELEASE_701/final",
"clang_repo": "https://llvm.org/svn/llvm-project/cfe/tags/RELEASE_701/final",
"extra_repo": "https://llvm.org/svn/llvm-project/clang-tools-extra/tags/RELEASE_701/final",
"compiler_repo": "https://llvm.org/svn/llvm-project/compiler-rt/tags/RELEASE_701/final",
"libcxx_repo": "https://llvm.org/svn/llvm-project/libcxx/tags/RELEASE_701/final",
"python_path": "c:/mozilla-build/python/python.exe",
"cc": "cl.exe",
"cxx": "cl.exe",

Просмотреть файл

@ -1,14 +1,14 @@
{
"llvm_revision": "342383",
"llvm_revision": "349247",
"stages": "3",
"build_libcxx": false,
"build_type": "Release",
"assertions": false,
"llvm_repo": "https://llvm.org/svn/llvm-project/llvm/tags/RELEASE_700/final",
"clang_repo": "https://llvm.org/svn/llvm-project/cfe/tags/RELEASE_700/final",
"lld_repo": "https://llvm.org/svn/llvm-project/lld/tags/RELEASE_700/final",
"compiler_repo": "https://llvm.org/svn/llvm-project/compiler-rt/tags/RELEASE_700/final",
"libcxx_repo": "https://llvm.org/svn/llvm-project/libcxx/tags/RELEASE_700/final",
"llvm_repo": "https://llvm.org/svn/llvm-project/llvm/tags/RELEASE_701/final",
"clang_repo": "https://llvm.org/svn/llvm-project/cfe/tags/RELEASE_701/final",
"lld_repo": "https://llvm.org/svn/llvm-project/lld/tags/RELEASE_701/final",
"compiler_repo": "https://llvm.org/svn/llvm-project/compiler-rt/tags/RELEASE_701/final",
"libcxx_repo": "https://llvm.org/svn/llvm-project/libcxx/tags/RELEASE_701/final",
"python_path": "c:/mozilla-build/python/python.exe",
"cc": "cl.exe",
"cxx": "cl.exe",

Просмотреть файл

@ -32,12 +32,6 @@ const {
removeUSBRuntimesObserver,
} = require("./src/modules/usb-runtimes");
const {
addMultiE10sListener,
isMultiE10s,
removeMultiE10sListener,
} = require("devtools/client/shared/multi-e10s-helper");
loader.lazyRequireGetter(this, "adbAddon", "devtools/shared/adb/adb-addon", true);
const Router = createFactory(require("devtools/client/shared/vendor/react-router-dom").HashRouter);
@ -54,7 +48,6 @@ const AboutDebugging = {
this.onAdbAddonUpdated = this.onAdbAddonUpdated.bind(this);
this.onNetworkLocationsUpdated = this.onNetworkLocationsUpdated.bind(this);
this.onUSBRuntimesUpdated = this.onUSBRuntimesUpdated.bind(this);
this.onMultiE10sUpdated = this.onMultiE10sUpdated.bind(this);
this.store = configureStore();
this.actions = bindActionCreators(actions, this.store.dispatch);
@ -90,12 +83,6 @@ const AboutDebugging = {
// Remove deprecated remote debugging extensions.
await adbAddon.uninstallUnsupportedExtensions();
addMultiE10sListener(this.onMultiE10sUpdated);
},
onMultiE10sUpdated() {
this.actions.updateMultiE10sStatus(isMultiE10s());
},
onAdbAddonUpdated() {
@ -123,7 +110,6 @@ const AboutDebugging = {
// Remove all client listeners.
this.actions.removeRuntimeListeners();
removeMultiE10sListener(this.onMultiE10sUpdated);
removeNetworkLocationsObserver(this.onNetworkLocationsUpdated);
removeUSBRuntimesObserver(this.onUSBRuntimesUpdated);
adbAddon.off("update", this.onAdbAddonUpdated);

Просмотреть файл

@ -35,6 +35,9 @@ const {
UPDATE_CONNECTION_PROMPT_SETTING_FAILURE,
UPDATE_CONNECTION_PROMPT_SETTING_START,
UPDATE_CONNECTION_PROMPT_SETTING_SUCCESS,
UPDATE_RUNTIME_MULTIE10S_FAILURE,
UPDATE_RUNTIME_MULTIE10S_START,
UPDATE_RUNTIME_MULTIE10S_SUCCESS,
WATCH_RUNTIME_FAILURE,
WATCH_RUNTIME_START,
WATCH_RUNTIME_SUCCESS,
@ -42,7 +45,7 @@ const {
async function getRuntimeInfo(runtime, clientWrapper) {
const { type } = runtime;
const { name, channel, deviceName, version } =
const { name, channel, deviceName, isMultiE10s, version } =
await clientWrapper.getDeviceDescription();
const icon =
(channel === "release" || channel === "beta" || channel === "aurora")
@ -50,8 +53,9 @@ async function getRuntimeInfo(runtime, clientWrapper) {
: "chrome://devtools/skin/images/aboutdebugging-firefox-nightly.svg";
return {
icon,
deviceName,
icon,
isMultiE10s,
name,
type,
version,
@ -65,6 +69,10 @@ function onUSBDebuggerClientClosed() {
window.AboutDebugging.store.dispatch(Actions.scanUSBRuntimes());
}
function onMultiE10sUpdated() {
window.AboutDebugging.store.dispatch(updateMultiE10s());
}
function connectRuntime(id) {
return async (dispatch, getState) => {
dispatch({ type: CONNECT_RUNTIME_START });
@ -72,6 +80,8 @@ function connectRuntime(id) {
const runtime = findRuntimeById(id, getState().runtimes);
const clientWrapper = await createClientForRuntime(runtime);
const info = await getRuntimeInfo(runtime, clientWrapper);
const { isMultiE10s } = info;
delete info.isMultiE10s;
const promptPrefName = RUNTIME_PREFERENCE.CONNECTION_PROMPT;
const connectionPromptEnabled = await clientWrapper.getPreference(promptPrefName);
@ -79,8 +89,16 @@ function connectRuntime(id) {
clientWrapper,
connectionPromptEnabled,
info,
isMultiE10s,
};
clientWrapper.addListener("closed", onUSBDebuggerClientClosed);
const deviceFront = await clientWrapper.getFront("device");
if (deviceFront) {
deviceFront.on("multi-e10s-updated", onMultiE10sUpdated);
}
if (runtime.type === RUNTIMES.USB) {
// `closed` event will be emitted when disabling remote debugging
// on the connected USB runtime.
@ -108,6 +126,11 @@ function disconnectRuntime(id) {
const runtime = findRuntimeById(id, getState().runtimes);
const { clientWrapper } = runtime.runtimeDetails;
const deviceFront = await clientWrapper.getFront("device");
if (deviceFront) {
deviceFront.off("multi-e10s-updated", onMultiE10sUpdated);
}
if (runtime.type === RUNTIMES.USB) {
clientWrapper.removeListener("closed", onUSBDebuggerClientClosed);
}
@ -146,6 +169,22 @@ function updateConnectionPromptSetting(connectionPromptEnabled) {
};
}
function updateMultiE10s() {
return async (dispatch, getState) => {
dispatch({ type: UPDATE_RUNTIME_MULTIE10S_START });
try {
const runtime = getCurrentRuntime(getState().runtimes);
const { clientWrapper } = runtime.runtimeDetails;
// Re-get actual value from the runtime.
const { isMultiE10s } = await clientWrapper.getDeviceDescription();
dispatch({ type: UPDATE_RUNTIME_MULTIE10S_SUCCESS, runtime, isMultiE10s });
} catch (e) {
dispatch({ type: UPDATE_RUNTIME_MULTIE10S_FAILURE, error: e });
}
};
}
function watchRuntime(id) {
return async (dispatch, getState) => {
dispatch({ type: WATCH_RUNTIME_START });

Просмотреть файл

@ -13,7 +13,6 @@ const {
ADB_ADDON_UNINSTALL_FAILURE,
ADB_ADDON_STATUS_UPDATED,
DEBUG_TARGET_COLLAPSIBILITY_UPDATED,
MULTI_E10S_UPDATED,
NETWORK_LOCATIONS_UPDATED,
PAGE_SELECTED,
PAGE_TYPES,
@ -127,12 +126,6 @@ function scanUSBRuntimes() {
};
}
function updateMultiE10sStatus(isMultiE10s) {
return (dispatch, getState) => {
dispatch({ type: MULTI_E10S_UPDATED, isMultiE10s});
};
}
module.exports = {
addNetworkLocation,
installAdbAddon,
@ -142,6 +135,5 @@ module.exports = {
uninstallAdbAddon,
updateAdbAddonStatus,
updateDebugTargetCollapsibility,
updateMultiE10sStatus,
updateNetworkLocations,
};

Просмотреть файл

@ -11,6 +11,8 @@ const { connect } = require("devtools/client/shared/vendor/react-redux");
const FluentReact = require("devtools/client/shared/vendor/fluent-react");
const { getCurrentRuntimeDetails } = require("../../modules/runtimes-state-helper");
const InspectAction = createFactory(require("./InspectAction"));
const Actions = require("../../actions/index");
@ -26,7 +28,7 @@ class ServiceWorkerAction extends PureComponent {
// Provided by wrapping the component with FluentReact.withLocalization.
getString: PropTypes.func.isRequired,
// Provided by redux state
isMultiE10s: PropTypes.bool.isRequired,
runtimeDetails: Types.runtimeDetails.isRequired,
target: Types.debugTarget.isRequired,
};
}
@ -42,8 +44,9 @@ class ServiceWorkerAction extends PureComponent {
}
_renderAction() {
const { dispatch, isMultiE10s, target } = this.props;
const { dispatch, runtimeDetails, target } = this.props;
const { isActive, isRunning } = target.details;
const { isMultiE10s } = runtimeDetails;
if (!isRunning) {
const startLabel = this.props.getString("about-debugging-worker-action-start");
@ -95,7 +98,7 @@ class ServiceWorkerAction extends PureComponent {
const mapStateToProps = state => {
return {
isMultiE10s: state.ui.isMultiE10s,
runtimeDetails: getCurrentRuntimeDetails(state.runtimes),
};
};

Просмотреть файл

@ -19,7 +19,6 @@ const actionTypes = {
DISCONNECT_RUNTIME_FAILURE: "DISCONNECT_RUNTIME_FAILURE",
DISCONNECT_RUNTIME_START: "DISCONNECT_RUNTIME_START",
DISCONNECT_RUNTIME_SUCCESS: "DISCONNECT_RUNTIME_SUCCESS",
MULTI_E10S_UPDATED: "MULTI_E10S_UPDATED",
NETWORK_LOCATIONS_UPDATED: "NETWORK_LOCATIONS_UPDATED",
PAGE_SELECTED: "PAGE_SELECTED",
REMOTE_RUNTIMES_UPDATED: "REMOTE_RUNTIMES_UPDATED",
@ -41,6 +40,9 @@ const actionTypes = {
UPDATE_CONNECTION_PROMPT_SETTING_FAILURE: "UPDATE_CONNECTION_PROMPT_SETTING_FAILURE",
UPDATE_CONNECTION_PROMPT_SETTING_START: "UPDATE_CONNECTION_PROMPT_SETTING_START",
UPDATE_CONNECTION_PROMPT_SETTING_SUCCESS: "UPDATE_CONNECTION_PROMPT_SETTING_SUCCESS",
UPDATE_RUNTIME_MULTIE10S_FAILURE: "UPDATE_RUNTIME_MULTIE10S_FAILURE",
UPDATE_RUNTIME_MULTIE10S_START: "UPDATE_RUNTIME_MULTIE10S_START",
UPDATE_RUNTIME_MULTIE10S_SUCCESS: "UPDATE_RUNTIME_MULTIE10S_SUCCESS",
USB_RUNTIMES_SCAN_START: "USB_RUNTIMES_SCAN_START",
USB_RUNTIMES_SCAN_SUCCESS: "USB_RUNTIMES_SCAN_SUCCESS",
WATCH_RUNTIME_FAILURE: "WATCH_RUNTIME_FAILURE",

Просмотреть файл

@ -9,7 +9,6 @@ const Services = require("Services");
const { applyMiddleware, createStore } = require("devtools/client/shared/vendor/redux");
const { thunk } = require("devtools/client/shared/redux/middleware/thunk.js");
const { waitUntilService } = require("devtools/client/shared/redux/middleware/wait-service.js");
const { isMultiE10s } = require("devtools/client/shared/multi-e10s-helper");
const rootReducer = require("./reducers/index");
const { DebugTargetsState } = require("./reducers/debug-targets-state");
@ -51,7 +50,7 @@ function getUiState() {
const showSystemAddons = Services.prefs.getBoolPref(PREFERENCES.SHOW_SYSTEM_ADDONS,
false);
return new UiState(locations, collapsibilities, networkEnabled, wifiEnabled,
showSystemAddons, isMultiE10s());
showSystemAddons);
}
exports.configureStore = configureStore;

Просмотреть файл

@ -59,18 +59,23 @@ class ClientWrapper {
}
}
async getFront(typeName) {
return this.client.mainRoot.getFront(typeName);
}
onFront(typeName, listener) {
this.client.mainRoot.onFront(typeName, listener);
}
async getDeviceDescription() {
const deviceFront = await this.client.mainRoot.getFront("device");
const { brandName, channel, deviceName, version } =
const deviceFront = await this.getFront("device");
const { brandName, channel, deviceName, isMultiE10s, version } =
await deviceFront.getDescription();
// Only expose a specific set of properties.
return {
channel,
deviceName,
isMultiE10s,
name: brandName,
version,
};

Просмотреть файл

@ -14,14 +14,11 @@ const ALL_DEBUG_TARGETS = [
const SUPPORTED_TARGET_BY_RUNTIME = {
[RUNTIMES.THIS_FIREFOX]: ALL_DEBUG_TARGETS,
[RUNTIMES.NETWORK]: ALL_DEBUG_TARGETS,
[RUNTIMES.USB]: [
DEBUG_TARGETS.EXTENSION,
DEBUG_TARGETS.TAB,
],
[RUNTIMES.NETWORK]: [
DEBUG_TARGETS.EXTENSION,
DEBUG_TARGETS.TAB,
],
};
function isSupportedDebugTarget(runtimeType, debugTargetType) {
@ -44,10 +41,9 @@ const SUPPORTED_TARGET_PANE_BY_RUNTIME = {
DEBUG_TARGET_PANE.INSTALLED_EXTENSION,
DEBUG_TARGET_PANE.TAB,
],
[RUNTIMES.NETWORK]: [
DEBUG_TARGET_PANE.INSTALLED_EXTENSION,
DEBUG_TARGET_PANE.TAB,
],
// All debug target panes except temporary extensions
[RUNTIMES.NETWORK]: ALL_DEBUG_TARGET_PANES.filter(p =>
p !== DEBUG_TARGET_PANE.TEMPORARY_EXTENSION),
};
/**

Просмотреть файл

@ -46,3 +46,4 @@ function getCurrentRuntimeDetails(runtimesState) {
const runtime = getCurrentRuntime(runtimesState);
return runtime ? runtime.runtimeDetails : null;
}
exports.getCurrentRuntimeDetails = getCurrentRuntimeDetails;

Просмотреть файл

@ -10,6 +10,7 @@ const {
RUNTIMES,
UNWATCH_RUNTIME_SUCCESS,
UPDATE_CONNECTION_PROMPT_SETTING_SUCCESS,
UPDATE_RUNTIME_MULTIE10S_SUCCESS,
REMOTE_RUNTIMES_UPDATED,
WATCH_RUNTIME_SUCCESS,
} = require("../constants");
@ -97,6 +98,15 @@ function runtimesReducer(state = RuntimesState(), action) {
return _updateRuntimeById(runtimeId, { runtimeDetails }, state);
}
case UPDATE_RUNTIME_MULTIE10S_SUCCESS: {
const { isMultiE10s } = action;
const { id: runtimeId } = action.runtime;
const runtime = findRuntimeById(runtimeId, state);
const runtimeDetails =
Object.assign({}, runtime.runtimeDetails, { isMultiE10s });
return _updateRuntimeById(runtimeId, { runtimeDetails }, state);
}
case REMOTE_RUNTIMES_UPDATED: {
const { runtimes, runtimeType } = action;
const key = TYPE_TO_RUNTIMES_KEY[runtimeType];

Просмотреть файл

@ -7,7 +7,6 @@
const {
ADB_ADDON_STATUS_UPDATED,
DEBUG_TARGET_COLLAPSIBILITY_UPDATED,
MULTI_E10S_UPDATED,
NETWORK_LOCATIONS_UPDATED,
PAGE_SELECTED,
TEMPORARY_EXTENSION_INSTALL_FAILURE,
@ -18,11 +17,10 @@ const {
function UiState(locations = [], debugTargetCollapsibilities = {},
networkEnabled = false, wifiEnabled = false,
showSystemAddons = false, isMultiE10s = false) {
showSystemAddons = false) {
return {
adbAddonStatus: null,
debugTargetCollapsibilities,
isMultiE10s,
isScanningUsb: false,
networkEnabled,
networkLocations: locations,
@ -48,11 +46,6 @@ function uiReducer(state = UiState(), action) {
return Object.assign({}, state, { debugTargetCollapsibilities });
}
case MULTI_E10S_UPDATED: {
const { isMultiE10s } = action;
return Object.assign({}, state, { isMultiE10s });
}
case NETWORK_LOCATIONS_UPDATED: {
const { locations } = action;
return Object.assign({}, state, { networkLocations: locations });

Просмотреть файл

@ -5,9 +5,10 @@
"use strict";
const { debugTarget } = require("./debug-target");
const { runtime } = require("./runtime");
const { runtime, runtimeDetails } = require("./runtime");
module.exports = Object.assign({}, {
debugTarget,
runtime,
runtimeDetails,
});

Просмотреть файл

@ -31,7 +31,12 @@ const runtimeDetails = {
// runtime information
info: PropTypes.shape(runtimeInfo).isRequired,
// True if this runtime supports multiple content processes
// This might be undefined when connecting to runtimes older than Fx 66
isMultiE10s: PropTypes.bool,
};
exports.runtimeDetails = PropTypes.shape(runtimeDetails);
const networkRuntimeConnectionParameter = {
// host name of debugger server to connect

Просмотреть файл

@ -60,3 +60,4 @@ skip-if = (os == 'linux' && bits == 32) # ADB start() fails on linux 32, see Bug
[browser_aboutdebugging_thisfirefox.js]
[browser_aboutdebugging_thisfirefox_runtime_info.js]
[browser_aboutdebugging_thisfirefox_worker_inspection.js]
[browser_aboutdebugging_workers_remote_runtime.js]

Просмотреть файл

@ -0,0 +1,111 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
/* import-globals-from helper-mocks.js */
Services.scriptloader.loadSubScript(CHROME_URL_ROOT + "helper-mocks.js", this);
const NETWORK_RUNTIME_HOST = "localhost:6080";
const NETWORK_RUNTIME_APP_NAME = "TestNetworkApp";
const TESTS = [
{
category: "Other Workers",
propertyName: "otherWorkers",
workerName: "other/worker/script.js",
}, {
category: "Service Workers",
propertyName: "serviceWorkers",
workerName: "service/worker/script.js",
}, {
category: "Shared Workers",
propertyName: "sharedWorkers",
workerName: "shared/worker/script.js",
},
];
const EMPTY_WORKERS_RESPONSE = {
otherWorkers: [],
serviceWorkers: [],
sharedWorkers: [],
};
// Test that workers are displayed and updated for remote runtimes when expected.
add_task(async function() {
const mocks = new Mocks();
const { document, tab } = await openAboutDebugging();
info("Prepare Network client mock");
const networkClient = mocks.createNetworkRuntime(NETWORK_RUNTIME_HOST, {
name: NETWORK_RUNTIME_APP_NAME,
});
info("Test workers in runtime page for Network client");
await connectToRuntime(NETWORK_RUNTIME_HOST, document);
await selectRuntime(NETWORK_RUNTIME_HOST, NETWORK_RUNTIME_APP_NAME, document);
for (const testData of TESTS) {
await testWorkerOnMockedRemoteClient(testData, networkClient, mocks.thisFirefoxClient,
document);
}
await removeTab(tab);
});
/**
* Check that workers are visible in the runtime page for a remote client.
*/
async function testWorkerOnMockedRemoteClient(testData, remoteClient, firefoxClient,
document) {
const { category, propertyName, workerName } = testData;
info(`Test workers for category [${category}] in remote runtime`);
const workersPane = getDebugTargetPane(category, document);
info("Check an empty target pane message is displayed");
ok(workersPane.querySelector(".js-debug-target-list-empty"),
"Workers list is empty");
info(`Add a worker of type [${propertyName}] to the remote client`);
const workers = Object.assign({}, EMPTY_WORKERS_RESPONSE, {
[propertyName]: [{
name: workerName,
workerTargetFront: {
actorID: workerName,
},
}],
});
remoteClient.listWorkers = () => workers;
remoteClient._eventEmitter.emit("workerListChanged");
info("Wait until the worker appears");
await waitUntil(() => !workersPane.querySelector(".js-debug-target-list-empty"));
const workerTarget = findDebugTargetByText(workerName, document);
ok(workerTarget, "Worker target appeared for the remote runtime");
// Check that the list of REMOTE workers are NOT updated when the local this-firefox
// emits a workerListChanged event.
info("Remove the worker from the remote client WITHOUT sending an event");
remoteClient.listWorkers = () => EMPTY_WORKERS_RESPONSE;
info("Simulate a worker update on the ThisFirefox client");
firefoxClient._eventEmitter.emit("workerListChanged");
// To avoid wait for a set period of time we trigger another async update, adding a new
// tab. We assume that if the worker update mechanism had started, it would also be done
// when the new tab was processed.
info("Wait until the tab target for 'http://some.random/url.com' appears");
const testTab = { outerWindowID: 0, url: "http://some.random/url.com" };
remoteClient.listTabs = () => [testTab];
remoteClient._eventEmitter.emit("tabListChanged");
await waitUntil(() => findDebugTargetByText("http://some.random/url.com", document));
ok(findDebugTargetByText(workerName, document),
"The test worker is still visible");
info("Emit `workerListChanged` on remoteClient and wait for the target list to update");
remoteClient._eventEmitter.emit("workerListChanged");
await waitUntil(() => !findDebugTargetByText(workerName, document));
}

Просмотреть файл

@ -76,6 +76,8 @@ function createClientMock() {
sharedWorkers: [],
}),
// no-op
getFront: () => {},
// no-op
onFront: () => {},
// stores the preference locally (doesn't update about:config)
setPreference: function(prefName, value) {

Просмотреть файл

@ -15,7 +15,7 @@ const {
addMultiE10sListener,
isMultiE10s,
removeMultiE10sListener,
} = require("devtools/client/shared/multi-e10s-helper");
} = require("devtools/shared/multi-e10s-helper");
const PanelHeader = createFactory(require("../PanelHeader"));
const TargetList = createFactory(require("../TargetList"));

Просмотреть файл

@ -20,7 +20,10 @@ const CONTAINER_WIDTH = 270;
class SettingOnboardingTooltip {
constructor(doc) {
this.doc = doc;
this.tooltip = new HTMLTooltip(this.doc, { type: "arrow" });
this.tooltip = new HTMLTooltip(this.doc, {
consumeOutsideClicks: false,
type: "arrow",
});
this.onCloseButtonClick = this.onCloseButtonClick.bind(this);

Просмотреть файл

@ -37,7 +37,6 @@ DevToolsModules(
'key-shortcuts.js',
'keycodes.js',
'link.js',
'multi-e10s-helper.js',
'natural-sort.js',
'node-attribute-parser.js',
'options-view.js',

Просмотреть файл

@ -8,6 +8,12 @@ const {Ci, Cc} = require("chrome");
const Services = require("Services");
const protocol = require("devtools/shared/protocol");
const {LongStringActor} = require("devtools/server/actors/string");
const {
addMultiE10sListener,
isMultiE10s,
removeMultiE10sListener,
} = require("devtools/shared/multi-e10s-helper");
const {DebuggerServer} = require("devtools/server/main");
const {getSystemInfo} = require("devtools/shared/system");
const {deviceSpec} = require("devtools/shared/specs/device");
@ -23,6 +29,9 @@ exports.DeviceActor = protocol.ActorClassWithSpec(deviceSpec, {
this._window.addEventListener("pageshow", this._onPageShow, true);
}
this._acquireWakeLock();
this._onMultiE10sUpdated = this._onMultiE10sUpdated.bind(this);
addMultiE10sListener(this._onMultiE10sUpdated);
},
destroy: function() {
@ -31,10 +40,15 @@ exports.DeviceActor = protocol.ActorClassWithSpec(deviceSpec, {
if (this._window) {
this._window.removeEventListener("pageshow", this._onPageShow, true);
}
removeMultiE10sListener(this._onMultiE10sUpdated);
},
_onMultiE10sUpdated: function() {
this.emit("multi-e10s-updated", isMultiE10s());
},
getDescription: function() {
return getSystemInfo();
return Object.assign({}, getSystemInfo(), { isMultiE10s: isMultiE10s() });
},
screenshotToDataURL: function() {

Просмотреть файл

@ -65,6 +65,7 @@ DevToolsModules(
'l10n.js',
'loader-plugin-raw.jsm',
'Loader.jsm',
'multi-e10s-helper.js',
'Parser.jsm',
'path.js',
'plural-form.js',

Просмотреть файл

@ -3,11 +3,17 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
const {RetVal, generateActorSpec} = require("devtools/shared/protocol");
const { Arg, RetVal, generateActorSpec } = require("devtools/shared/protocol");
const deviceSpec = generateActorSpec({
typeName: "device",
events: {
"multi-e10s-updated": {
type: "multi-e10s-updated",
isMultiE10s: Arg(0, "boolean"),
},
},
methods: {
getDescription: {request: {}, response: { value: RetVal("json")}},
screenshotToDataURL: {request: {}, response: { value: RetVal("longstring")}},

Просмотреть файл

@ -35,7 +35,7 @@ const APP_MAP = {
var CACHED_INFO = null;
async function getSystemInfo() {
function getSystemInfo() {
if (CACHED_INFO) {
return CACHED_INFO;
}

Просмотреть файл

@ -1,12 +0,0 @@
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
xmlns:html="http://www.w3.org/1999/xhtml"
title="Textbox tests">
<script type="text/javascript" src="platform.js"/>
<textbox type="number"/>
</window>

Просмотреть файл

@ -1,12 +0,0 @@
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
xmlns:html="http://www.w3.org/1999/xhtml"
title="Textbox tests">
<script type="text/javascript" src="platform.js"/>
<textbox type="number"/>
</window>

Просмотреть файл

@ -1,12 +0,0 @@
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
xmlns:html="http://www.w3.org/1999/xhtml"
title="Textbox tests">
<script type="text/javascript" src="platform.js"/>
<textbox type="number" hidespinbuttons="false"/>
</window>

Просмотреть файл

@ -1,12 +0,0 @@
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
xmlns:html="http://www.w3.org/1999/xhtml"
title="Textbox tests">
<script type="text/javascript" src="platform.js"/>
<textbox type="number" hidespinbuttons="true"/>
</window>

Просмотреть файл

@ -1,12 +0,0 @@
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
xmlns:html="http://www.w3.org/1999/xhtml"
title="Textbox tests">
<script type="text/javascript" src="platform.js"/>
<textbox type="number" value="1" hidespinbuttons="true"/>
</window>

Просмотреть файл

@ -1,12 +0,0 @@
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
xmlns:html="http://www.w3.org/1999/xhtml"
title="Textbox tests">
<script type="text/javascript" src="platform.js"/>
<textbox type="number" value="test" hidespinbuttons="true"/>
</window>

Просмотреть файл

@ -1,13 +0,0 @@
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
<?xml-stylesheet href="resource://reftest/input.css" type="text/css"?>
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
xmlns:html="http://www.w3.org/1999/xhtml"
title="Textbox tests">
<script type="text/javascript" src="platform.js"/>
<html:input value="0" class="num"/>
</window>

Просмотреть файл

@ -1,12 +0,0 @@
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
xmlns:html="http://www.w3.org/1999/xhtml"
title="Textbox tests">
<script type="text/javascript" src="platform.js"/>
<textbox type="number" value="123" hidespinbuttons="true"/>
</window>

Просмотреть файл

@ -1,13 +0,0 @@
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
<?xml-stylesheet href="resource://reftest/input.css" type="text/css"?>
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
xmlns:html="http://www.w3.org/1999/xhtml"
title="Textbox tests">
<script type="text/javascript" src="platform.js"/>
<html:input value="123" class="num"/>
</window>

Просмотреть файл

@ -8,16 +8,7 @@ fails-if(Android) fails-if(windowsDefaultTheme&&/^Windows\x20NT\x20(5\.[12]|6\.[
fails-if(Android) == emptymultiline-2.xul emptymultiline-ref.xul # bug 783658
fails-if(Android) skip-if(winWidget) == emptytextbox-1.xul emptytextbox-ref.xul # Windows: bug 1239170
fails-if(Android) skip-if(winWidget) == emptytextbox-2.xul emptytextbox-ref.xul # Windows: bug 1239170
!= emptytextbox-3.xul emptytextbox-ref.xul
!= emptytextbox-4.xul emptytextbox-ref.xul
# There is no way to simulate a number textbox in windows XP/Vista/7 default theme using CSS.
# Therefore, the equlity tests below should be marked as failing.
!= number-1.xul number-ref.xul
!= number-2.xul number-ref.xul
fuzzy-if(webrender,0-205,0-7) fails-if(Android) fails-if(windowsDefaultTheme&&/^Windows\x20NT\x20(5\.[12]|6\.[012]|10\.0)/.test(http.oscpu)) == number-3.xul number-ref.xul # bug 783658
!= number-4.xul number-ref.xul
fuzzy-if(webrender,0-205,0-7) fails-if(Android) fails-if(windowsDefaultTheme&&/^Windows\x20NT\x20(5\.[12]|6\.[012]|10\.0)/.test(http.oscpu)) == number-5.xul number-ref.xul # bug 783658
fuzzy-if(webrender,0-255,0-7) fails-if(Android) fails-if(windowsDefaultTheme&&/^Windows\x20NT\x20(5\.[12]|6\.[012]|10\.0)/.test(http.oscpu)) == numberwithvalue-1.xul numberwithvalue-ref.xul # bug 783658
fails-if(Android) skip-if(winWidget) == passwd-1.xul passwd-ref.xul # Windows: bug 1239170
fails-if(Android) skip-if(winWidget) == passwd-2.xul passwd-ref.xul # Windows: bug 1239170
!= passwd-3.xul passwd-ref.xul

Просмотреть файл

@ -1004,6 +1004,9 @@ bool AsyncCompositionManager::ApplyAsyncContentTransformToTree(
if (RefPtr<UiCompositorControllerParent> uiController =
UiCompositorControllerParent::
GetFromRootLayerTreeId(rootLayerTreeId)) {
if (!animator) {
uiController->NotifyUpdateScreenMetrics(metrics);
}
uiController->NotifyFirstPaint();
}
mIsFirstPaint = false;

Просмотреть файл

@ -16,6 +16,8 @@
#include "mozilla/Move.h"
#include "mozilla/Unused.h"
#include "FrameMetrics.h"
namespace mozilla {
namespace layers {
@ -240,6 +242,21 @@ void UiCompositorControllerParent::NotifyFirstPaint() {
ToolbarAnimatorMessageFromCompositor(FIRST_PAINT);
}
void UiCompositorControllerParent::NotifyUpdateScreenMetrics(
const FrameMetrics& aMetrics) {
#if defined(MOZ_WIDGET_ANDROID)
CSSToScreenScale scale = ViewTargetAs<ScreenPixel>(
aMetrics.GetZoom().ToScaleFactor(),
PixelCastJustification::ScreenIsParentLayerForRoot);
ScreenPoint scrollOffset = aMetrics.GetScrollOffset() * scale;
CompositorThreadHolder::Loop()->PostTask(
NewRunnableMethod<ScreenPoint, CSSToScreenScale>(
"UiCompositorControllerParent::SendRootFrameMetrics", this,
&UiCompositorControllerParent::SendRootFrameMetrics, scrollOffset,
scale));
#endif
}
UiCompositorControllerParent::UiCompositorControllerParent(
const LayersId& aRootLayerTreeId)
: mRootLayerTreeId(aRootLayerTreeId)

Просмотреть файл

@ -16,6 +16,8 @@
namespace mozilla {
namespace layers {
struct FrameMetrics;
class UiCompositorControllerParent final
: public PUiCompositorControllerParent {
// UiCompositorControllerChild needs to call the private constructor when
@ -66,6 +68,7 @@ class UiCompositorControllerParent final
// necessary.
void NotifyLayersUpdated();
void NotifyFirstPaint();
void NotifyUpdateScreenMetrics(const FrameMetrics& aMetrics);
private:
explicit UiCompositorControllerParent(const LayersId& aRootLayerTreeId);

Просмотреть файл

@ -1 +1 @@
fb4b9342aa1b047ac46b89cb7a70987816bee686
ff9940fdf95412a3e5d1a70c78defba6e919c170

Просмотреть файл

@ -263,6 +263,7 @@ impl<T, M> FreeList<T, M> {
slot.value.take().unwrap()
}
#[allow(dead_code)]
pub fn len(&self) -> usize {
self.active_count
}

Просмотреть файл

@ -526,7 +526,8 @@ impl TextureCache {
self.debug_flags = flags;
}
pub fn clear(&mut self) {
/// Clear all standalone textures in the cache.
pub fn clear_standalone(&mut self) {
let standalone_entry_handles = mem::replace(
&mut self.handles.standalone,
Vec::new(),
@ -537,7 +538,10 @@ impl TextureCache {
entry.evict();
self.free(entry);
}
}
/// Clear all shared textures in the cache.
pub fn clear_shared(&mut self) {
let shared_entry_handles = mem::replace(
&mut self.handles.shared,
Vec::new(),
@ -549,11 +553,16 @@ impl TextureCache {
self.free(entry);
}
assert!(self.entries.len() == 0);
self.shared_textures.clear(&mut self.pending_updates);
}
/// Clear all entries in the texture cache. This is a fairly drastic
/// step that should only be called very rarely.
pub fn clear(&mut self) {
self.clear_standalone();
self.clear_shared();
}
/// Called at the beginning of each frame.
pub fn begin_frame(&mut self, stamp: FrameStamp) {
self.now = stamp;
@ -597,7 +606,7 @@ impl TextureCache {
if let Some(t) = self.reached_reclaim_threshold {
let dur = self.now.time().duration_since(t).unwrap_or(Duration::default());
if dur >= Duration::from_secs(5) {
self.clear();
self.clear_shared();
self.reached_reclaim_threshold = None;
}
}

Просмотреть файл

@ -14,7 +14,7 @@ chrome/toolkit/skin/classic/global/global.css
chrome/toolkit/skin/classic/global/listbox.css
chrome/toolkit/skin/classic/global/menu.css
chrome/toolkit/skin/classic/global/menulist.css
chrome/toolkit/skin/classic/global/numberbox.css
chrome/toolkit/skin/classic/global/numberinput.css
chrome/toolkit/skin/classic/global/popup.css
chrome/toolkit/skin/classic/global/preferences.css
chrome/toolkit/skin/classic/global/radio.css

Просмотреть файл

@ -15,7 +15,6 @@ from marionette_harness import (
MarionetteTestCase,
run_if_e10s,
run_if_manage_instance,
skip,
skip_if_mobile,
WindowManagerMixin,
)
@ -819,10 +818,9 @@ class TestPageLoadStrategy(BaseNavigationTestCase):
self.assertEqual("complete", self.ready_state)
self.marionette.find_element(By.ID, "slow")
@skip("Bug 1422741 - Causes following tests to fail in loading remote browser")
@run_if_e10s("Requires e10s mode enabled")
def test_strategy_after_remoteness_change(self):
"""Bug 1378191 - Reset of capabilities after listener reload"""
"""Bug 1378191 - Reset of capabilities after listener reload."""
self.marionette.delete_session()
self.marionette.start_session({"pageLoadStrategy": "eager"})

Просмотреть файл

@ -408,6 +408,14 @@ max-width: ${REFTEST_WIDTH}px; max-height: ${REFTEST_HEIGHT}px`;
pixelsDifferent <= allowedPixels[1]));
}
ensureFocus(win) {
const focusManager = Services.focus;
if (focusManager.activeWindow != win) {
focusManager.activeWindow = win;
}
this.driver.curBrowser.contentBrowser.focus();
}
async screenshot(win, url, timeout) {
win.innerWidth = REFTEST_WIDTH;
win.innerHeight = REFTEST_HEIGHT;
@ -466,7 +474,7 @@ max-width: ${REFTEST_WIDTH}px; max-height: ${REFTEST_HEIGHT}px`;
this.lastURL = url;
}
this.driver.curBrowser.contentBrowser.focus();
this.ensureFocus(win);
await this.driver.listener.reftestWait(url, this.remote);
canvas = capture.canvas(

Просмотреть файл

@ -24,7 +24,7 @@ customElements.define("printpreview-toolbar", class PrintPreviewToolbar extends
<toolbarbutton id="print-preview-navigateHome" class="print-preview-navigate-button tabbable" oncommand="parentNode.navigate(0, 0, 'home');" tooltiptext="&homearrow.tooltip;"/>
<toolbarbutton id="print-preview-navigatePrevious" class="print-preview-navigate-button tabbable" oncommand="parentNode.navigate(-1, 0, 0);" tooltiptext="&previousarrow.tooltip;"/>
<hbox align="center" pack="center">
<textbox id="print-preview-pageNumber" value="1" min="1" type="number" hidespinbuttons="true" onchange="navigate(0, this.valueNumber, 0);"/>
<html:input id="print-preview-pageNumber" hidespinbuttons="true" type="number" value="1" min="1"/>
<label value="&of.label;"/>
<label id="print-preview-totalPages" value="1"/>
</hbox>
@ -104,6 +104,11 @@ customElements.define("printpreview-toolbar", class PrintPreviewToolbar extends
this.mPPBrowser = null;
this.mMessageManager = null;
this.mOnPageTextBoxChange = () => {
this.navigate(0, Number(this.mPageTextBox.value), 0);
};
this.mPageTextBox.addEventListener("change", this.mOnPageTextBoxChange);
}
initialize(aPPBrowser) {
@ -140,6 +145,7 @@ customElements.define("printpreview-toolbar", class PrintPreviewToolbar extends
disconnectedCallback() {
window.removeEventListener("unload", this.disconnectedCallback);
this.mPageTextBox.removeEventListener("change", this.mOnPageTextBoxChange);
this.destroy();
}
@ -188,9 +194,9 @@ customElements.define("printpreview-toolbar", class PrintPreviewToolbar extends
} else if (aDirection) {
// aDirection is either +1 or -1, and allows us to increment
// or decrement our currently viewed page.
this.mPageTextBox.valueNumber += aDirection;
this.mPageTextBox.value = Number(this.mPageTextBox.value) + aDirection;
navType = nsIWebBrowserPrint.PRINTPREVIEW_GOTO_PAGENUM;
pageNum = this.mPageTextBox.value; // TODO: back to valueNumber?
pageNum = this.mPageTextBox.value;
} else {
// We're going to a specific page (aPageNum)
navType = nsIWebBrowserPrint.PRINTPREVIEW_GOTO_PAGENUM;

Просмотреть файл

@ -14,6 +14,10 @@ SharedLibrary('modules-test')
NO_PGO = True
TESTING_JS_MODULES += [
'utils/TelemetryTestUtils.jsm',
]
if CONFIG['COMPILE_ENVIRONMENT']:
shared_library = '!%smodules-test%s' % (CONFIG['DLL_PREFIX'], CONFIG['DLL_SUFFIX'])
TEST_HARNESS_FILES.xpcshell.toolkit.components.telemetry.tests.unit += [shared_library]

Просмотреть файл

@ -0,0 +1,182 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
const EXPORTED_SYMBOLS = ["TelemetryTestUtils"];
ChromeUtils.import("resource://testing-common/Assert.jsm");
ChromeUtils.import("resource://gre/modules/Services.jsm");
var TelemetryTestUtils = {
/* Scalars */
/**
* An helper that asserts the value of a scalar if it's expected to be > 0,
* otherwise makes sure that the scalar has not been reported.
*
* @param {Object} scalars The snapshot of the scalars.
* @param {String} scalarName The name of the scalar to check.
* @param {Number} value The expected value for the provided scalar.
* @param {String} msg The message to print when checking the value.
*/
assertScalar(scalars, scalarName, value, msg) {
if (value > 0) {
Assert.equal(scalars[scalarName], value, msg);
return;
}
Assert.ok(!(scalarName in scalars), scalarName + " must not be reported.");
},
/**
* Asserts if the snapshotted keyed scalars contain the expected
* data.
*
* @param {Object} scalars The snapshot of the keyed scalars.
* @param {String} scalarName The name of the keyed scalar to check.
* @param {String} key The key that must be within the keyed scalar.
* @param {String|Boolean|Number} expectedValue The expected value for the
* provided key in the scalar.
*/
assertKeyedScalar(scalars, scalarName, key, expectedValue) {
Assert.ok(scalarName in scalars,
scalarName + " must be recorded.");
Assert.ok(key in scalars[scalarName],
scalarName + " must contain the '" + key + "' key.");
Assert.equal(scalars[scalarName][key], expectedValue,
scalarName + "['" + key + "'] must contain the expected value");
},
/**
* Returns a snapshot of scalars from the parent-process.
*
* @param {Number} aChannel The channel dataset type from nsITelemetry.
* @param {boolean} [aKeyed] Set to true if keyed scalars rather than normal
* scalars should be snapshotted.
* @param {boolean} [aClear] Set to true to clear the scalars once the snapshot
* has been obtained.
* @returns {Object} The snapshotted scalars from the parent process.
*/
getParentProcessScalars(aChannel, aKeyed = false, aClear = false) {
const extended = aChannel == Ci.nsITelemetry.DATASET_RELEASE_CHANNEL_OPTIN;
const currentExtended = Services.telemetry.canRecordExtended;
Services.telemetry.canRecordExtended = extended;
const scalars = aKeyed ?
Services.telemetry.getSnapshotForKeyedScalars("main", aClear).parent :
Services.telemetry.getSnapshotForScalars("main", aClear).parent;
Services.telemetry.canRecordExtended = currentExtended;
return scalars || {};
},
/* Events */
/**
* Asserts if snapshotted events telemetry match the expected values.
*
* @param {Array} events Snapshotted telemetry events to test.
* @param {Array} expectedEvents The expected event data.
*/
assertEvents(events, expectedEvents) {
if (!Services.telemetry.canRecordExtended) {
console.log("Not asserting event telemetry - canRecordExtended is disabled.");
return;
}
Assert.equal(events.length, expectedEvents.length, "Should have matching amount of events.");
// Strip timestamps from the events for easier comparison.
events = events.map(e => e.slice(1));
for (let i = 0; i < events.length; ++i) {
Assert.deepEqual(events[i], expectedEvents[i], "Events should match.");
}
},
/* Histograms */
/**
* Clear and get the named histogram.
*
* @param {String} name The name of the histogram
* @returns {Object} The obtained histogram.
*/
getAndClearHistogram(name) {
let histogram = Services.telemetry.getHistogramById(name);
histogram.clear();
return histogram;
},
/**
* Clear and get the named keyed histogram.
*
* @param {String} name The name of the keyed histogram
* @returns {Object} The obtained keyed histogram.
*/
getAndClearKeyedHistogram(name) {
let histogram = Services.telemetry.getKeyedHistogramById(name);
histogram.clear();
return histogram;
},
/**
* Assert that the histogram index is the right value. It expects that
* other indexes are all zero.
*
* @param {Object} histogram The histogram to check.
* @param {Number} index The index to check against the expected value.
* @param {Number} expected The expected value of the index.
*/
assertHistogram(histogram, index, expected) {
const snapshot = histogram.snapshot();
for (let [i, val] of Object.entries(snapshot.values)) {
if (i == index) {
Assert.equal(val, expected,
`expected counts should match for the histogram index ${i}`);
} else {
Assert.equal(val, 0,
`unexpected counts should be zero for the histogram index ${i}`);
}
}
},
/**
* Assert that a key within a keyed histogram contains the required sum.
*
* @param {Object} histogram The keyed histogram to check.
* @param {String} key The key to check.
* @param {Number} [expected] The expected sum for the key.
*/
assertKeyedHistogramSum(histogram, key, expected) {
const snapshot = histogram.snapshot();
if (expected === undefined) {
Assert.ok(!(key in snapshot), `The histogram must not contain ${key}.`);
return;
}
Assert.ok(key in snapshot, `The histogram must contain ${key}.`);
Assert.equal(snapshot[key].sum, expected,
`The key ${key} must contain the expected sum.`);
},
/**
* Assert that the value of a key within a keyed histogram is the right value.
* It expects that other values are all zero.
*
* @param {Object} histogram The keyed histogram to check.
* @param {String} key The key to check.
* @param {Number} index The index to check against the expected value.
* @param {Number} [expected] The expected values for the key.
*/
assertKeyedHistogramValue(histogram, key, index, expected) {
const snapshot = histogram.snapshot();
for (let [i, val] of Object.entries(snapshot[key].values)) {
if (i == index) {
Assert.equal(val, expected,
`expected counts should match for the histogram index ${i}`);
} else {
Assert.equal(val, 0,
`unexpected counts should be zero for the histogram index ${i}`);
}
}
},
};

Просмотреть файл

@ -141,7 +141,8 @@ const MozElementMixin = Base => class MozElement extends Base {
`;
}, "")}
]>` : ""}
<box xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<box xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
xmlns:html="http://www.w3.org/1999/xhtml">
${str}
</box>
`, "application/xml");

Просмотреть файл

@ -75,7 +75,6 @@ toolkit.jar:
content/global/bindings/menu.xml (widgets/menu.xml)
content/global/bindings/menulist.xml (widgets/menulist.xml)
content/global/bindings/notification.xml (widgets/notification.xml)
content/global/bindings/numberbox.xml (widgets/numberbox.xml)
content/global/bindings/popup.xml (widgets/popup.xml)
content/global/bindings/radio.xml (widgets/radio.xml)
content/global/bindings/richlistbox.xml (widgets/richlistbox.xml)
@ -93,7 +92,7 @@ toolkit.jar:
* content/global/bindings/wizard.xml (widgets/wizard.xml)
content/global/elements/datetimebox.js (widgets/datetimebox.js)
content/global/elements/findbar.js (widgets/findbar.js)
content/global/elements/editor.js (widgets/editor.js)
content/global/elements/editor.js (widgets/editor.js)
content/global/elements/general.js (widgets/general.js)
content/global/elements/notificationbox.js (widgets/notificationbox.js)
content/global/elements/pluginProblem.js (widgets/pluginProblem.js)

Просмотреть файл

@ -182,7 +182,6 @@ support-files = window_preferences_onsyncfrompreference.xul
[test_tabindex.xul]
[test_textbox_dictionary.xul]
[test_textbox_emptytext.xul]
[test_textbox_number.xul]
[test_textbox_search.xul]
[test_titlebar.xul]
skip-if = os == "linux"

Просмотреть файл

@ -1,159 +0,0 @@
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
<!--
XUL Widget Test for textbox type="number"
-->
<window title="Textbox type='number' test" width="500" height="600"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
<hbox>
<textbox id="n1" type="number"/>
<textbox id="n2" type="number" value="10" min="5" max="15"/>
</hbox>
<hbox>
<textbox id="n4" type="number" value="-2" min="-8" max="18"/>
<textbox id="n5" type="number" value="-17" min="-10" max="-3"/>
</hbox>
<hbox>
<textbox id="n6" type="number" value="9" min="12" max="8"/>
<textbox id="n8" type="number" hidespinbuttons="true"/>
</hbox>
<hbox>
<textbox id="n9" type="number" oninput="updateInputEventCount();"/>
</hbox>
<!-- test results are displayed in the html:body -->
<body xmlns="http://www.w3.org/1999/xhtml" style="height: 300px; overflow: auto;"/>
<!-- test code goes here -->
<script type="application/javascript"><![CDATA[
SimpleTest.waitForExplicitFinish();
// ---- NOTE: the numbers used in these tests are carefully chosen to avoid
// ---- floating point rounding issues
function doTests() {
var n1 = $("n1");
var n2 = $("n2");
var n4 = $("n4");
var n5 = $("n5");
var n6 = $("n6");
testValsMinMax(n1, "initial n1", 0, 0, Infinity);
testValsMinMax(n2, "initial n2", 10, 5, 15);
testValsMinMax(n4, "initial n4", -2, -8, 18);
testValsMinMax(n5, "initial n5", -10, -10, -3);
testValsMinMax(n6, "initial n6", 12, 12, 12);
// test changing the value
n1.value = "1700";
testVals(n1, "set value,", 1700);
n1.value = 1600;
testVals(n1, "set value int,", 1600);
n2.value = "2";
testVals(n2, "set value below min,", 5);
n2.value = 2;
testVals(n2, "set value below min int,", 5);
n2.value = 18;
testVals(n2, "set value above max,", 15);
n2.value = -6;
testVals(n2, "set value below min negative,", 5);
n5.value = -2;
testVals(n5, "set value above max positive,", -3);
n1.value = 4.75;
testVals(n1, "set value to decimal round,", 5);
// test changing the valueNumber
n1.valueNumber = 27;
testVals(n1, "set valueNumber,", 27);
n2.valueNumber = 1;
testVals(n2, "set valueNumber below min,", 5);
n2.valueNumber = 77;
testVals(n2, "set valueNumber above max,", 15);
n2.valueNumber = -5;
testVals(n2, "set valueNumber below min negative,", 5);
n5.valueNumber = -8;
n5.valueNumber = -1;
testVals(n5, "set valueNumber above max positive,", -3);
n1.value = 8.9;
testVals(n1, "set valueNumber to decimal round,", 9);
// test changing the min
n1.value = 6;
n1.min = 8;
testValsMinMax(n1, "set integer min,", 8, 8, Infinity);
// test changing the max
n1.value = 25;
n1.max = 22;
testValsMinMax(n1, "set integer max,", 22, 8, 22);
// check read only state
n1.readOnly = true;
n1.min = -10;
n1.max = 15;
n1.value = 12;
n1.inputField.focus();
// no events should fire and no changes should occur when the field is read only
synthesizeKeyExpectEvent("KEY_ArrowUp", {}, n1, "!change", "key up read only");
is(n1.value, "12", "key up read only value");
synthesizeKeyExpectEvent("KEY_ArrowDown", {}, n1, "!change", "key down read only");
is(n1.value, "12", "key down read only value");
n1.readOnly = false;
var n9 = $("n9");
is(n9.value, "0", "initial value");
n9.select();
sendString("4");
is(inputEventCount, 1, "input event count");
is(inputEventValue, "4", "input value");
is(n9.value, "4", "updated value");
sendString("2");
is(inputEventCount, 2, "input event count");
is(inputEventValue, "42", "input value");
is(n9.value, "42", "updated value");
synthesizeKey("KEY_Backspace");
is(inputEventCount, 3, "input event count");
is(inputEventValue, "4", "input value");
is(n9.value, "4", "updated value");
synthesizeKey("A", {accelKey: true});
synthesizeKey("KEY_Delete");
is(inputEventCount, 4, "input event count");
is(inputEventValue, "0", "input value");
is(n9.value, "0", "updated value");
SimpleTest.finish();
}
var inputEventCount = 0;
var inputEventValue = null;
function updateInputEventCount() {
inputEventValue = $("n9").value;
inputEventCount++;
};
function testVals(nb, name, valueNumber, valueFieldNumber) {
if (valueFieldNumber === undefined)
valueFieldNumber = "" + valueNumber;
SimpleTest.is(nb.value, "" + valueNumber, name + " value is '" + valueNumber + "'");
SimpleTest.is(nb.valueNumber, valueNumber, name + " valueNumber is " + valueNumber);
SimpleTest.is(nb.inputField.value, valueFieldNumber,
name + " inputField value is '" + valueFieldNumber + "'");
}
function testValsMinMax(nb, name, valueNumber, min, max, valueFieldNumber) {
testVals(nb, name, valueNumber, valueFieldNumber);
SimpleTest.is(nb.min, min, name + " min is " + min);
SimpleTest.is(nb.max, max, name + " max is " + max);
}
SimpleTest.waitForFocus(doTests);
]]></script>
</window>

Просмотреть файл

@ -16,17 +16,14 @@
@import url("chrome://global/skin/menu.css");
@import url("chrome://global/skin/menulist.css");
@import url("chrome://global/skin/notification.css");
@import url("chrome://global/skin/numberinput.css");
@import url("chrome://global/skin/popup.css");
@import url("chrome://global/skin/radio.css");
@import url("chrome://global/skin/richlistbox.css");
@import url("chrome://global/skin/scrollbox.css");
@import url("chrome://global/skin/splitter.css");
@import url("chrome://global/skin/tabbox.css");
/* numberbox.css needs to be loaded after textbox.css since it overrides it */
@import url("chrome://global/skin/textbox.css");
@import url("chrome://global/skin/numberbox.css");
@import url("chrome://global/skin/toolbar.css");
@import url("chrome://global/skin/toolbarbutton.css");
@import url("chrome://global/skin/tree.css");

Просмотреть файл

@ -1,146 +0,0 @@
<?xml version="1.0"?>
<!-- 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/. -->
<bindings id="numberboxBindings"
xmlns="http://www.mozilla.org/xbl"
xmlns:html="http://www.w3.org/1999/xhtml"
xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
xmlns:xbl="http://www.mozilla.org/xbl">
<binding id="numberbox"
extends="chrome://global/content/bindings/textbox.xml#textbox">
<content>
<xul:moz-input-box anonid="moz-input-box" class="numberbox-input-box" flex="1" xbl:inherits="context,disabled,focused">
<html:input class="numberbox-input textbox-input" type="number" anonid="input"
xbl:inherits="value,min,max,maxlength,disabled,size,readonly,placeholder,tabindex,accesskey"/>
</xul:moz-input-box>
</content>
<implementation>
<field name="_valueEntered">false</field>
<field name="_value">0</field>
<property name="value" onget="return String(this.valueNumber)"
onset="return this.valueNumber = val;"/>
<property name="valueNumber">
<getter>
if (this._valueEntered) {
var newval = this.inputField.value;
this._validateValue(newval);
}
return this._value;
</getter>
<setter>
this._validateValue(val);
return val;
</setter>
</property>
<property name="min">
<getter>
var min = this.getAttribute("min");
return min ? Number(min) : 0;
</getter>
<setter>
<![CDATA[
if (typeof val == "number") {
this.setAttribute("min", val);
if (this.valueNumber < val)
this._validateValue(val);
}
return val;
]]>
</setter>
</property>
<property name="max">
<getter>
var max = this.getAttribute("max");
return max ? Number(max) : Infinity;
</getter>
<setter>
<![CDATA[
if (typeof val != "number")
return val;
var min = this.min;
if (val < min)
val = min;
this.setAttribute("max", val);
if (this.valueNumber > val)
this._validateValue(val);
return val;
]]>
</setter>
</property>
<method name="_validateValue">
<parameter name="aValue"/>
<body>
<![CDATA[
aValue = Number(aValue) || 0;
aValue = Math.round(aValue);
var min = this.min;
var max = this.max;
if (aValue < min)
aValue = min;
else if (aValue > max)
aValue = max;
this._valueEntered = false;
this._value = Number(aValue);
this.inputField.value = aValue;
return aValue;
]]>
</body>
</method>
<method name="_fireChange">
<body>
var evt = document.createEvent("Events");
evt.initEvent("change", true, true);
this.dispatchEvent(evt);
</body>
</method>
<constructor><![CDATA[
if (this.max < this.min)
this.max = this.min;
var value = this.inputField.value || 0;
this._validateValue(value);
]]></constructor>
</implementation>
<handlers>
<handler event="input" phase="capturing">
this._valueEntered = true;
</handler>
<handler event="keypress">
<![CDATA[
if (!event.ctrlKey && !event.metaKey && !event.altKey && event.charCode) {
if (event.charCode == 45 && this.min < 0)
return;
if (event.charCode < 48 || event.charCode > 57)
event.preventDefault();
}
]]>
</handler>
<handler event="change">
if (event.originalTarget == this.inputField) {
this._validateValue(this.inputField.value);
}
</handler>
</handlers>
</binding>
</bindings>

Просмотреть файл

@ -194,29 +194,27 @@
if (this.hasAttribute("focused"))
return;
let { originalTarget } = event;
if (originalTarget == this) {
// Forward focus to actual HTML input
this.inputField.focus();
this.setAttribute("focused", "true");
return;
switch (event.originalTarget) {
case this:
// Forward focus to actual HTML input
this.inputField.focus();
this.setAttribute("focused", "true");
break;
case this.inputField:
if (this.mIgnoreFocus) {
this.mIgnoreFocus = false;
} else if (this.clickSelectsAll) {
try {
if (!this.editor || !this.editor.composing)
this.editor.selectAll();
} catch (e) {}
}
this.setAttribute("focused", "true");
break;
default:
// Otherwise, allow other children (e.g. URL bar buttons) to get focus
break;
}
// We check for the parent nodes to support input[type=number] where originalTarget may be an
// anonymous child input.
if (originalTarget == this.inputField ||
originalTarget.localName == "input" && originalTarget.parentNode.parentNode == this.inputField) {
if (this.mIgnoreFocus) {
this.mIgnoreFocus = false;
} else if (this.clickSelectsAll) {
try {
if (!this.editor || !this.editor.composing)
this.editor.selectAll();
} catch (e) {}
}
this.setAttribute("focused", "true");
}
// Otherwise, allow other children (e.g. URL bar buttons) to get focus
]]>
</handler>

Просмотреть файл

@ -562,10 +562,6 @@ textbox[type="search"] {
-moz-binding: url("chrome://global/content/bindings/textbox.xml#search-textbox");
}
textbox[type="number"] {
-moz-binding: url("chrome://global/content/bindings/numberbox.xml#numberbox");
}
@supports -moz-bool-pref("layout.css.emulate-moz-box-with-flex") {
html|*.textbox-input,
html|*.textbox-textarea {

Просмотреть файл

@ -11,6 +11,7 @@
@import url("chrome://global/content/widgets.css");
@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
@namespace html url("http://www.w3.org/1999/xhtml");
%include ../../shared/global.inc.css
@ -121,9 +122,10 @@ toolbar[mode="text"] .toolbarbutton-text {
list-style-image: url("moz-icon://stock/gtk-orientation-landscape?size=button");
}
#print-preview-pageNumber {
/* 3 chars + 4px padding left + 2px padding right + 2*6px border */
width: calc(18px + 3ch);
html|*#print-preview-pageNumber {
/* 3 chars + (3px border + 1px padding) on both sides */
width: calc(8px + 3ch);
margin: 0 4px;
}
/* ::::: miscellaneous formatting ::::: */
@ -257,4 +259,3 @@ popupnotificationcontent {
}
%include ../../shared/notification-popup.inc.css

Просмотреть файл

@ -43,11 +43,6 @@ xul|*.radio-label-box {
-moz-appearance: none;
}
xul|*.numberbox-input-box {
-moz-appearance: none;
border-width: 0;
}
xul|menulist:-moz-focusring > xul|*.menulist-label-box {
outline: none;
}

Просмотреть файл

@ -13,7 +13,7 @@ toolkit.jar:
skin/classic/global/global.css (global/empty.css)
skin/classic/global/menu.css (global/empty.css)
skin/classic/global/menulist.css (global/empty.css)
skin/classic/global/numberbox.css (global/empty.css)
skin/classic/global/numberinput.css (global/empty.css)
skin/classic/global/popup.css (global/empty.css)
skin/classic/global/radio.css (global/empty.css)
skin/classic/global/richlistbox.css (global/empty.css)

Просмотреть файл

@ -70,14 +70,6 @@ xul|radio[focused="true"] > .radio-check {
-moz-outline-radius: 100%;
}
html|*.numberbox-input::-moz-number-spin-up {
border-radius: 4px 4px 0 0;
}
html|*.numberbox-input::-moz-number-spin-down {
border-radius: 0 0 4px 4px;
}
textbox[type="search"] {
-moz-appearance: none;
padding-inline-start: 8px;

Просмотреть файл

@ -8,11 +8,6 @@
%include ../../shared/notification.inc.css
%include ../../shared/popupnotification.inc.css
.popup-notification-button:-moz-focusring {
outline: 2px -moz-mac-focusring solid;
outline-offset: -2px;
}
.popup-notification-warning {
color: #aa1b08;
}

Просмотреть файл

@ -96,3 +96,7 @@
.panel-footer > button:not([disabled])[default]:hover:active {
background-color: #002275;
}
.panel-footer > button > .button-box {
padding: 0;
}

Просмотреть файл

@ -165,9 +165,7 @@ html|button {
*|button,
html|select,
html|input[type="color"],
xul|menulist,
html|*.numberbox-input::-moz-number-spin-up,
html|*.numberbox-input::-moz-number-spin-down {
xul|menulist {
-moz-appearance: none;
min-height: 32px;
/* !important overrides button.css for disabled and default XUL buttons: */
@ -199,9 +197,7 @@ html|input[type="color"]::-moz-focus-inner {
*|button:-moz-focusring,
html|select:-moz-focusring,
html|input[type="color"]:-moz-focusring,
xul|menulist:-moz-focusring,
html|input[type="number"]:-moz-focusring::-moz-number-spin-up,
html|input[type="number"]:-moz-focusring::-moz-number-spin-down {
xul|menulist:-moz-focusring {
outline: none;
box-shadow: 0 0 0 1px var(--in-content-border-active) inset,
0 0 0 1px var(--in-content-border-active),
@ -225,8 +221,6 @@ html|select:not([size]):not([multiple]):dir(rtl) {
html|button:enabled:hover,
html|select:not([size]):not([multiple]):enabled:hover,
html|*.numberbox-input::-moz-number-spin-up:hover,
html|*.numberbox-input::-moz-number-spin-down:hover,
html|input[type="color"]:hover,
xul|button:not([disabled="true"]):hover,
xul|menulist:not([disabled="true"]):hover {
@ -235,8 +229,6 @@ xul|menulist:not([disabled="true"]):hover {
html|button:enabled:hover:active,
html|select:not([size]):not([multiple]):enabled:hover:active,
html|*.numberbox-input::-moz-number-spin-up:hover:active,
html|*.numberbox-input::-moz-number-spin-down:hover:active,
html|input[type="color"]:enabled:hover:active,
xul|button:not([disabled="true"]):hover:active,
xul|menulist[open="true"]:not([disabled="true"]) {
@ -245,7 +237,6 @@ xul|menulist[open="true"]:not([disabled="true"]) {
html|button:disabled,
html|select:disabled,
html|*.numberbox-input:disabled::-moz-number-spin-box,
html|input[type="color"]:disabled,
xul|button[disabled="true"],
xul|menulist[disabled="true"] {
@ -297,28 +288,6 @@ xul|*.close-icon > xul|*.button-box {
padding-left: 0 !important;
}
html|*.numberbox-input::-moz-number-spin-box {
margin-inline-end: 1px;
}
html|*.numberbox-input::-moz-number-spin-up,
html|*.numberbox-input::-moz-number-spin-down {
padding: 5px 8px;
margin: 0;
min-height: initial;
background-position: center;
}
html|*.numberbox-input::-moz-number-spin-up {
border-radius: 1px 1px 0 0;
background-image: url("chrome://global/skin/arrow/arrow-up.gif");
}
html|*.numberbox-input::-moz-number-spin-down {
border-radius: 0 0 1px 1px;
background-image: url("chrome://global/skin/arrow/arrow-dn.gif");
}
xul|*.menulist-dropmarker {
-moz-appearance: none;
margin-inline-end: 4px;
@ -418,14 +387,6 @@ xul|textbox {
padding-left: 8px;
}
xul|textbox[type="number"] {
padding-inline-end: 0;
}
html|*.numberbox-input::-moz-number-text {
margin-inline-end: 10px;
}
/* Create a separate rule to unset these styles on .tree-input instead of
using :not(.tree-input) so the selector specifity doesn't change. */
xul|textbox.tree-input {

Просмотреть файл

@ -22,7 +22,7 @@ toolkit.jar:
skin/classic/global/appPicker.css (../../shared/appPicker.css)
skin/classic/global/config.css (../../shared/config.css)
skin/classic/global/datetimeinputpickers.css (../../shared/datetimeinputpickers.css)
skin/classic/global/numberbox.css (../../shared/numberbox.css)
skin/classic/global/numberinput.css (../../shared/numberinput.css)
skin/classic/global/passwordmgr.css (../../shared/passwordmgr.css)
skin/classic/global/icons/autoscroll.svg (../../shared/icons/autoscroll.svg)
skin/classic/global/icons/autoscroll-horizontal.svg (../../shared/icons/autoscroll-horizontal.svg)

Просмотреть файл

@ -15,8 +15,6 @@
skin/classic/global/tabprompts.css (../../windows/global/tabprompts.css)
skin/classic/global/wizard.css (../../windows/global/wizard.css)
skin/classic/global/arrow/arrow-dn.gif (../../windows/global/arrow/arrow-dn.gif)
skin/classic/global/arrow/arrow-up.gif (../../windows/global/arrow/arrow-up.gif)
skin/classic/global/arrow/panelarrow-horizontal.svg (../../windows/global/arrow/panelarrow-horizontal.svg)
skin/classic/global/arrow/panelarrow-vertical.svg (../../windows/global/arrow/panelarrow-vertical.svg)

Просмотреть файл

@ -1,42 +0,0 @@
/* 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/. */
/* ===== numberbox.css ==================================================
== Styles used by the XUL textbox type="number" element.
======================================================================= */
@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
@namespace html url("http://www.w3.org/1999/xhtml");
html|*.numberbox-input {
text-align: right;
}
textbox[type="number"][hidespinbuttons="true"] html|*.numberbox-input {
-moz-appearance: textfield;
}
/* input[type=number] uses display: flex; by default which is incompatible with XUL flexbox
Forcing XUL flexbox allows changing the size of the input. */
html|*.numberbox-input,
html|*.numberbox-input::-moz-number-wrapper,
html|*.numberbox-input::-moz-number-spin-box {
display: -moz-box;
-moz-box-align: center;
}
html|*.numberbox-input::-moz-number-spin-box {
-moz-box-orient: vertical;
}
html|*.numberbox-input::-moz-number-wrapper,
html|*.numberbox-input::-moz-number-spin-up,
html|*.numberbox-input::-moz-number-spin-down,
html|*.numberbox-input::-moz-number-text {
-moz-box-flex: 1;
}
html|*.numberbox-input::-moz-number-wrapper {
width: 100%;
}

Просмотреть файл

@ -0,0 +1,35 @@
/* 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/. */
/* ===== numberinput.css ================================================
== Styles used by the input[type="number"] element.
======================================================================= */
@namespace xul url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
@namespace html url("http://www.w3.org/1999/xhtml");
html|input[type="number"] {
text-align: right;
}
html|input[type="number"][hidespinbuttons="true"] {
-moz-appearance: textfield !important;
}
/* input[type=number] uses display: flex; by default which is incompatible with XUL flexbox
Forcing XUL flexbox allows changing the size of the input. */
xul|*:root html|input[type="number"],
xul|*:root html|input[type="number"]::-moz-number-wrapper {
display: -moz-box;
-moz-box-align: center;
}
xul|*:root html|input[type="number"]::-moz-number-wrapper,
xul|*:root html|input[type="number"]::-moz-number-text {
-moz-box-flex: 1;
}
xul|*:root html|input[type="number"]::-moz-number-wrapper {
width: 100%;
}

Просмотреть файл

@ -68,10 +68,6 @@
flex: 1;
}
.popup-notification-button > .button-box {
padding: 0;
}
.popup-notification-dropmarker {
flex: none;
padding: 0 15px;

Просмотреть файл

@ -11,6 +11,7 @@
@import url("chrome://global/content/widgets.css");
@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
@namespace html url("http://www.w3.org/1999/xhtml");
%include ../../shared/global.inc.css
@ -126,8 +127,10 @@ toolbar[mode="text"] .toolbarbutton-text {
-moz-image-region: rect(0px 32px 16px 16px);
}
#print-preview-pageNumber {
width: 3ch;
html|*#print-preview-pageNumber {
/* 3 chars + (3px border + 1px padding) on both sides */
width: calc(8px + 3ch);
margin: 0 4px;
}
/* ::::: miscellaneous formatting ::::: */
@ -260,4 +263,3 @@ popupnotificationcontent {
}
%include ../../shared/notification-popup.inc.css

Просмотреть файл

@ -33,7 +33,9 @@ toolkit.jar:
skin/classic/global/arrow/arrow-lft-dis.gif (arrow/arrow-lft-dis.gif)
skin/classic/global/arrow/arrow-rit.gif (arrow/arrow-rit.gif)
skin/classic/global/arrow/arrow-rit-dis.gif (arrow/arrow-rit-dis.gif)
skin/classic/global/arrow/arrow-up.gif (arrow/arrow-up.gif)
skin/classic/global/arrow/arrow-up-dis.gif (arrow/arrow-up-dis.gif)
skin/classic/global/arrow/arrow-dn.gif (arrow/arrow-dn.gif)
skin/classic/global/arrow/arrow-dn-dis.gif (arrow/arrow-dn-dis.gif)
skin/classic/global/dirListing/folder.png (dirListing/folder.png)
skin/classic/global/dirListing/up.png (dirListing/up.png)