Skip to content

Commit

Permalink
Merge mozilla-central to mozilla-inbound. a=merge
Browse files Browse the repository at this point in the history
  • Loading branch information
dvarga1989 committed Nov 11, 2018
2 parents cb23c99 + 1c87eeb commit ca83631
Show file tree
Hide file tree
Showing 24 changed files with 232 additions and 151 deletions.
35 changes: 24 additions & 11 deletions browser/components/aboutconfig/content/aboutconfig.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,34 @@
* 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/. */

#list {
margin: 0;
padding: 2em;
overflow-wrap: break-word;
#prefs {
background-color: var(--in-content-box-background);
color: var(--in-content-text-color);
margin: 10px;
min-width: 644px;
/* To stay consistent with about:preferences (664px - 20px margin). */
border: 1px solid var(--in-content-box-border-color);
border-radius: 2px;
border-spacing: 0;
}

#list > li {
padding: 5px;
list-style: none;
#prefs > tr:nth-child(odd) {
background-color: var(--in-content-box-background-odd);
}

#list > li:nth-child(even) {
background-color: rgba(0, 0, 0, .06);
#prefs > tr:hover {
background-color: var(--in-content-box-background-hover);
}

#list > li:nth-child(odd) {
background-color: rgba(0, 0, 0, .03);
#prefs > tr.has-user-value {
font-weight: bold;
}

#prefs > tr > td {
padding: 4px;
width: 50%;
}

.cell-value {
word-break: break-all;
}
3 changes: 1 addition & 2 deletions browser/components/aboutconfig/content/aboutconfig.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
src="chrome://browser/content/aboutconfig/aboutconfig.js"></script>
<title data-l10n-id="about-config-title"></title>
</head>

<body onload="onLoad();">
<ul id="list"></ul>
<table id="prefs"></table>
</body>
</html>
29 changes: 22 additions & 7 deletions browser/components/aboutconfig/content/aboutconfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,28 @@ function onLoad() {
gPrefArray.sort((a, b) => a.name > b.name);

let fragment = document.createDocumentFragment();

for (let pref of gPrefArray) {
let listItem = document.createElement("li");
listItem.textContent = pref.name + " || " +
(pref.hasUserValue ? "Modified" : "Default") + " || " +
pref.value.constructor.name + " || " + pref.value;
fragment.appendChild(listItem);
let row = document.createElement("tr");
if (pref.hasUserValue) {
row.classList.add("has-user-value");
}
row.setAttribute("aria-label", pref.name);

let nameCell = document.createElement("td");
// Add <wbr> behind dots to prevent line breaking in random mid-word places.
let parts = pref.name.split(".");
for (let i = 0; i < parts.length - 1; i++) {
nameCell.append(parts[i] + ".", document.createElement("wbr"));
}
nameCell.append(parts[parts.length - 1]);
row.appendChild(nameCell);

let valueCell = document.createElement("td");
valueCell.classList.add("cell-value");
valueCell.textContent = pref.value;
row.appendChild(valueCell);

fragment.appendChild(row);
}
document.getElementById("list").appendChild(fragment);
document.getElementById("prefs").appendChild(fragment);
}
44 changes: 29 additions & 15 deletions browser/components/aboutconfig/test/browser/browser_basic.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,29 +30,43 @@ add_task(async function test_load_settings() {
url: PAGE_URL,
}, browser => {
return ContentTask.spawn(browser, null, () => {
let list = [...content.document.getElementById("list")
.getElementsByTagName("li")];
function findPref(name) {
return list.some(e => e.textContent.trim().startsWith(name + " "));
ChromeUtils.import("resource://gre/modules/Services.jsm");

let list = [...content.document.getElementById("prefs")
.getElementsByTagName("tr")];
function getRow(name) {
return list.find(row => row.querySelector("td").textContent == name);
}
function getValue(name) {
return getRow(name).querySelector("td.cell-value").textContent;
}

// Test if page contains elements.
Assert.ok(findPref("plugins.testmode"));
Assert.ok(findPref("dom.vr.enabled"));
Assert.ok(findPref("accessibility.AOM.enabled"));
Assert.ok(getRow("plugins.testmode"));
Assert.ok(getRow("dom.vr.enabled"));
Assert.ok(getRow("accessibility.AOM.enabled"));

// Test if the modified state is displayed for the right prefs.
let prefArray = Services.prefs.getChildList("");
let nameOfEdited = prefArray.find(
name => Services.prefs.prefHasUserValue(name));
let nameOfDefault = prefArray.find(
name => !Services.prefs.prefHasUserValue(name));
Assert.ok(!getRow(nameOfDefault).classList.contains("has-user-value"));
Assert.ok(getRow(nameOfEdited).classList.contains("has-user-value"));

function containsLocalizedValue(value) {
return list.some(e => e.textContent.trim() == value);
}
// Test to see if values are localized.
Assert.ok(containsLocalizedValue("font.language.group || Default || String || x-western"));
Assert.ok(containsLocalizedValue("intl.ellipsis || Default || String || \u2026"));
Assert.ok(containsLocalizedValue("gecko.handlerService.schemes.mailto.1.uriTemplate || Default || String || https://mail.google.com/mail/?extsrc=mailto&url=%s"));
Assert.equal(getValue("font.language.group"), "x-western");
Assert.equal(getValue("intl.ellipsis"), "\u2026");
Assert.equal(
getValue("gecko.handlerService.schemes.mailto.1.uriTemplate"),
"https://mail.google.com/mail/?extsrc=mailto&url=%s");

// Test to see if user created value is not empty string when it matches /^chrome:\/\/.+\/locale\/.+\.properties/.
Assert.ok(containsLocalizedValue("random.user.pref || Modified || String || chrome://test/locale/testing.properties"));
Assert.equal(getValue("random.user.pref"),
"chrome://test/locale/testing.properties");
// Test to see if empty string when value matches /^chrome:\/\/.+\/locale\/.+\.properties/ and an exception is thrown.
Assert.ok(containsLocalizedValue("gecko.handlerService.schemes.irc.1.name || Default || String ||"));
Assert.equal(getValue("gecko.handlerService.schemes.irc.1.name"), "");
});
});
});
4 changes: 3 additions & 1 deletion browser/config/mozconfigs/macosx64/code-coverage
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,6 @@ ac_add_options --enable-coverage

