|
| 1 | +script "HeaderBarWidgetProperties" |
| 2 | +/* |
| 3 | +Copyright (C) 2015 LiveCode Ltd. |
| 4 | +
|
| 5 | +This file is part of LiveCode. |
| 6 | +
|
| 7 | +LiveCode is free software; you can redistribute it and/or modify it under |
| 8 | +the terms of the GNU General Public License v3 as published by the Free |
| 9 | +Software Foundation. |
| 10 | +
|
| 11 | +LiveCode is distributed in the hope that it will be useful, but WITHOUT ANY |
| 12 | +WARRANTY; without even the implied warranty of MERCHANTABILITY or |
| 13 | +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
| 14 | +for more details. |
| 15 | +
|
| 16 | +You should have received a copy of the GNU General Public License |
| 17 | +along with LiveCode. If not see <http://www.gnu.org/licenses/>. */ |
| 18 | + |
| 19 | +on TestSetup |
| 20 | + TestLoadExtension "com.livecode.library.widgetutils" |
| 21 | + TestLoadExtension "com.livecode.library.iconSVG" |
| 22 | + TestLoadExtension "com.livecode.widget.headerBar" |
| 23 | + create widget "testHeader" as "com.livecode.widget.headerBar" |
| 24 | +end TestSetup |
| 25 | + |
| 26 | +on TestTeardown |
| 27 | + delete widget "testHeader" |
| 28 | +end TestTeardown |
| 29 | + |
| 30 | +on TestCreateHeader |
| 31 | + TestAssert "created header exists", there is a widget "testHeader" |
| 32 | +end TestCreateHeader |
| 33 | + |
| 34 | +on TestSetTheme |
| 35 | + set the widgetTheme of widget "testHeader" to "Android" |
| 36 | + TestAssert "theme set to Android", the widgetTheme of widget "testHeader" is "Android" |
| 37 | + |
| 38 | + set the widgetTheme of widget "testHeader" to "iOS" |
| 39 | + TestAssert "theme set to iOS", the widgetTheme of widget "testHeader" is "iOS" |
| 40 | +end TestSetTheme |
| 41 | + |
| 42 | +on TestSetBGOpacity |
| 43 | + set the backgroundOpacity of widget "testHeader" to false |
| 44 | + TestAssert "set backgroundOpacity to false", the backgroundOpacity of widget "testHeader" is false |
| 45 | + |
| 46 | + set the backgroundOpacity of widget "testHeader" to true |
| 47 | + TestAssert "set backgroundOpacity to false", the backgroundOpacity of widget "testHeader" is true |
| 48 | +end TestSetBGOpacity |
| 49 | + |
| 50 | +on TestSetActionStyle |
| 51 | + set the actionStyle of widget "testHeader" to "names" |
| 52 | + TestAssert "actionStyle set to names", the actionStyle of widget "testHeader" is "names" |
| 53 | + |
| 54 | + set the actionStyle of widget "testHeader" to "icons" |
| 55 | + TestAssert "actionStyle set to icons", the actionStyle of widget "testHeader" is "icons" |
| 56 | +end TestSetActionStyle |
| 57 | + |
0 commit comments