summaryrefslogtreecommitdiffstats
path: root/uitest/src
diff options
context:
space:
mode:
authorLeif Åstrand <leif@vaadin.com>2013-04-10 10:21:59 +0300
committerLeif Åstrand <leif@vaadin.com>2013-04-10 10:21:59 +0300
commit6f593d5847389edfc9dbb7bb65114dc4be6066ae (patch)
treeeddba731c09501db053433444b04ea97ad7ea905 /uitest/src
parent48208188a5da6b143b83aa26f908e7f91163ca18 (diff)
downloadvaadin-framework-6f593d5847389edfc9dbb7bb65114dc4be6066ae.tar.gz
vaadin-framework-6f593d5847389edfc9dbb7bb65114dc4be6066ae.zip
Don't process push messages until init JSON is processed (#11529)
* The test is not running reliably in all browsers, but assuming this is a symptom of other push issues and not related to this particular bug. Change-Id: I848b57502aa01467b0f60624cf599247ec76f32f
Diffstat (limited to 'uitest/src')
-rw-r--r--uitest/src/com/vaadin/tests/push/PushFromInit.html32
-rw-r--r--uitest/src/com/vaadin/tests/push/PushFromInit.java36
2 files changed, 68 insertions, 0 deletions
diff --git a/uitest/src/com/vaadin/tests/push/PushFromInit.html b/uitest/src/com/vaadin/tests/push/PushFromInit.html
new file mode 100644
index 0000000000..d009eb3baf
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/push/PushFromInit.html
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head profile="http://selenium-ide.openqa.org/profiles/test-case">
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+<link rel="selenium.base" href="" />
+<title>New Test</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+<thead>
+<tr><td rowspan="1" colspan="3">New Test</td></tr>
+</thead><tbody>
+<tr>
+ <td>open</td>
+ <td>/run-push/com.vaadin.tests.push.PushFromInit?debug&amp;restartApplication</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForText</td>
+ <td>vaadin=runpushcomvaadintestspushPushFromInit::PID_SLog_row_1</td>
+ <td>1. Logged in init</td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runpushcomvaadintestspushPushFromInit::PID_SLog_row_0</td>
+ <td>2. Logged from background thread started in init</td>
+</tr>
+
+</tbody></table>
+</body>
+</html>
diff --git a/uitest/src/com/vaadin/tests/push/PushFromInit.java b/uitest/src/com/vaadin/tests/push/PushFromInit.java
new file mode 100644
index 0000000000..c43739ec04
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/push/PushFromInit.java
@@ -0,0 +1,36 @@
+package com.vaadin.tests.push;
+
+import com.vaadin.server.VaadinRequest;
+import com.vaadin.tests.components.AbstractTestUIWithLog;
+import com.vaadin.ui.Button;
+
+public class PushFromInit extends AbstractTestUIWithLog {
+
+ @Override
+ protected void setup(VaadinRequest request) {
+ new Thread() {
+ @Override
+ public void run() {
+ runSafely(new Runnable() {
+ @Override
+ public void run() {
+ log("Logged from background thread started in init");
+ }
+ });
+ }
+ }.start();
+ log("Logged in init");
+ addComponent(new Button("Sync"));
+ }
+
+ @Override
+ protected String getTestDescription() {
+ return "Pusing something to a newly created UI should not cause race conditions";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return Integer.valueOf(11529);
+ }
+
+}