export CFLAGS="-coverage -Xclang -coverage-no-function-names-in-data"
export CXXFLAGS="-coverage -Xclang -coverage-no-function-names-in-data"
export LDFLAGS="-coverage"
export LDFLAGS="-coverage -L$topsrcdir/clang/lib/clang/7.0.0/lib/darwin/"
export LIBS="-lclang_rt.profile_osx"
export RUSTFLAGS="-Ccodegen-units=1 -Zprofile -Zno-landing-pads"
2 changes: 1 addition & 1 deletion taskcluster/ci/build/macosx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ macosx64-ccov/debug:
- linux64-hfsplus
- linux64-libdmg
- linux64-llvm-dsymutil
- linux64-rust-macos
- linux64-rust-nightly-macos
- linux64-rust-size
- linux64-cbindgen
- linux64-sccache
Expand Down
23 changes: 23 additions & 0 deletions taskcluster/ci/toolchain/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -559,6 +559,29 @@ linux64-rust-macos-1.30:
toolchain-alias: linux64-rust-macos
toolchain-artifact: public/build/rustc.tar.xz

linux64-rust-nightly-macos:
description: "rust nightly repack with macos-cross support"
treeherder:
kind: build
platform: toolchains/opt
symbol: TL(rust-nightly-macos)
tier: 1
worker-type: aws-provisioner-v1/gecko-{level}-b-linux
worker:
max-run-time: 7200
env:
UPLOAD_DIR: artifacts
run:
using: toolchain-script
script: repack_rust.py
arguments: [
'--channel', 'nightly-2018-09-16',
'--host', 'x86_64-unknown-linux-gnu',
'--target', 'x86_64-unknown-linux-gnu',
'--target', 'x86_64-apple-darwin',
]
toolchain-artifact: public/build/rustc.tar.xz

