diff options
author | Mitch Curtis <mitch.curtis@theqtcompany.com> | 2015-11-27 09:56:12 +0100 |
---|---|---|
committer | Mitch Curtis <mitch.curtis@theqtcompany.com> | 2015-11-27 11:37:11 +0000 |
commit | 7031e85adf44355b56a5ec740ab26a7eb3d8f740 (patch) | |
tree | 87e198e88ead8d1b94567ce0bfcea71d99b847e3 /tests | |
parent | bb807b32b7e85bc4ae5c2d2b7c627e0e2bde90ff (diff) |
Remove Theme
Given the presence of alternative styles, we'd like to focus on making
the default style as performant as possible. Removing Theme usage
is a step towards this.
Change-Id: I8f76dc98442e6c02703885591a44758f40c7a362
Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/auto.pro | 1 | ||||
-rw-r--r-- | tests/auto/theme/data/tst_theme.qml | 295 | ||||
-rw-r--r-- | tests/auto/theme/theme.pro | 12 | ||||
-rw-r--r-- | tests/auto/theme/tst_theme.cpp | 38 |
4 files changed, 0 insertions, 346 deletions
diff --git a/tests/auto/auto.pro b/tests/auto/auto.pro index 98ea6f6c..cd287eeb 100644 --- a/tests/auto/auto.pro +++ b/tests/auto/auto.pro @@ -9,5 +9,4 @@ SUBDIRS += \ sanity \ snippets \ styles \ - theme \ universal diff --git a/tests/auto/theme/data/tst_theme.qml b/tests/auto/theme/data/tst_theme.qml deleted file mode 100644 index 03c19fc6..00000000 --- a/tests/auto/theme/data/tst_theme.qml +++ /dev/null @@ -1,295 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.2 -import QtQuick.Window 2.2 -import QtTest 1.0 -import Qt.labs.controls 1.0 - -TestCase { - id: testCase - width: 200 - height: 200 - visible: true - when: windowShown - name: "Theme" - - Component { - id: button - Button { } - } - - Component { - id: themedButton - Button { - Theme.accentColor: "#111111" - Theme.backgroundColor: "#222222" - Theme.baseColor: "#333333" - Theme.disabledColor: "#aaaaaa" - Theme.focusColor: "#444444" - Theme.frameColor: "#555555" - Theme.pressColor: "#666666" - Theme.selectedTextColor: "#777777" - Theme.selectionColor: "#888888" - Theme.textColor: "#999999" - } - } - - Component { - id: window - Window { } - } - - Component { - id: themedWindow - Window { - Theme.accentColor: "#111111" - Theme.backgroundColor: "#222222" - Theme.baseColor: "#333333" - Theme.disabledColor: "#aaaaaa" - Theme.focusColor: "#444444" - Theme.frameColor: "#555555" - Theme.pressColor: "#666666" - Theme.selectedTextColor: "#777777" - Theme.selectionColor: "#888888" - Theme.textColor: "#999999" - } - } - - Component { - id: loader - Loader { - active: false - sourceComponent: Button { } - } - } - - Component { - id: swipeView - SwipeView { - Theme.accentColor: "#111111" - Button { } - } - } - - function test_defaults() { - var control = button.createObject(testCase) - verify(control) - verify(control.Theme) - verify(control.Theme.accentColor !== undefined) - verify(control.Theme.backgroundColor !== undefined) - verify(control.Theme.baseColor !== undefined) - verify(control.Theme.disabledColor !== undefined) - verify(control.Theme.focusColor !== undefined) - verify(control.Theme.frameColor !== undefined) - verify(control.Theme.pressColor !== undefined) - verify(control.Theme.selectedTextColor !== undefined) - verify(control.Theme.selectionColor !== undefined) - verify(control.Theme.textColor !== undefined) - control.destroy() - } - - function test_set() { - var control = button.createObject(testCase) - verify(control) - control.Theme.accentColor = "#111111" - control.Theme.backgroundColor = "#222222" - control.Theme.baseColor = "#333333" - control.Theme.disabledColor = "#aaaaaa" - control.Theme.focusColor = "#444444" - control.Theme.frameColor = "#555555" - control.Theme.pressColor = "#666666" - control.Theme.selectedTextColor = "#777777" - control.Theme.selectionColor = "#888888" - control.Theme.textColor = "#999999" - compare(control.Theme.accentColor, "#111111") - compare(control.Theme.backgroundColor, "#222222") - compare(control.Theme.baseColor, "#333333") - compare(control.Theme.disabledColor, "#aaaaaa") - compare(control.Theme.focusColor, "#444444") - compare(control.Theme.frameColor, "#555555") - compare(control.Theme.pressColor, "#666666") - compare(control.Theme.selectedTextColor, "#777777") - compare(control.Theme.selectionColor, "#888888") - compare(control.Theme.textColor, "#999999") - control.destroy() - } - - function test_reset() { - var control = themedButton.createObject(testCase) - verify(control) - compare(control.Theme.accentColor, "#111111") - compare(control.Theme.backgroundColor, "#222222") - compare(control.Theme.baseColor, "#333333") - compare(control.Theme.disabledColor, "#aaaaaa") - compare(control.Theme.focusColor, "#444444") - compare(control.Theme.frameColor, "#555555") - compare(control.Theme.pressColor, "#666666") - compare(control.Theme.selectedTextColor, "#777777") - compare(control.Theme.selectionColor, "#888888") - compare(control.Theme.textColor, "#999999") - control.Theme.accentColor = undefined - control.Theme.backgroundColor = undefined - control.Theme.baseColor = undefined - control.Theme.disabledColor = undefined - control.Theme.focusColor = undefined - control.Theme.frameColor = undefined - control.Theme.pressColor = undefined - control.Theme.selectedTextColor = undefined - control.Theme.selectionColor = undefined - control.Theme.textColor = undefined - compare(control.Theme.accentColor, testCase.Theme.accentColor) - compare(control.Theme.backgroundColor, testCase.Theme.backgroundColor) - compare(control.Theme.baseColor, testCase.Theme.baseColor) - compare(control.Theme.disabledColor, testCase.Theme.disabledColor) - compare(control.Theme.focusColor, testCase.Theme.focusColor) - compare(control.Theme.frameColor, testCase.Theme.frameColor) - compare(control.Theme.pressColor, testCase.Theme.pressColor) - compare(control.Theme.selectedTextColor, testCase.Theme.selectedTextColor) - compare(control.Theme.selectionColor, testCase.Theme.selectionColor) - compare(control.Theme.textColor, testCase.Theme.textColor) - control.destroy() - } - - function test_inheritance_data() { - return [ - { tag: "accentColor", value1: "#111111", value2: "#101010" }, - { tag: "backgroundColor", value1: "#222222", value2: "#202020" }, - { tag: "baseColor", value1: "#333333", value2: "#303030" }, - { tag: "disabledColor", value1: "#aaaaaa", value2: "#a0a0a0" }, - { tag: "focusColor", value1: "#444444", value2: "#404040" }, - { tag: "frameColor", value1: "#555555", value2: "#505050" }, - { tag: "pressColor", value1: "#666666", value2: "#606060" }, - { tag: "selectedTextColor", value1: "#777777", value2: "#707070" }, - { tag: "selectionColor", value1: "#888888", value2: "#808080" }, - { tag: "textColor", value1: "#999999", value2: "#909090" } - ] - } - - function test_inheritance(data) { - var prop = data.tag - var parent = button.createObject(testCase) - parent.Theme[prop] = data.value1 - compare(parent.Theme[prop], data.value1) - - var child1 = button.createObject(parent) - compare(child1.Theme[prop], data.value1) - - parent.Theme[prop] = data.value2 - compare(parent.Theme[prop], data.value2) - compare(child1.Theme[prop], data.value2) - - var child2 = button.createObject(parent) - compare(child2.Theme[prop], data.value2) - - child2.Theme[prop] = data.value1 - compare(child2.Theme[prop], data.value1) - compare(child1.Theme[prop], data.value2) - compare(parent.Theme[prop], data.value2) - - parent.Theme[prop] = undefined - verify(parent.Theme[prop] !== data.value1) - verify(parent.Theme[prop] !== data.value2) - verify(parent.Theme[prop] !== undefined) - compare(child1.Theme[prop], parent.Theme[prop]) - verify(child2.Theme[prop] !== parent.Theme[prop]) - - var grandChild1 = button.createObject(child1) - var grandChild2 = button.createObject(child2) - compare(grandChild1.Theme[prop], child1.Theme[prop]) - compare(grandChild2.Theme[prop], child2.Theme[prop]) - - var themelessGrandGrandChild = button.createObject(grandChild1) - var grandGrandGrandChild1 = button.createObject(themelessGrandGrandChild) - compare(grandGrandGrandChild1.Theme[prop], parent.Theme[prop]) - - child1.Theme[prop] = data.value2 - verify(parent.Theme[prop] !== data.value2) - compare(child1.Theme[prop], data.value2) - compare(grandChild1.Theme[prop], data.value2) - compare(grandGrandGrandChild1.Theme[prop], data.value2) - - parent.destroy() - } - - function test_window() { - var parent = window.createObject() - - var control = button.createObject(parent.contentItem) - compare(control.Theme.backgroundColor, parent.Theme.backgroundColor) - - var themedChild = themedWindow.createObject(window) - verify(themedChild.Theme.backgroundColor !== parent.Theme.backgroundColor) - - var unthemedChild = window.createObject(window) - compare(unthemedChild.Theme.backgroundColor, parent.Theme.backgroundColor) - - parent.Theme.backgroundColor = "#123456" - compare(control.Theme.backgroundColor, "#123456") - verify(themedChild.Theme.backgroundColor !== "#123456") - // ### FIXME: compare(unthemedChild.Theme.backgroundColor, "#123456") - - parent.destroy() - } - - function test_loader() { - var control = loader.createObject(testCase) - control.Theme.accentColor = "#111111" - control.active = true - compare(control.item.Theme.accentColor, "#111111") - control.Theme.accentColor = "#222222" - compare(control.item.Theme.accentColor, "#222222") - control.active = false - control.Theme.accentColor = "#333333" - control.active = true - compare(control.item.Theme.accentColor, "#333333") - control.destroy() - } - - function test_swipeView() { - var control = swipeView.createObject(testCase) - verify(control) - var child = control.itemAt(0) - verify(child) - compare(control.Theme.accentColor, "#111111") - compare(child.Theme.accentColor, "#111111") - control.destroy() - } -} diff --git a/tests/auto/theme/theme.pro b/tests/auto/theme/theme.pro deleted file mode 100644 index e8d1133a..00000000 --- a/tests/auto/theme/theme.pro +++ /dev/null @@ -1,12 +0,0 @@ -TEMPLATE = app -TARGET = tst_theme -CONFIG += qmltestcase - -SOURCES += \ - $$PWD/tst_theme.cpp - -OTHER_FILES += \ - $$PWD/data/* - -TESTDATA += \ - $$PWD/data/tst_* diff --git a/tests/auto/theme/tst_theme.cpp b/tests/auto/theme/tst_theme.cpp deleted file mode 100644 index 786a9b53..00000000 --- a/tests/auto/theme/tst_theme.cpp +++ /dev/null @@ -1,38 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPLv3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include <QtQuickTest/quicktest.h> -QUICK_TEST_MAIN(tst_theme) |