import com.google.gwt.event.shared.GwtEvent;\r
import com.google.gwt.event.shared.HandlerRegistration;\r
import com.google.gwt.query.client.js.JsCache;\r
+import com.google.gwt.query.client.js.JsNodeArray;\r
import com.google.gwt.query.client.js.JsUtils;\r
import com.google.gwt.query.client.plugins.effects.PropertiesAnimation;\r
import com.google.gwt.query.client.plugins.effects.PropertiesAnimation.Easing;\r
public void onModuleLoad() {\r
try {\r
gwtSetUp();\r
- testCompareJquery();\r
+ testChrome__gwt_ObjectId();\r
} catch (Exception ex) {\r
ex.printStackTrace();\r
$(e).html("").after("<div>ERROR: " + ex.getMessage() + "</div>");\r
}\r
}\r
\r
+ public void testChrome__gwt_ObjectId() {\r
+ JsCache a = JsCache.create();\r
+ assertEquals(0, a.length());\r
+ assertEquals(0, a.keys().length);\r
+ assertEquals(0, a.elements().length);\r
+ \r
+ a.put("obj", new Long(21));\r
+ assertEquals(1, a.length());\r
+ assertEquals(1, a.keys().length);\r
+ assertEquals(1, a.elements().length);\r
+ \r
+ JsNodeArray n = JsNodeArray.create();\r
+ assertEquals(0, n.getLength());\r
+ assertEquals(0, n.<JsCache>cast().keys().length);\r
+ assertEquals(0, n.elements().length);\r
+ \r
+ n.addNode($("<hr/>").get(0));\r
+ assertEquals(1, n.getLength());\r
+ assertEquals(1, n.<JsCache>cast().keys().length);\r
+ assertEquals(1, n.elements().length);\r
+ }\r
+ \r
public void testJsCache() {\r
String[] slist = new String[]{"A", "B", "C"};\r
\r
*/
package com.google.gwt.query.client;
-import static com.google.gwt.query.client.GQuery.$;
+import static com.google.gwt.query.client.GQuery.*;
import com.google.gwt.dom.client.Element;
import com.google.gwt.junit.client.GWTTestCase;
assertEquals(1, n.<JsCache>cast().keys().length);
assertEquals(1, n.elements().length);
}
+
+ public void testProperties() {
+ Properties p = $$("b: 'a'; c: 1, /*gg: aadf*/d: url('https://test.com');");
+ assertEquals(3, p.keys().length);
+ assertEquals("url(https://test.com)", p.getStr("d"));
+
+ p = $$("color: 'rgb(0, 0,139)', background: red");
+ assertEquals(2, p.keys().length);
+ assertEquals("rgb(0,0,139)", p.getStr("color"));
+ }
}
<gwtVersion>${gwtversion}</gwtVersion>
<compileReport>true</compileReport>
<modules>
- <module>gwtquery.samples.JsCollectionVsJavaCollection</module>
<module>gwtquery.samples.GwtQueryBench</module>
+<!--
+ <module>gwtquery.samples.JsCollectionVsJavaCollection</module>
<module>gwtquery.samples.GwtQuerySample</module>
<module>gwtquery.samples.GwtQueryDemo</module>
<module>gwtquery.samples.GwtQueryEffects</module>
<module>gwtquery.samples.GwtQueryImageZoom</module>
<module>gwtquery.samples.FadeEffectsSample</module>
<module>gwtquery.samples.SlideEffectsSample</module>
+-->
</modules>
</configuration>
<executions>