Revision: 6462 Author: [email protected] Date: Sat Oct 24 08:11:35 2009 Log: tr...@6455:6459 was merged into this branch
Fixes a bug in CssProperty where is adds extra space in CSS expressions Fixes JUnitShell to wait indefinitely for BrowserManagerServer to start test Disables a couple of tests in HtmlUnit svn merge --ignore-ancestry -r6455:6459 https://google-web-toolkit.googlecode.com/svn/trunk . Patch by: jlabanca http://code.google.com/p/google-web-toolkit/source/detail?r=6462 Modified: /releases/2.0/branch-info.txt /releases/2.0/user/src/com/google/gwt/junit/JUnitShell.java /releases/2.0/user/src/com/google/gwt/junit/RunStyle.java /releases/2.0/user/src/com/google/gwt/junit/RunStyleManual.java /releases/2.0/user/src/com/google/gwt/junit/RunStyleRemoteWeb.java /releases/2.0/user/src/com/google/gwt/resources/css/GenerateCssAst.java /releases/2.0/user/src/com/google/gwt/resources/css/ast/CssProperty.java /releases/2.0/user/test/com/google/gwt/user/client/ui/ListBoxTest.java /releases/2.0/user/test/com/google/gwt/user/client/ui/StackPanelTest.java ======================================= --- /releases/2.0/branch-info.txt Fri Oct 23 11:37:32 2009 +++ /releases/2.0/branch-info.txt Sat Oct 24 08:11:35 2009 @@ -23,6 +23,13 @@ svn merge --ignore-ancestry -c 6437 https://google-web-toolkit.googlecode.com/svn/trunk/ . tr...@6451 was merged into this branch - Fixes b/2198041, @DefaultLocale("foo") when foo is not in the locale list + Fixes @DefaultLocale("foo") when foo is not in the locale list svn merge --ignore-ancestry -c6451 \ https://google-web-toolkit.googlecode.com/svn/trunk/ . + +tr...@6455:6459 was merged into this branch + Fixes a bug in CssProperty where is adds extra space in CSS expressions + Fixes JUnitShell to wait indefinitely for BrowserManagerServer to start test + Disables a couple of tests in HtmlUnit + svn merge --ignore-ancestry -r6455:6459 https://google-web-toolkit.googlecode.com/svn/trunk . + ======================================= --- /releases/2.0/user/src/com/google/gwt/junit/JUnitShell.java Tue Oct 13 16:57:19 2009 +++ /releases/2.0/user/src/com/google/gwt/junit/JUnitShell.java Sat Oct 24 08:11:35 2009 @@ -686,15 +686,22 @@ */ protected boolean notDone() { int activeClients = messageQueue.getNumClientsRetrievedTest(currentTestInfo); - if (firstLaunch && runStyle instanceof RunStyleManual) { - String[] newClients = messageQueue.getNewClients(); - int printIndex = activeClients - newClients.length + 1; - for (String newClient : newClients) { - System.out.println(printIndex + " - " + newClient); - ++printIndex; - } - if (activeClients != this.numClients) { - // Wait forever for first contact; user-driven. + if (firstLaunch && runStyle.isStartDelayed()) { + // Pretty print the list of clients for manual tests. + if (runStyle instanceof RunStyleManual) { + String[] newClients = messageQueue.getNewClients(); + int printIndex = activeClients - newClients.length + 1; + for (String newClient : newClients) { + System.out.println(printIndex + " - " + newClient); + ++printIndex; + } + } + + if (runStyle.wasInterrupted()) { + // Exit early if the test is interrupted. + throw new TimeoutException("A remote browser died a mysterious death."); + } else if (activeClients != this.numClients) { + // Wait forever for first contact. return true; } } ======================================= --- /releases/2.0/user/src/com/google/gwt/junit/RunStyle.java Tue Oct 13 16:57:19 2009 +++ /releases/2.0/user/src/com/google/gwt/junit/RunStyle.java Sat Oct 24 08:11:35 2009 @@ -49,6 +49,15 @@ public boolean initialize(String args) { return true; } + + /** + * Check whether or not tests start immediately or if they can be delayed. + * + * @return <code>true</code> if the test can be delayed + */ + public boolean isStartDelayed() { + return false; + } /** * Requests initial launch of the browser. This should only be called once per ======================================= --- /releases/2.0/user/src/com/google/gwt/junit/RunStyleManual.java Tue Oct 13 16:57:19 2009 +++ /releases/2.0/user/src/com/google/gwt/junit/RunStyleManual.java Sat Oct 24 08:11:35 2009 @@ -45,6 +45,14 @@ shell.setNumClients(numClients); return true; } + + /** + * Manual tests are started by users in user time. + */ + @Override + public boolean isStartDelayed() { + return true; + } @Override public void launchModule(String moduleName) throws UnableToCompleteException { ======================================= --- /releases/2.0/user/src/com/google/gwt/junit/RunStyleRemoteWeb.java Tue Oct 13 16:57:19 2009 +++ /releases/2.0/user/src/com/google/gwt/junit/RunStyleRemoteWeb.java Sat Oct 24 08:11:35 2009 @@ -200,6 +200,14 @@ Runtime.getRuntime().addShutdownHook(new ShutdownCb()); return true; } + + /** + * Remote web tests can be queued for extended periods. + */ + @Override + public boolean isStartDelayed() { + return true; + } @Override public synchronized void launchModule(String moduleName) ======================================= --- /releases/2.0/user/src/com/google/gwt/resources/css/GenerateCssAst.java Sat Oct 10 13:50:54 2009 +++ /releases/2.0/user/src/com/google/gwt/resources/css/GenerateCssAst.java Sat Oct 24 08:11:35 2009 @@ -38,6 +38,7 @@ import com.google.gwt.resources.css.ast.CssProperty.ListValue; import com.google.gwt.resources.css.ast.CssProperty.NumberValue; import com.google.gwt.resources.css.ast.CssProperty.StringValue; +import com.google.gwt.resources.css.ast.CssProperty.TokenValue; import com.google.gwt.resources.css.ast.CssProperty.Value; import org.w3c.css.sac.AttributeCondition; @@ -916,7 +917,7 @@ case LexicalUnit.SAC_URI: return new IdentValue("url(" + value.getStringValue() + ")"); case LexicalUnit.SAC_OPERATOR_COMMA: - return new IdentValue(","); + return new TokenValue(","); case LexicalUnit.SAC_COUNTER_FUNCTION: case LexicalUnit.SAC_COUNTERS_FUNCTION: case LexicalUnit.SAC_FUNCTION: { @@ -971,25 +972,25 @@ case LexicalUnit.SAC_INHERIT: return new IdentValue("inherit"); case LexicalUnit.SAC_OPERATOR_EXP: - return new IdentValue("^"); + return new TokenValue("^"); case LexicalUnit.SAC_OPERATOR_GE: - return new IdentValue(">="); + return new TokenValue(">="); case LexicalUnit.SAC_OPERATOR_GT: - return new IdentValue(">"); + return new TokenValue(">"); case LexicalUnit.SAC_OPERATOR_LE: - return new IdentValue("<="); + return new TokenValue("<="); case LexicalUnit.SAC_OPERATOR_LT: - return new IdentValue("<"); + return new TokenValue("<"); case LexicalUnit.SAC_OPERATOR_MINUS: - return new IdentValue("-"); + return new TokenValue("-"); case LexicalUnit.SAC_OPERATOR_MOD: - return new IdentValue("%"); + return new TokenValue("%"); case LexicalUnit.SAC_OPERATOR_MULTIPLY: - return new IdentValue("*"); + return new TokenValue("*"); case LexicalUnit.SAC_OPERATOR_PLUS: - return new IdentValue("+"); + return new TokenValue("+"); case LexicalUnit.SAC_OPERATOR_SLASH: - return new IdentValue("/"); + return new TokenValue("/"); case LexicalUnit.SAC_OPERATOR_TILDE: return new IdentValue("~"); case LexicalUnit.SAC_RECT_FUNCTION: { ======================================= --- /releases/2.0/user/src/com/google/gwt/resources/css/ast/CssProperty.java Tue Mar 17 11:59:31 2009 +++ /releases/2.0/user/src/com/google/gwt/resources/css/ast/CssProperty.java Sat Oct 24 08:11:35 2009 @@ -40,6 +40,7 @@ this.suffix = suffix; } + @Override public String getExpression() { return path.replace(".", "().") + "() + \"" + Generator.escape(suffix) + "\""; @@ -58,6 +59,7 @@ return this; } + @Override public String toCss() { return "value(\"" + path + "\"" + (suffix == null ? "" : (", \"" + suffix + "\"")) + ")"; @@ -74,6 +76,7 @@ this.expression = expression; } + @Override public String getExpression() { return expression; } @@ -83,6 +86,7 @@ return this; } + @Override public String toCss() { return "/* Java expression */"; } @@ -106,6 +110,7 @@ this.ident = ident; } + @Override public String getExpression() { return '"' + Generator.escape(ident) + '"'; } @@ -119,6 +124,7 @@ return this; } + @Override public String toCss() { return ident; } @@ -138,13 +144,20 @@ this(Arrays.asList(values)); } + @Override public String getExpression() { StringBuilder toReturn = new StringBuilder(); + boolean first = true; for (Iterator<Value> i = values.iterator(); i.hasNext();) { - toReturn.append(i.next().getExpression()); + Value value = i.next(); + if (!first && value.isSpaceRequired()) { + toReturn.append("\" \" +"); + } + toReturn.append(value.getExpression()); if (i.hasNext()) { - toReturn.append("+ \" \" +"); - } + toReturn.append("+ "); + } + first = false; } return toReturn.toString(); } @@ -158,6 +171,7 @@ return this; } + @Override public String toCss() { StringBuilder sb = new StringBuilder(); for (Value v : values) { @@ -204,6 +218,7 @@ } } + @Override public String getExpression() { return expression; } @@ -221,6 +236,7 @@ return this; } + @Override public String toCss() { return css; } @@ -275,6 +291,7 @@ this.value = value; } + @Override public String getExpression() { // The escaped CSS content has to be escaped to be a valid Java literal return "\"" + Generator.escape(toCss()) + "\""; @@ -292,10 +309,26 @@ /** * Returns a escaped, quoted representation of the underlying value. */ + @Override public String toCss() { return '"' + escapeValue(value, true) + '"'; } } + + /** + * Represents a token in the CSS source. + */ + public static class TokenValue extends IdentValue { + + public TokenValue(String token) { + super(token); + } + + @Override + public boolean isSpaceRequired() { + return false; + } + } /** * An abstract encapsulation of property values in GWT CSS. @@ -325,6 +358,10 @@ public NumberValue isNumberValue() { return null; } + + public boolean isSpaceRequired() { + return true; + } public StringValue isStringValue() { return null; ======================================= --- /releases/2.0/user/test/com/google/gwt/user/client/ui/ListBoxTest.java Wed Sep 30 16:46:38 2009 +++ /releases/2.0/user/test/com/google/gwt/user/client/ui/ListBoxTest.java Sat Oct 24 08:11:35 2009 @@ -15,6 +15,8 @@ */ package com.google.gwt.user.client.ui; +import com.google.gwt.junit.DoNotRunWith; +import com.google.gwt.junit.Platform; import com.google.gwt.junit.client.GWTTestCase; import com.google.gwt.user.client.Command; import com.google.gwt.user.client.DeferredCommand; @@ -38,6 +40,7 @@ assertEquals(0, lb.getItemCount()); } + @DoNotRunWith(Platform.Htmlunit) public void testDebugId() { ListBox list = new ListBox(); list.addItem("option0", "value0"); @@ -49,7 +52,7 @@ list.ensureDebugId("myList"); UIObjectTest.assertDebugId("myList", list.getElement()); - delayTestFinish(250); + delayTestFinish(5000); DeferredCommand.addCommand(new Command() { public void execute() { UIObjectTest.assertDebugIdContents("myList-item0", "option0"); ======================================= --- /releases/2.0/user/test/com/google/gwt/user/client/ui/StackPanelTest.java Wed Sep 30 13:25:00 2009 +++ /releases/2.0/user/test/com/google/gwt/user/client/ui/StackPanelTest.java Sat Oct 24 08:11:35 2009 @@ -15,6 +15,8 @@ */ package com.google.gwt.user.client.ui; +import com.google.gwt.junit.DoNotRunWith; +import com.google.gwt.junit.Platform; import com.google.gwt.user.client.Command; import com.google.gwt.user.client.DOM; import com.google.gwt.user.client.DeferredCommand; @@ -54,6 +56,7 @@ HasWidgetsTester.testAll(createStackPanel(), new Adder(), true); } + @DoNotRunWith(Platform.Htmlunit) public void testDebugId() { final StackPanel p = createStackPanel(); Label a = new Label("a"); --~--~---------~--~----~------------~-------~--~----~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~----------~----~----~----~------~----~------~--~---
