Fixes a broken test in Safari 4 where the browser delays the actual setting of text in a TextArea if the text was set before attaching to the DOM. Swapping the order of two lines ensures we don't run into any bugs.

Patch by: jlabanca
Review by: jgw (desk)



git-svn-id: https://google-web-toolkit.googlecode.com/svn/trunk@6056 8db76d5a-ed1c-0410-87a9-c151d255dfc7
diff --git a/user/test/com/google/gwt/user/client/ui/TextAreaTest.java b/user/test/com/google/gwt/user/client/ui/TextAreaTest.java
index 67bb7a6..bb4b29f 100644
--- a/user/test/com/google/gwt/user/client/ui/TextAreaTest.java
+++ b/user/test/com/google/gwt/user/client/ui/TextAreaTest.java
@@ -54,11 +54,13 @@
   private void testNewline(String text, int cursorPos, int startRange,
       int endRange) {
     TextBoxBase box = createTextBoxBase();
-    box.setText(text);
     RootPanel.get().add(box);
 
     // Browsers will manipulate the text when attached to the DOM, so we need
-    // to get the new value.
+    // to get the new value. Safari 4 delays the manipulation if the text was
+    // set before attaching the TextArea to the DOM, so we attach first and set
+    // the text second.
+    box.setText(text);
     text = box.getText();
 
     // Position the cursor in the newlines