aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qquickmaterialstyle
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/qquickmaterialstyle')
-rw-r--r--tests/auto/qquickmaterialstyle/data/tst_material.qml40
1 files changed, 40 insertions, 0 deletions
diff --git a/tests/auto/qquickmaterialstyle/data/tst_material.qml b/tests/auto/qquickmaterialstyle/data/tst_material.qml
index 1cd1d16d..727de2e4 100644
--- a/tests/auto/qquickmaterialstyle/data/tst_material.qml
+++ b/tests/auto/qquickmaterialstyle/data/tst_material.qml
@@ -629,4 +629,44 @@ TestCase {
appWindow.destroy()
}
+
+ Component {
+ id: popups
+ ApplicationWindow {
+ id: window
+ property Drawer drawer: Drawer { parent: window.contentItem }
+ property Menu menu: Menu { parent: window.contentItem; visible: true }
+ property Popup popup: Popup { parent: window.contentItem; visible: true }
+ property ToolTip tooltip: ToolTip { parent: window.contentItem; visible: true }
+ }
+ }
+
+ function test_popupBackground_data() {
+ return [
+ { tag: "drawer", inherit: true },
+ { tag: "menu", inherit: true },
+ { tag: "popup", inherit: true },
+ { tag: "tooltip", inherit: false }
+ ]
+ }
+
+ function test_popupBackground(data) {
+ var window = popups.createObject(testCase)
+ verify(window)
+
+ var control = window[data.tag]
+ verify(control)
+
+ window.Material.background = "#ff0000"
+ compare(window.color, "#ff0000")
+ if (data.inherit)
+ compare(control.background.color, "#ff0000")
+ else
+ verify(control.background !== "#ff0000")
+
+ control.Material.background = "#0000ff"
+ compare(control.background.color, "#0000ff")
+
+ window.destroy()
+ }
}