зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1472740 - Avoid LWT aliases in theme API tests that are not specifically about LWT aliases. r=ntim,jaws
This patch replace the LWT aliases with their related non-deprecated alias in all the theme API tests that don't seem to be specifically testing the LWT aliases (e.g. browser_ext_themes_lwtsupport.js is leaved unmodified for this reason). The main reason to replace them in the "not stricly LWT-related" tests before their final removal (currently planned for Firefox 69) is that the deprecation warnings will make these tests more noisy (and so they may be making harder to investigate failures, without any actual gain in terms of coverage). Depends on D12297 Differential Revision: https://phabricator.services.mozilla.com/D12783 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
5b052494ce
Коммит
93075fc624
|
@ -3,13 +3,13 @@
|
|||
"use strict";
|
||||
|
||||
const LIGHT_THEME_COLORS = {
|
||||
"accentcolor": "#FFF",
|
||||
"textcolor": "#000",
|
||||
"frame": "#FFF",
|
||||
"tab_background_text": "#000",
|
||||
};
|
||||
|
||||
const DARK_THEME_COLORS = {
|
||||
"accentcolor": "#000",
|
||||
"textcolor": "#FFF",
|
||||
"frame": "#000",
|
||||
"tab_background_text": "#FFF",
|
||||
};
|
||||
|
||||
const TOOLBAR_MAPPING = {
|
||||
|
@ -142,10 +142,10 @@ add_task(async function browseraction_theme_icons_dark_theme() {
|
|||
|
||||
add_task(async function browseraction_theme_icons_different_toolbars() {
|
||||
let themeData = {
|
||||
"accentcolor": "#000",
|
||||
"textcolor": "#fff",
|
||||
"frame": "#000",
|
||||
"tab_background_text": "#fff",
|
||||
"toolbar": "#fff",
|
||||
"toolbar_text": "#000",
|
||||
"bookmark_text": "#000",
|
||||
};
|
||||
await testStaticTheme({
|
||||
themeData,
|
||||
|
|
|
@ -17,7 +17,7 @@ add_task(async function test_management_themes() {
|
|||
"description": "test theme",
|
||||
"theme": {
|
||||
"images": {
|
||||
"headerURL": "image1.png",
|
||||
"theme_frame": "image1.png",
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
/* globals InspectorUtils */
|
||||
|
||||
// Case 1 - When there is a headerURL image and additional_backgrounds_alignment is not specified.
|
||||
// Case 1 - When there is a theme_frame image and additional_backgrounds_alignment is not specified.
|
||||
// So background-position should default to "right top"
|
||||
add_task(async function test_default_additional_backgrounds_alignment() {
|
||||
const RIGHT_TOP = "100% 0%";
|
||||
|
@ -11,12 +11,12 @@ add_task(async function test_default_additional_backgrounds_alignment() {
|
|||
manifest: {
|
||||
"theme": {
|
||||
"images": {
|
||||
"headerURL": "image1.png",
|
||||
"theme_frame": "image1.png",
|
||||
"additional_backgrounds": ["image1.png", "image1.png"],
|
||||
},
|
||||
"colors": {
|
||||
"accentcolor": ACCENT_COLOR,
|
||||
"textcolor": TEXT_COLOR,
|
||||
"frame": ACCENT_COLOR,
|
||||
"tab_background_text": TEXT_COLOR,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -34,7 +34,7 @@ add_task(async function test_default_additional_backgrounds_alignment() {
|
|||
Assert.equal(
|
||||
rootCS.getPropertyValue("background-position"),
|
||||
RIGHT_TOP,
|
||||
"root only contains headerURL alignment property"
|
||||
"root only contains theme_frame alignment property"
|
||||
);
|
||||
|
||||
|
||||
|
@ -51,7 +51,7 @@ add_task(async function test_default_additional_backgrounds_alignment() {
|
|||
});
|
||||
|
||||
|
||||
// Case 2 - When there is a headerURL image and additional_backgrounds_alignment is specified.
|
||||
// Case 2 - When there is a theme_frame image and additional_backgrounds_alignment is specified.
|
||||
add_task(async function test_additional_backgrounds_alignment() {
|
||||
const LEFT_BOTTOM = "0% 100%";
|
||||
const CENTER_CENTER = "50% 50%";
|
||||
|
@ -61,12 +61,12 @@ add_task(async function test_additional_backgrounds_alignment() {
|
|||
manifest: {
|
||||
"theme": {
|
||||
"images": {
|
||||
"headerURL": "image1.png",
|
||||
"theme_frame": "image1.png",
|
||||
"additional_backgrounds": ["image1.png", "image1.png", "image1.png"],
|
||||
},
|
||||
"colors": {
|
||||
"accentcolor": ACCENT_COLOR,
|
||||
"textcolor": TEXT_COLOR,
|
||||
"frame": ACCENT_COLOR,
|
||||
"tab_background_text": TEXT_COLOR,
|
||||
},
|
||||
"properties": {
|
||||
additional_backgrounds_alignment: ["left bottom", "center center", "right top"],
|
||||
|
@ -87,7 +87,7 @@ add_task(async function test_additional_backgrounds_alignment() {
|
|||
Assert.equal(
|
||||
rootCS.getPropertyValue("background-position"),
|
||||
RIGHT_TOP,
|
||||
"root only contains headerURL alignment property"
|
||||
"root only contains theme_frame alignment property"
|
||||
);
|
||||
|
||||
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
"use strict";
|
||||
|
||||
add_task(async function test_alpha_accentcolor() {
|
||||
add_task(async function test_alpha_frame_color() {
|
||||
let extension = ExtensionTestUtils.loadExtension({
|
||||
manifest: {
|
||||
"theme": {
|
||||
"images": {
|
||||
"headerURL": "image1.png",
|
||||
"theme_frame": "image1.png",
|
||||
},
|
||||
"colors": {
|
||||
"accentcolor": "rgba(230, 128, 0, 0.1)",
|
||||
"textcolor": TEXT_COLOR,
|
||||
"frame": "rgba(230, 128, 0, 0.1)",
|
||||
"tab_background_text": TEXT_COLOR,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
|
@ -24,11 +24,11 @@ add_task(async function test_popup_styling(browser, accDoc) {
|
|||
manifest: {
|
||||
"theme": {
|
||||
"images": {
|
||||
"headerURL": "image1.png",
|
||||
"theme_frame": "image1.png",
|
||||
},
|
||||
"colors": {
|
||||
"accentcolor": ACCENT_COLOR,
|
||||
"textcolor": TEXT_COLOR,
|
||||
"frame": ACCENT_COLOR,
|
||||
"tab_background_text": TEXT_COLOR,
|
||||
"popup": POPUP_BACKGROUND_COLOR,
|
||||
"popup_text": POPUP_TEXT_COLOR,
|
||||
"popup_border": POPUP_BORDER_COLOR,
|
||||
|
|
|
@ -80,11 +80,11 @@ add_task(async function test_popup_url() {
|
|||
manifest: {
|
||||
"theme": {
|
||||
"images": {
|
||||
"headerURL": "image1.png",
|
||||
"theme_frame": "image1.png",
|
||||
},
|
||||
"colors": {
|
||||
"accentcolor": ACCENT_COLOR,
|
||||
"textcolor": TEXT_COLOR,
|
||||
"frame": ACCENT_COLOR,
|
||||
"tab_background_text": TEXT_COLOR,
|
||||
"popup": POPUP_COLOR,
|
||||
"popup_border": POPUP_BORDER_COLOR,
|
||||
"popup_text": POPUP_TEXT_COLOR_DARK,
|
||||
|
@ -179,11 +179,11 @@ add_task(async function test_popup_url() {
|
|||
manifest: {
|
||||
"theme": {
|
||||
"images": {
|
||||
"headerURL": "image1.png",
|
||||
"theme_frame": "image1.png",
|
||||
},
|
||||
"colors": {
|
||||
"accentcolor": ACCENT_COLOR,
|
||||
"textcolor": TEXT_COLOR,
|
||||
"frame": ACCENT_COLOR,
|
||||
"tab_background_text": TEXT_COLOR,
|
||||
"popup": POPUP_COLOR,
|
||||
"popup_text": POPUP_TEXT_COLOR_BRIGHT,
|
||||
"popup_highlight": POPUP_SELECTED_COLOR,
|
||||
|
|
|
@ -19,21 +19,21 @@ add_task(async function test_get_current() {
|
|||
|
||||
const theme1 = {
|
||||
"images": {
|
||||
"headerURL": "image1.png",
|
||||
"theme_frame": "image1.png",
|
||||
},
|
||||
"colors": {
|
||||
"accentcolor": ACCENT_COLOR_1,
|
||||
"textcolor": TEXT_COLOR_1,
|
||||
"frame": ACCENT_COLOR_1,
|
||||
"tab_background_text": TEXT_COLOR_1,
|
||||
},
|
||||
};
|
||||
|
||||
const theme2 = {
|
||||
"images": {
|
||||
"headerURL": "image2.png",
|
||||
"theme_frame": "image2.png",
|
||||
},
|
||||
"colors": {
|
||||
"accentcolor": ACCENT_COLOR_2,
|
||||
"textcolor": TEXT_COLOR_2,
|
||||
"frame": ACCENT_COLOR_2,
|
||||
"tab_background_text": TEXT_COLOR_2,
|
||||
},
|
||||
};
|
||||
|
||||
|
@ -61,26 +61,26 @@ add_task(async function test_get_current() {
|
|||
|
||||
function testTheme1(returnedTheme) {
|
||||
browser.test.assertTrue(
|
||||
returnedTheme.images.headerURL.includes("image1.png"),
|
||||
"Theme 1 header URL should be applied");
|
||||
returnedTheme.images.theme_frame.includes("image1.png"),
|
||||
"Theme 1 theme_frame image should be applied");
|
||||
browser.test.assertEq(
|
||||
ACCENT_COLOR_1, returnedTheme.colors.accentcolor,
|
||||
"Theme 1 accent color should be applied");
|
||||
ACCENT_COLOR_1, returnedTheme.colors.frame,
|
||||
"Theme 1 frame color should be applied");
|
||||
browser.test.assertEq(
|
||||
TEXT_COLOR_1, returnedTheme.colors.textcolor,
|
||||
"Theme 1 text color should be applied");
|
||||
TEXT_COLOR_1, returnedTheme.colors.tab_background_text,
|
||||
"Theme 1 tab_background_text color should be applied");
|
||||
}
|
||||
|
||||
function testTheme2(returnedTheme) {
|
||||
browser.test.assertTrue(
|
||||
returnedTheme.images.headerURL.includes("image2.png"),
|
||||
"Theme 2 header URL should be applied");
|
||||
returnedTheme.images.theme_frame.includes("image2.png"),
|
||||
"Theme 2 theme_frame image should be applied");
|
||||
browser.test.assertEq(
|
||||
ACCENT_COLOR_2, returnedTheme.colors.accentcolor,
|
||||
"Theme 2 accent color should be applied");
|
||||
ACCENT_COLOR_2, returnedTheme.colors.frame,
|
||||
"Theme 2 frame color should be applied");
|
||||
browser.test.assertEq(
|
||||
TEXT_COLOR_2, returnedTheme.colors.textcolor,
|
||||
"Theme 2 text color should be applied");
|
||||
TEXT_COLOR_2, returnedTheme.colors.tab_background_text,
|
||||
"Theme 2 tab_background_text color should be applied");
|
||||
}
|
||||
|
||||
function testEmptyTheme(returnedTheme) {
|
||||
|
|
|
@ -19,46 +19,46 @@ add_task(async function test_on_updated() {
|
|||
|
||||
const theme1 = {
|
||||
"images": {
|
||||
"headerURL": "image1.png",
|
||||
"theme_frame": "image1.png",
|
||||
},
|
||||
"colors": {
|
||||
"accentcolor": ACCENT_COLOR_1,
|
||||
"textcolor": TEXT_COLOR_1,
|
||||
"frame": ACCENT_COLOR_1,
|
||||
"tab_background_text": TEXT_COLOR_1,
|
||||
},
|
||||
};
|
||||
|
||||
const theme2 = {
|
||||
"images": {
|
||||
"headerURL": "image2.png",
|
||||
"theme_frame": "image2.png",
|
||||
},
|
||||
"colors": {
|
||||
"accentcolor": ACCENT_COLOR_2,
|
||||
"textcolor": TEXT_COLOR_2,
|
||||
"frame": ACCENT_COLOR_2,
|
||||
"tab_background_text": TEXT_COLOR_2,
|
||||
},
|
||||
};
|
||||
|
||||
function testTheme1(returnedTheme) {
|
||||
browser.test.assertTrue(
|
||||
returnedTheme.images.headerURL.includes("image1.png"),
|
||||
"Theme 1 header URL should be applied");
|
||||
returnedTheme.images.theme_frame.includes("image1.png"),
|
||||
"Theme 1 theme_frame image should be applied");
|
||||
browser.test.assertEq(
|
||||
ACCENT_COLOR_1, returnedTheme.colors.accentcolor,
|
||||
"Theme 1 accent color should be applied");
|
||||
ACCENT_COLOR_1, returnedTheme.colors.frame,
|
||||
"Theme 1 frame color should be applied");
|
||||
browser.test.assertEq(
|
||||
TEXT_COLOR_1, returnedTheme.colors.textcolor,
|
||||
"Theme 1 text color should be applied");
|
||||
TEXT_COLOR_1, returnedTheme.colors.tab_background_text,
|
||||
"Theme 1 tab_background_text color should be applied");
|
||||
}
|
||||
|
||||
function testTheme2(returnedTheme) {
|
||||
browser.test.assertTrue(
|
||||
returnedTheme.images.headerURL.includes("image2.png"),
|
||||
"Theme 2 header URL should be applied");
|
||||
returnedTheme.images.theme_frame.includes("image2.png"),
|
||||
"Theme 2 theme_frame image should be applied");
|
||||
browser.test.assertEq(
|
||||
ACCENT_COLOR_2, returnedTheme.colors.accentcolor,
|
||||
"Theme 2 accent color should be applied");
|
||||
ACCENT_COLOR_2, returnedTheme.colors.frame,
|
||||
"Theme 2 frame color should be applied");
|
||||
browser.test.assertEq(
|
||||
TEXT_COLOR_2, returnedTheme.colors.textcolor,
|
||||
"Theme 2 text color should be applied");
|
||||
TEXT_COLOR_2, returnedTheme.colors.tab_background_text,
|
||||
"Theme 2 tab_background_text color should be applied");
|
||||
}
|
||||
|
||||
const firstWin = await browser.windows.getCurrent();
|
||||
|
|
|
@ -65,11 +65,11 @@ add_task(async function test_dynamic_theme_updates() {
|
|||
|
||||
extension.sendMessage("update-theme", {
|
||||
"images": {
|
||||
"headerURL": "image1.png",
|
||||
"theme_frame": "image1.png",
|
||||
},
|
||||
"colors": {
|
||||
"accentcolor": ACCENT_COLOR_1,
|
||||
"textcolor": TEXT_COLOR_1,
|
||||
"frame": ACCENT_COLOR_1,
|
||||
"tab_background_text": TEXT_COLOR_1,
|
||||
},
|
||||
});
|
||||
|
||||
|
@ -77,13 +77,15 @@ add_task(async function test_dynamic_theme_updates() {
|
|||
|
||||
validateTheme("image1.png", ACCENT_COLOR_1, TEXT_COLOR_1, true);
|
||||
|
||||
// Check with the LWT aliases (to update on Firefox 69, because the
|
||||
// LWT aliases are going to be removed).
|
||||
extension.sendMessage("update-theme", {
|
||||
"images": {
|
||||
"headerURL": "image2.png",
|
||||
"theme_frame": "image2.png",
|
||||
},
|
||||
"colors": {
|
||||
"accentcolor": ACCENT_COLOR_2,
|
||||
"textcolor": TEXT_COLOR_2,
|
||||
"frame": ACCENT_COLOR_2,
|
||||
"tab_background_text": TEXT_COLOR_2,
|
||||
},
|
||||
});
|
||||
|
||||
|
@ -129,11 +131,11 @@ add_task(async function test_dynamic_theme_updates_with_data_url() {
|
|||
|
||||
extension.sendMessage("update-theme", {
|
||||
"images": {
|
||||
"headerURL": BACKGROUND_1,
|
||||
"theme_frame": BACKGROUND_1,
|
||||
},
|
||||
"colors": {
|
||||
"accentcolor": ACCENT_COLOR_1,
|
||||
"textcolor": TEXT_COLOR_1,
|
||||
"frame": ACCENT_COLOR_1,
|
||||
"tab_background_text": TEXT_COLOR_1,
|
||||
},
|
||||
});
|
||||
|
||||
|
@ -143,11 +145,11 @@ add_task(async function test_dynamic_theme_updates_with_data_url() {
|
|||
|
||||
extension.sendMessage("update-theme", {
|
||||
"images": {
|
||||
"headerURL": BACKGROUND_2,
|
||||
"theme_frame": BACKGROUND_2,
|
||||
},
|
||||
"colors": {
|
||||
"accentcolor": ACCENT_COLOR_2,
|
||||
"textcolor": TEXT_COLOR_2,
|
||||
"frame": ACCENT_COLOR_2,
|
||||
"tab_background_text": TEXT_COLOR_2,
|
||||
},
|
||||
});
|
||||
|
||||
|
|
|
@ -10,13 +10,13 @@ add_task(async function test_support_toolbar_properties_on_findbar() {
|
|||
manifest: {
|
||||
"theme": {
|
||||
"images": {
|
||||
"headerURL": "image1.png",
|
||||
"theme_frame": "image1.png",
|
||||
},
|
||||
"colors": {
|
||||
"accentcolor": ACCENT_COLOR,
|
||||
"textcolor": TEXT_COLOR,
|
||||
"frame": ACCENT_COLOR,
|
||||
"tab_background_text": TEXT_COLOR,
|
||||
"toolbar": TOOLBAR_COLOR,
|
||||
"toolbar_text": TOOLBAR_TEXT_COLOR,
|
||||
"bookmark_text": TOOLBAR_TEXT_COLOR,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -54,11 +54,11 @@ add_task(async function test_support_toolbar_field_properties_on_findbar() {
|
|||
manifest: {
|
||||
"theme": {
|
||||
"images": {
|
||||
"headerURL": "image1.png",
|
||||
"theme_frame": "image1.png",
|
||||
},
|
||||
"colors": {
|
||||
"accentcolor": ACCENT_COLOR,
|
||||
"textcolor": TEXT_COLOR,
|
||||
"frame": ACCENT_COLOR,
|
||||
"tab_background_text": TEXT_COLOR,
|
||||
"toolbar_field": TOOLBAR_FIELD_COLOR,
|
||||
"toolbar_field_text": TOOLBAR_FIELD_TEXT_COLOR,
|
||||
"toolbar_field_border": TOOLBAR_FIELD_BORDER_COLOR,
|
||||
|
|
|
@ -8,11 +8,11 @@ add_task(async function test_getcurrent() {
|
|||
manifest: {
|
||||
"theme": {
|
||||
"images": {
|
||||
"headerURL": "image1.png",
|
||||
"theme_frame": "image1.png",
|
||||
},
|
||||
"colors": {
|
||||
"accentcolor": ACCENT_COLOR,
|
||||
"textcolor": TEXT_COLOR,
|
||||
"frame": ACCENT_COLOR,
|
||||
"tab_background_text": TEXT_COLOR,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -37,12 +37,12 @@ add_task(async function test_getcurrent() {
|
|||
let updatedPromise = extension.awaitMessage("theme-updated");
|
||||
await theme.startup();
|
||||
let receivedTheme = await updatedPromise;
|
||||
Assert.ok(receivedTheme.images.headerURL.includes("image1.png"),
|
||||
"getCurrent returns correct headerURL");
|
||||
Assert.equal(receivedTheme.colors.accentcolor, ACCENT_COLOR,
|
||||
"getCurrent returns correct accentcolor");
|
||||
Assert.equal(receivedTheme.colors.textcolor, TEXT_COLOR,
|
||||
"getCurrent returns correct textcolor");
|
||||
Assert.ok(receivedTheme.images.theme_frame.includes("image1.png"),
|
||||
"getCurrent returns correct theme_frame image");
|
||||
Assert.equal(receivedTheme.colors.frame, ACCENT_COLOR,
|
||||
"getCurrent returns correct frame color");
|
||||
Assert.equal(receivedTheme.colors.tab_background_text, TEXT_COLOR,
|
||||
"getCurrent returns correct tab_background_text color");
|
||||
|
||||
info("Testing getCurrent after static theme unload");
|
||||
updatedPromise = extension.awaitMessage("theme-updated");
|
||||
|
|
|
@ -5,12 +5,12 @@ add_task(async function test_support_backgrounds_position() {
|
|||
manifest: {
|
||||
"theme": {
|
||||
"images": {
|
||||
"headerURL": "face1.png",
|
||||
"theme_frame": "face1.png",
|
||||
"additional_backgrounds": ["face2.png", "face2.png", "face2.png"],
|
||||
},
|
||||
"colors": {
|
||||
"accentcolor": `rgb(${FRAME_COLOR.join(",")})`,
|
||||
"textcolor": `rgb(${TAB_BACKGROUND_TEXT_COLOR.join(",")})`,
|
||||
"frame": `rgb(${FRAME_COLOR.join(",")})`,
|
||||
"tab_background_text": `rgb(${TAB_BACKGROUND_TEXT_COLOR.join(",")})`,
|
||||
},
|
||||
"properties": {
|
||||
"additional_backgrounds_alignment": ["left top", "center top", "right bottom"],
|
||||
|
|
|
@ -87,8 +87,8 @@ add_task(async function test_support_ntp_colors() {
|
|||
await BrowserTestUtils.withNewTab({gBrowser, url}, async browser => {
|
||||
await test_ntp_theme({
|
||||
colors: {
|
||||
accentcolor: ACCENT_COLOR,
|
||||
textcolor: TEXT_COLOR,
|
||||
frame: ACCENT_COLOR,
|
||||
tab_background_text: TEXT_COLOR,
|
||||
ntp_background: "#add8e6",
|
||||
ntp_text: "#00008b",
|
||||
},
|
||||
|
@ -96,8 +96,8 @@ add_task(async function test_support_ntp_colors() {
|
|||
|
||||
await test_ntp_theme({
|
||||
colors: {
|
||||
accentcolor: ACCENT_COLOR,
|
||||
textcolor: TEXT_COLOR,
|
||||
frame: ACCENT_COLOR,
|
||||
tab_background_text: TEXT_COLOR,
|
||||
ntp_background: "#00008b",
|
||||
ntp_text: "#add8e6",
|
||||
},
|
||||
|
|
|
@ -103,8 +103,8 @@ add_task(async function test_per_window_ntp_theme() {
|
|||
|
||||
const darkTextTheme = {
|
||||
colors: {
|
||||
accentcolor: "#add8e6",
|
||||
textcolor: "#000",
|
||||
frame: "#add8e6",
|
||||
tab_background_text: "#000",
|
||||
ntp_background: "#add8e6",
|
||||
ntp_text: "#000",
|
||||
},
|
||||
|
@ -112,8 +112,8 @@ add_task(async function test_per_window_ntp_theme() {
|
|||
|
||||
const brightTextTheme = {
|
||||
colors: {
|
||||
accentcolor: "#00008b",
|
||||
textcolor: "#add8e6",
|
||||
frame: "#00008b",
|
||||
tab_background_text: "#add8e6",
|
||||
ntp_background: "#00008b",
|
||||
ntp_text: "#add8e6",
|
||||
},
|
||||
|
|
|
@ -8,11 +8,11 @@ add_task(async function test_multiple_windows() {
|
|||
manifest: {
|
||||
"theme": {
|
||||
"images": {
|
||||
"headerURL": "image1.png",
|
||||
"theme_frame": "image1.png",
|
||||
},
|
||||
"colors": {
|
||||
"accentcolor": ACCENT_COLOR,
|
||||
"textcolor": TEXT_COLOR,
|
||||
"frame": ACCENT_COLOR,
|
||||
"tab_background_text": TEXT_COLOR,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
|
@ -8,9 +8,9 @@ add_task(async function test_sanitization_invalid() {
|
|||
manifest: {
|
||||
"theme": {
|
||||
"colors": {
|
||||
"accentcolor": ACCENT_COLOR,
|
||||
"textcolor": TEXT_COLOR,
|
||||
"toolbar_text": "ntimsfavoriteblue",
|
||||
"frame": ACCENT_COLOR,
|
||||
"tab_background_text": TEXT_COLOR,
|
||||
"bookmark_text": "ntimsfavoriteblue",
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -34,9 +34,9 @@ add_task(async function test_sanitization_css_variables() {
|
|||
manifest: {
|
||||
"theme": {
|
||||
"colors": {
|
||||
"accentcolor": ACCENT_COLOR,
|
||||
"textcolor": TEXT_COLOR,
|
||||
"toolbar_text": "var(--arrowpanel-dimmed)",
|
||||
"frame": ACCENT_COLOR,
|
||||
"tab_background_text": TEXT_COLOR,
|
||||
"bookmark_text": "var(--arrowpanel-dimmed)",
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -60,8 +60,8 @@ add_task(async function test_sanitization_transparent() {
|
|||
manifest: {
|
||||
"theme": {
|
||||
"colors": {
|
||||
"accentcolor": ACCENT_COLOR,
|
||||
"textcolor": TEXT_COLOR,
|
||||
"frame": ACCENT_COLOR,
|
||||
"tab_background_text": TEXT_COLOR,
|
||||
"toolbar_top_separator": "transparent",
|
||||
},
|
||||
},
|
||||
|
@ -79,14 +79,14 @@ add_task(async function test_sanitization_transparent() {
|
|||
await extension.unload();
|
||||
});
|
||||
|
||||
add_task(async function test_sanitization_transparent_accentcolor() {
|
||||
// This test checks whether transparent accentcolor falls back to white.
|
||||
add_task(async function test_sanitization_transparent_frame_color() {
|
||||
// This test checks whether transparent frame color falls back to white.
|
||||
let extension = ExtensionTestUtils.loadExtension({
|
||||
manifest: {
|
||||
"theme": {
|
||||
"colors": {
|
||||
"accentcolor": "transparent",
|
||||
"textcolor": TEXT_COLOR,
|
||||
"frame": "transparent",
|
||||
"tab_background_text": TEXT_COLOR,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -104,14 +104,14 @@ add_task(async function test_sanitization_transparent_accentcolor() {
|
|||
await extension.unload();
|
||||
});
|
||||
|
||||
add_task(async function test_sanitization_transparent_textcolor() {
|
||||
add_task(async function test_sanitization_transparent_tab_background_text_color() {
|
||||
// This test checks whether transparent textcolor falls back to black.
|
||||
let extension = ExtensionTestUtils.loadExtension({
|
||||
manifest: {
|
||||
"theme": {
|
||||
"colors": {
|
||||
"accentcolor": ACCENT_COLOR,
|
||||
"textcolor": "transparent",
|
||||
"frame": ACCENT_COLOR,
|
||||
"tab_background_text": "transparent",
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
|
@ -13,11 +13,11 @@ add_task(async function test_support_separator_properties() {
|
|||
manifest: {
|
||||
"theme": {
|
||||
"images": {
|
||||
"headerURL": "image1.png",
|
||||
"theme_frame": "image1.png",
|
||||
},
|
||||
"colors": {
|
||||
"accentcolor": ACCENT_COLOR,
|
||||
"textcolor": TEXT_COLOR,
|
||||
"frame": ACCENT_COLOR,
|
||||
"tab_background_text": TEXT_COLOR,
|
||||
"toolbar_top_separator": SEPARATOR_TOP_COLOR,
|
||||
"toolbar_vertical_separator": SEPARATOR_VERTICAL_COLOR,
|
||||
"toolbar_field_separator": SEPARATOR_FIELD_COLOR,
|
||||
|
|
|
@ -8,11 +8,11 @@ add_task(async function test_on_updated() {
|
|||
manifest: {
|
||||
"theme": {
|
||||
"images": {
|
||||
"headerURL": "image1.png",
|
||||
"theme_frame": "image1.png",
|
||||
},
|
||||
"colors": {
|
||||
"accentcolor": ACCENT_COLOR,
|
||||
"textcolor": TEXT_COLOR,
|
||||
"frame": ACCENT_COLOR,
|
||||
"tab_background_text": TEXT_COLOR,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -36,12 +36,12 @@ add_task(async function test_on_updated() {
|
|||
await theme.startup();
|
||||
const {theme: receivedTheme, windowId} = await updatedPromise;
|
||||
Assert.ok(!windowId, "No window id in static theme update event");
|
||||
Assert.ok(receivedTheme.images.headerURL.includes("image1.png"),
|
||||
"Theme header URL should be applied");
|
||||
Assert.equal(receivedTheme.colors.accentcolor, ACCENT_COLOR,
|
||||
"Theme accent color should be applied");
|
||||
Assert.equal(receivedTheme.colors.textcolor, TEXT_COLOR,
|
||||
"Theme text color should be applied");
|
||||
Assert.ok(receivedTheme.images.theme_frame.includes("image1.png"),
|
||||
"Theme theme_frame image should be applied");
|
||||
Assert.equal(receivedTheme.colors.frame, ACCENT_COLOR,
|
||||
"Theme frame color should be applied");
|
||||
Assert.equal(receivedTheme.colors.tab_background_text, TEXT_COLOR,
|
||||
"Theme tab_background_text color should be applied");
|
||||
|
||||
info("Testing update event on static theme unload");
|
||||
updatedPromise = extension.awaitMessage("theme-updated");
|
||||
|
|
|
@ -9,8 +9,8 @@ add_task(async function test_support_tab_line() {
|
|||
manifest: {
|
||||
"theme": {
|
||||
"colors": {
|
||||
"accentcolor": ACCENT_COLOR,
|
||||
"textcolor": TEXT_COLOR,
|
||||
"frame": ACCENT_COLOR,
|
||||
"tab_background_text": TEXT_COLOR,
|
||||
"tab_line": TAB_LINE_COLOR,
|
||||
},
|
||||
},
|
||||
|
|
|
@ -8,12 +8,12 @@ add_task(async function test_support_tab_loading_filling() {
|
|||
manifest: {
|
||||
"theme": {
|
||||
"images": {
|
||||
"headerURL": "image1.png",
|
||||
"theme_frame": "image1.png",
|
||||
},
|
||||
"colors": {
|
||||
"accentcolor": "#000",
|
||||
"frame": "#000",
|
||||
"toolbar": "#124455",
|
||||
"textcolor": TAB_TEXT_COLOR,
|
||||
"tab_background_text": TAB_TEXT_COLOR,
|
||||
"tab_loading": TAB_LOADING_COLOR,
|
||||
},
|
||||
},
|
||||
|
|
|
@ -9,8 +9,8 @@ add_task(async function test_tab_background_color_property() {
|
|||
manifest: {
|
||||
"theme": {
|
||||
"colors": {
|
||||
"accentcolor": ACCENT_COLOR,
|
||||
"textcolor": TEXT_COLOR,
|
||||
"frame": ACCENT_COLOR,
|
||||
"tab_background_text": TEXT_COLOR,
|
||||
"tab_selected": TAB_BACKGROUND_COLOR,
|
||||
},
|
||||
},
|
||||
|
|
|
@ -7,8 +7,8 @@ add_task(async function test_support_tab_separators() {
|
|||
manifest: {
|
||||
"theme": {
|
||||
"colors": {
|
||||
"accentcolor": "#000",
|
||||
"textcolor": "#9400ff",
|
||||
"frame": "#000",
|
||||
"tab_background_text": "#9400ff",
|
||||
"tab_background_separator": TAB_SEPARATOR_COLOR,
|
||||
},
|
||||
},
|
||||
|
|
|
@ -9,11 +9,11 @@ add_task(async function test_support_tab_text_property_css_color() {
|
|||
manifest: {
|
||||
"theme": {
|
||||
"images": {
|
||||
"headerURL": "image1.png",
|
||||
"theme_frame": "image1.png",
|
||||
},
|
||||
"colors": {
|
||||
"accentcolor": ACCENT_COLOR,
|
||||
"textcolor": TEXT_COLOR,
|
||||
"frame": ACCENT_COLOR,
|
||||
"tab_background_text": TEXT_COLOR,
|
||||
"tab_text": TAB_TEXT_COLOR,
|
||||
},
|
||||
},
|
||||
|
@ -40,11 +40,11 @@ add_task(async function test_support_tab_text_chrome_array() {
|
|||
manifest: {
|
||||
"theme": {
|
||||
"images": {
|
||||
"headerURL": "image1.png",
|
||||
"theme_frame": "image1.png",
|
||||
},
|
||||
"colors": {
|
||||
"accentcolor": FRAME_COLOR,
|
||||
"textcolor": TAB_BACKGROUND_TEXT_COLOR,
|
||||
"frame": FRAME_COLOR,
|
||||
"tab_background_text": TAB_BACKGROUND_TEXT_COLOR,
|
||||
"tab_text": TAB_TEXT_COLOR,
|
||||
},
|
||||
},
|
||||
|
|
|
@ -12,9 +12,9 @@ add_task(async function test_theme_transition_effects() {
|
|||
manifest: {
|
||||
"theme": {
|
||||
"colors": {
|
||||
"textcolor": TEXT_COLOR,
|
||||
"tab_background_text": TEXT_COLOR,
|
||||
"toolbar": TOOLBAR,
|
||||
"toolbar_text": TEXT_COLOR,
|
||||
"bookmark_text": TEXT_COLOR,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
|
@ -23,11 +23,11 @@ add_task(async function test_support_toolbar_field_properties() {
|
|||
manifest: {
|
||||
"theme": {
|
||||
"images": {
|
||||
"headerURL": "image1.png",
|
||||
"theme_frame": "image1.png",
|
||||
},
|
||||
"colors": {
|
||||
"accentcolor": ACCENT_COLOR,
|
||||
"textcolor": TEXT_COLOR,
|
||||
"frame": ACCENT_COLOR,
|
||||
"tab_background_text": TEXT_COLOR,
|
||||
"toolbar_field": TOOLBAR_FIELD_BACKGROUND,
|
||||
"toolbar_field_text": TOOLBAR_FIELD_COLOR,
|
||||
"toolbar_field_border": TOOLBAR_FIELD_BORDER,
|
||||
|
@ -88,8 +88,8 @@ add_task(async function test_support_toolbar_field_brighttext() {
|
|||
manifest: {
|
||||
"theme": {
|
||||
"colors": {
|
||||
"accentcolor": ACCENT_COLOR,
|
||||
"textcolor": TEXT_COLOR,
|
||||
"frame": ACCENT_COLOR,
|
||||
"tab_background_text": TEXT_COLOR,
|
||||
"toolbar_field": "#fff",
|
||||
"toolbar_field_text": "#000",
|
||||
},
|
||||
|
@ -110,8 +110,8 @@ add_task(async function test_support_toolbar_field_brighttext() {
|
|||
manifest: {
|
||||
"theme": {
|
||||
"colors": {
|
||||
"accentcolor": ACCENT_COLOR,
|
||||
"textcolor": TEXT_COLOR,
|
||||
"frame": ACCENT_COLOR,
|
||||
"tab_background_text": TEXT_COLOR,
|
||||
"toolbar_field": "#000",
|
||||
"toolbar_field_text": "#fff",
|
||||
},
|
||||
|
|
|
@ -11,8 +11,8 @@ add_task(async function test_toolbar_field_hover() {
|
|||
manifest: {
|
||||
"theme": {
|
||||
"colors": {
|
||||
"accentcolor": "#FF0000",
|
||||
"textcolor": "#ffffff",
|
||||
"frame": "#FF0000",
|
||||
"tab_background_color": "#ffffff",
|
||||
"toolbar_field": TOOLBAR_FIELD_BACKGROUND,
|
||||
"toolbar_field_text": TOOLBAR_FIELD_COLOR,
|
||||
"toolbar_field_focus": TOOLBAR_FOCUS_BACKGROUND,
|
||||
|
|
|
@ -13,11 +13,11 @@ add_task(async function test_button_background_properties() {
|
|||
manifest: {
|
||||
"theme": {
|
||||
"images": {
|
||||
"headerURL": "image1.png",
|
||||
"theme_frame": "image1.png",
|
||||
},
|
||||
"colors": {
|
||||
"accentcolor": ACCENT_COLOR,
|
||||
"textcolor": TEXT_COLOR,
|
||||
"frame": ACCENT_COLOR,
|
||||
"tab_background_text": TEXT_COLOR,
|
||||
"button_background_active": BUTTON_BACKGROUND_ACTIVE,
|
||||
"button_background_hover": BUTTON_BACKGROUND_HOVER,
|
||||
},
|
||||
|
|
|
@ -11,11 +11,11 @@ add_task(async function test_icons_properties() {
|
|||
manifest: {
|
||||
"theme": {
|
||||
"images": {
|
||||
"headerURL": "image1.png",
|
||||
"theme_frame": "image1.png",
|
||||
},
|
||||
"colors": {
|
||||
"accentcolor": ACCENT_COLOR,
|
||||
"textcolor": TEXT_COLOR,
|
||||
"frame": ACCENT_COLOR,
|
||||
"tab_background_text": TEXT_COLOR,
|
||||
"icons": ICONS_COLOR,
|
||||
"icons_attention": ICONS_ATTENTION_COLOR,
|
||||
},
|
||||
|
@ -60,11 +60,11 @@ add_task(async function test_no_icons_properties() {
|
|||
manifest: {
|
||||
"theme": {
|
||||
"images": {
|
||||
"headerURL": "image1.png",
|
||||
"theme_frame": "image1.png",
|
||||
},
|
||||
"colors": {
|
||||
"accentcolor": ACCENT_COLOR,
|
||||
"textcolor": TEXT_COLOR,
|
||||
"frame": ACCENT_COLOR,
|
||||
"tab_background_text": TEXT_COLOR,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
|
@ -10,9 +10,11 @@ add_task(async function test_support_toolbar_property() {
|
|||
manifest: {
|
||||
"theme": {
|
||||
"colors": {
|
||||
"accentcolor": ACCENT_COLOR,
|
||||
"textcolor": TEXT_COLOR,
|
||||
"frame": ACCENT_COLOR,
|
||||
"tab_background_text": TEXT_COLOR,
|
||||
"toolbar": TOOLBAR_COLOR,
|
||||
// NOTE: this property is going to be removed on Firefox 69
|
||||
// (and bookmark_text is going to replace it).
|
||||
"toolbar_text": TOOLBAR_TEXT_COLOR,
|
||||
},
|
||||
},
|
||||
|
|
Загрузка…
Ссылка в новой задаче