Author: ben
Date: 2007-08-09 15:26:40 -0700 (Thu, 09 Aug 2007)
New Revision: 5989
Modified:
openlaszlo/branches/wafflecone/lps/components/incubator/rich-text/test/test-lzcombobox.lzx
Log:
Change 20070809-ben-F by [EMAIL PROTECTED] on 2007-08-09 15:24:45 PDT
in /Users/ben/src/svn/openlaszlo/branches/wafflecone
for http://svn.openlaszlo.org/openlaszlo/branches/wafflecone
Summary: Add test case for LPP-4469, Datasets inside a state don't work
New Features:
Bugs Fixed: LPP-4469 (not fixed! just a test case to demonstrate it!)
Technical Reviewer: none
QA Reviewer: (pending)
Doc Reviewer: (pending)
Documentation:
Release Notes:
Details:
Tests:
http://localhost:8080/wafflecone/lps/components/incubator/rich-text/test/test-lzcombobox.lzx?debug=true&lzr=swf8
gives
Tests: 12 Failures: 2 Errors: 3
TestFailure: testStates failed: Equals: expected 0 got ''
TestFailure: testLateData failed: Equals: expected 1 got ''
TestError: testStates failed: reference to undefined property 'fontsize'
TestError: testStates failed: reference to undefined property 'font'
TestError: testStates failed: reference to undefined variable 'combobox_style'
The first two failures are the ones that matter.
Modified:
openlaszlo/branches/wafflecone/lps/components/incubator/rich-text/test/test-lzcombobox.lzx
===================================================================
---
openlaszlo/branches/wafflecone/lps/components/incubator/rich-text/test/test-lzcombobox.lzx
2007-08-09 22:01:09 UTC (rev 5988)
+++
openlaszlo/branches/wafflecone/lps/components/incubator/rich-text/test/test-lzcombobox.lzx
2007-08-09 22:26:40 UTC (rev 5989)
@@ -19,47 +19,102 @@
<clr value="0xcc3300"/>
<clr value="0x00CC00"/>
</dataset>
-
- <lzcombobox y="100" id="hell"
- width="48" itemclassname="colorswatch" itemdatapath="fontcolors:/clr"
- focusable="false"
- >
- <!--- @keywords private
- Set my initial value to be the editor's default font color.
- Register tool with toolbar -->
- <method name="init">
- super.init();
- // toolbar.registerTool(this,"color");
- this.setValue(0x339966, true);
- this.csq.setColor(0x339966);
- </method>
- <method name="construct" args="parent, args">
- super.construct(parent, args);
- </method>
-
- <!--- When the user selects an item from the combo box,
- create an object representing just the change in format.
- Give that object to the editor. -->
- <method event="onselect"><![CDATA[
- Debug.info("got onselect for hell");
- var color = this.value;
+ <view y="200">
+ <simplelayout axis="x" spacing="10" />
+ <text>hell</text>
+ <lzcombobox id="hell"
+ width="48" itemclassname="colorswatch"
itemdatapath="fontcolors:/clr"
+ focusable="false"
+ >
+ <!--- @keywords private
+ Set my initial value to be the editor's default font color.
+ Register tool with toolbar -->
+ <method name="init">
+ super.init();
+ // toolbar.registerTool(this,"color");
+ this.setValue(0x339966, true);
+ this.csq.setColor(0x339966);
+ </method>
- this.csq.setColor(color);
- ]]>
- </method>
+ <method name="construct" args="parent, args">
+ super.construct(parent, args);
+ </method>
- <colorsquare x="11" y="3" name="csq" drawsquare="true">
- <method name="setColor" args="color">
- this.setVisible( color != null );
- if (this.visible) {
- this.setAttribute('swatchcolor', color);
- }
- </method>
- </colorsquare>
+ <!--- When the user selects an item from the combo box,
+ create an object representing just the change in format.
+ Give that object to the editor. -->
+ <method event="onselect"><![CDATA[
+ var color = this.value;
+ this.csq.setColor(color);
+ ]]>
+ </method>
+ <colorsquare x="11" y="3" name="csq" drawsquare="true">
+ <method name="setColor" args="color">
+ this.setVisible( color != null );
+ if (this.visible) {
+ this.setAttribute('swatchcolor', color);
+ }
+ </method>
+ </colorsquare>
+
- </lzcombobox>
+ </lzcombobox>
+
+
+
+ <!-- In trunk, we put the colors dataset into a state, and applied it
in the
+ lzcombobox's construct method. That gives errors in wafflecone.
+ Bug LPP-4469 tries to track this issue. [bshine 08.09.2007] -->
+ <state name="laterState">
+ <dataset name="glitzcolors">
+ <clr value="0x000001"/>
+ <clr value="0x555555"/>
+ <clr value="0x333399"/>
+ <clr value="0x339999"/>
+ <clr value="0x339966"/>
+ <clr value="0xcccc33"/>
+ <clr value="0xcc9933"/>
+ <clr value="0xcc3300"/>
+ <clr value="0x00CC00"/>
+ </dataset>
+ </state>
+
+ <dataset name="sweetcolors">
+ <clr value="0x000000"/>
+ <clr value="0x555555"/>
+ <clr value="0x333399"/>
+ <clr value="0x339999"/>
+ <clr value="0x339966"/>
+ <clr value="0xcccc33"/>
+ <clr value="0xcc9933"/>
+ <clr value="0xcc3300"/>
+ <clr value="0x00CC00"/>
+ </dataset>
+
+ <state name="odelay" id="odelay">
+ <text>allan</text>
+ <lzcombobox id="allan"
+ width="48" itemclassname="colorswatch"
itemdatapath="sweetcolors:/clr"
+ focusable="false">
+ </lzcombobox>
+ </state>
+
+ <text>beijing</text>
+ <lzcombobox id="beijing"
+ width="48" itemclassname="colorswatch"
itemdatapath="glitzcolors:/clr"
+ focusable="false">
+ <!--- @keywords private
+ apply state for late instantiation of local data -->
+ <method name="construct" args="parent, args">
+ super.construct(parent, args);
+ laterState.apply();
+ </method>
+ </lzcombobox>
+
+ </view>
+
<TestSuite>
@@ -90,6 +145,17 @@
assertEquals(7, hell.getItemIndex('0xcc3300'));
assertEquals(-1, hell.getItemIndex(27));
</method>
+
+ <method name="testStates">
+ Debug.info("about to apply odelay state");
+ odelay.apply();
+ Debug.info("done applying odelay state.");
+ assertEquals(0, allan.getValue()); // [bshine 08.09.2007]
This fails! demonstrating LPP-4469
+ </method>
+
+ <method name="testLateData">
+ assertEquals(1, beijing.getValue()); // [bshine 08.09.2007]
This fails, demonstrating LPP-4469
+ </method>
</TestCase>
</TestSuite>
</canvas>
_______________________________________________
Laszlo-checkins mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-checkins