зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1412595 - Implement colors.bookmark_text as alias for colors.toolbar_text. r=jaws
MozReview-Commit-ID: HjIgXtbYejZ --HG-- extra : rebase_source : 69e3a81c1e9817c8e4625f490240e879ac781028
This commit is contained in:
Родитель
935734388d
Коммит
a8a4525080
|
@ -135,6 +135,9 @@ class Theme {
|
|||
this.lwtStyles.toolbarColor = cssColor;
|
||||
break;
|
||||
case "toolbar_text":
|
||||
case "bookmark_text":
|
||||
this.lwtStyles.toolbar_text = cssColor;
|
||||
break;
|
||||
case "toolbar_field":
|
||||
case "toolbar_field_text":
|
||||
case "toolbar_top_separator":
|
||||
|
|
|
@ -73,6 +73,10 @@
|
|||
"type": "string",
|
||||
"optional": true
|
||||
},
|
||||
"bookmark_text": {
|
||||
"type": "string",
|
||||
"optional": true
|
||||
},
|
||||
"toolbar_field": {
|
||||
"type": "string",
|
||||
"optional": true
|
||||
|
|
|
@ -55,3 +55,49 @@ add_task(async function test_support_toolbar_property() {
|
|||
|
||||
await extension.unload();
|
||||
});
|
||||
|
||||
add_task(async function test_bookmark_text_property() {
|
||||
const TOOLBAR_COLOR = "#ff00ff";
|
||||
const TOOLBAR_TEXT_COLOR = "#9400ff";
|
||||
let extension = ExtensionTestUtils.loadExtension({
|
||||
manifest: {
|
||||
"theme": {
|
||||
"images": {
|
||||
"headerURL": "image1.png",
|
||||
},
|
||||
"colors": {
|
||||
"accentcolor": ACCENT_COLOR,
|
||||
"textcolor": TEXT_COLOR,
|
||||
"toolbar": TOOLBAR_COLOR,
|
||||
"bookmark_text": TOOLBAR_TEXT_COLOR,
|
||||
},
|
||||
},
|
||||
},
|
||||
files: {
|
||||
"image1.png": BACKGROUND,
|
||||
},
|
||||
});
|
||||
|
||||
await extension.startup();
|
||||
|
||||
let toolbox = document.querySelector("#navigator-toolbox");
|
||||
let toolbars = [...toolbox.querySelectorAll("toolbar:not(#TabsToolbar)")].filter(toolbar => {
|
||||
let bounds = toolbar.getBoundingClientRect();
|
||||
return bounds.width > 0 && bounds.height > 0;
|
||||
});
|
||||
|
||||
info(`Checking toolbar colors for ${toolbars.length} toolbars.`);
|
||||
for (let toolbar of toolbars) {
|
||||
info(`Testing ${toolbar.id}`);
|
||||
Assert.equal(window.getComputedStyle(toolbar).color,
|
||||
"rgb(" + hexToRGB(TOOLBAR_TEXT_COLOR).join(", ") + ")",
|
||||
"bookmark_text should be an alias for toolbar_text");
|
||||
}
|
||||
|
||||
info("Checking selected tab colors");
|
||||
let selectedTab = document.querySelector(".tabbrowser-tab[selected]");
|
||||
Assert.equal(window.getComputedStyle(selectedTab).color,
|
||||
"rgb(" + hexToRGB(TOOLBAR_TEXT_COLOR).join(", ") + ")", "Selected tab text color should be set.");
|
||||
|
||||
await extension.unload();
|
||||
});
|
||||
|
|
Загрузка…
Ссылка в новой задаче