linux64-rust-android-1.30:
description: "rust repack with android-cross support"
treeherder:
Expand Down
4 changes: 2 additions & 2 deletions testing/talos/talos/pageloader/chrome/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ function setIdleCallback() {
function contentLoadHandlerCallback(cb) {
function _handler(e) {
if (e.originalTarget.defaultView == content) {
content.wrappedJSObject.tpRecordTime = function(t, s, n) {
content.wrappedJSObject.tpRecordTime = Cu.exportFunction((t, s, n) => {
sendAsyncMessage("PageLoader:RecordTime", {time: t, startTime: s, testName: n});
};
}, content);
content.setTimeout(cb, 0);
content.setTimeout(setIdleCallback, 0);
}
Expand Down
25 changes: 25 additions & 0 deletions testing/talos/talos/tests/devtools/addon/api.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
"use strict";

ChromeUtils.defineModuleGetter(this, "Services",
"resource://gre/modules/Services.jsm");

/* globals ExtensionAPI */
this.damp = class extends ExtensionAPI {
getAPI(context) {
return {
damp: {
startTest() {
let {rootURI} = context.extension;
let window = context.xulWindow;
if (!("Damp" in window)) {
let script = rootURI.resolve("content/damp.js");
Services.scriptloader.loadSubScript(script, window);
}

let damp = new window.Damp();
return damp.startTest(rootURI);
},
},
};
}
};
45 changes: 0 additions & 45 deletions testing/talos/talos/tests/devtools/addon/bootstrap.js

This file was deleted.

1 change: 0 additions & 1 deletion testing/talos/talos/tests/devtools/addon/chrome.manifest

This file was deleted.

9 changes: 0 additions & 9 deletions testing/talos/talos/tests/devtools/addon/content/damp.html

This file was deleted.

16 changes: 10 additions & 6 deletions testing/talos/talos/tests/devtools/addon/content/damp.js
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ Damp.prototype = {
this._currentTest = test;

dump(`Loading test '${test}'\n`);
let testMethod = require("chrome://damp/content/tests/" + test);
let testMethod = require(this.rootURI.resolve(`content/tests/${test}`));

this._timeout = window.setTimeout(() => {
this.error("Test timed out");
Expand Down Expand Up @@ -312,8 +312,8 @@ Damp.prototype = {
}
this._log("\n" + out);

if (content && content.tpRecordTime) {
content.tpRecordTime(testResults.join(","), 0, testNames.join(","));
if (this.testDone) {
this.testDone({testResults, testNames});
} else {
// alert(out);
}
Expand Down Expand Up @@ -404,10 +404,12 @@ Damp.prototype = {
await this.garbageCollect();
},

startTest() {
startTest(rootURI) {
let promise = new Promise(resolve => { this.testDone = resolve; });
this.rootURI = rootURI;
try {
dump("Initialize the head file with a reference to this DAMP instance\n");
let head = require("chrome://damp/content/tests/head.js");
let head = require(rootURI.resolve("content/tests/head.js"));
head.initialize(this);

this._win = Services.wm.getMostRecentWindow("navigator:browser");
Expand All @@ -417,7 +419,7 @@ Damp.prototype = {
// Filter tests via `./mach --subtests filter` command line argument
let filter = Services.prefs.getCharPref("talos.subtests", "");

let DAMP_TESTS = require("chrome://damp/content/damp-tests.js");
let DAMP_TESTS = require(rootURI.resolve("content/damp-tests.js"));
let tests = DAMP_TESTS.filter(test => !test.disabled)
.filter(test => test.name.includes(filter));

Expand Down Expand Up @@ -448,5 +450,7 @@ Damp.prototype = {
} catch (e) {
this.exception(e);
}

return promise;
},
};
12 changes: 0 additions & 12 deletions testing/talos/talos/tests/devtools/addon/content/framescript.js

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,15 @@ module.exports = async function() {
let tab = await testSetup(SIMPLE_URL);
let messageManager = tab.linkedBrowser.messageManager;

let url = module.uri.replace(/protocol\.js$/, "actor.js");

// Register a test actor within the content process
messageManager.loadFrameScript("data:,(" + encodeURIComponent(
`function () {
const { require } = ChromeUtils.import("resource://devtools/shared/Loader.jsm", {});
const { ActorRegistry } = require("devtools/server/actors/utils/actor-registry");
ActorRegistry.registerModule("chrome://damp/content/tests/server/actor.js", {
ActorRegistry.registerModule("${url}", {
prefix: "dampTest",
constructor: "DampTestActor",
type: { target: true }
Expand Down

0 comments on commit ca83631

Please sign in to comment.