aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2016-05-31 14:05:40 +0200
committerLiang Qi <liang.qi@qt.io>2016-06-01 08:23:57 +0000
commitceaf6177a8be6db22e629ff05a625e278025b071 (patch)
tree7f22aa01fae7fea37ed7a42af6e2f50bebf9384c /tests
parent260015a26b8d368fef3559a0e47a8a3928ce9044 (diff)
tests: fix accent and background color in tst_material
They are also affected by theme. Note: dev CI could verify this. Task-number: QTBUG-53556 Change-Id: Id7cecab2baafe91b198b20f92bb881cc4b531807 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/material/data/tst_material.qml24
1 files changed, 16 insertions, 8 deletions
diff --git a/tests/auto/material/data/tst_material.qml b/tests/auto/material/data/tst_material.qml
index 2e7390c2..593b5ccb 100644
--- a/tests/auto/material/data/tst_material.qml
+++ b/tests/auto/material/data/tst_material.qml
@@ -162,6 +162,14 @@ TestCase {
}
}
+ // need to be synced with QQuickMaterialStyle::themeShade()
+ function themeshade(theme) {
+ if (theme === Material.Light)
+ return Material.Shade500
+ else
+ return Material.Shade200
+ }
+
function test_defaults() {
var control = button.createObject(testCase)
verify(control)
@@ -183,8 +191,8 @@ TestCase {
control.Material.foreground = Material.Blue
control.Material.theme = Material.Dark
compare(control.Material.primary, Material.color(Material.Green))
- compare(control.Material.accent, Material.color(Material.Brown))
- compare(control.Material.background, Material.color(Material.Red))
+ compare(control.Material.accent, Material.color(Material.Brown, themeshade(control.Material.theme)))
+ compare(control.Material.background, Material.color(Material.Red, themeshade(control.Material.theme)))
compare(control.Material.foreground, Material.color(Material.Blue))
compare(control.Material.theme, Material.Dark)
control.destroy()
@@ -194,8 +202,8 @@ TestCase {
var control = styledButton.createObject(testCase)
verify(control)
compare(control.Material.primary, Material.color(Material.DeepOrange))
- compare(control.Material.accent, Material.color(Material.DeepPurple))
- compare(control.Material.background, Material.color(Material.Green))
+ compare(control.Material.accent, Material.color(Material.DeepPurple, themeshade(control.Material.theme)))
+ compare(control.Material.background, Material.color(Material.Green, themeshade(control.Material.theme)))
compare(control.Material.foreground, Material.color(Material.Blue))
compare(control.Material.theme, Material.Dark)
control.Material.primary = undefined
@@ -396,8 +404,8 @@ TestCase {
compare(container.menu.Material.primary, Material.color(Material.Blue))
compare(child.Material.primary, Material.color(Material.Blue))
compare(container.Material.accent, Material.color(Material.Red))
- compare(container.menu.Material.accent, Material.color(Material.Red))
- compare(child.Material.accent, Material.color(Material.Red))
+ compare(container.menu.Material.accent, Material.color(Material.Red, themeshade(container.menu.Material.theme)))
+ compare(child.Material.accent, Material.color(Material.Red, themeshade(child.Material.theme)))
container.destroy()
}
@@ -421,8 +429,8 @@ TestCase {
compare(window.combo.Material.primary, Material.color(Material.Blue))
compare(child.Material.primary, Material.color(Material.Blue))
compare(window.Material.accent, Material.color(Material.Red))
- compare(window.combo.Material.accent, Material.color(Material.Red))
- compare(child.Material.accent, Material.color(Material.Red))
+ compare(window.combo.Material.accent, Material.color(Material.Red, themeshade(window.combo.Material.theme)))
+ compare(child.Material.accent, Material.color(Material.Red, themeshade(child.Material.theme)))
window.destroy()
}