From 104e472d21e92c3023abc4cfe96e67861424927c Mon Sep 17 00:00:00 2001 From: Joonas Lehtinen Date: Fri, 28 Jun 2013 18:19:47 +0300 Subject: Fixes @PreserveOnRefresh losing page title on refresh #11054 Moves Page title to PageState instead of using RPC for changing the title on Page.setTitle(). Change-Id: I8e5ab2064c04235503fb2531f4cdbb108530ac7e --- .../application/RefreshStatePreserveTitle.html | 36 ++++++++++++++++++++++ .../application/RefreshStatePreserveTitle.java | 30 ++++++++++++++++++ 2 files changed, 66 insertions(+) create mode 100644 uitest/src/com/vaadin/tests/application/RefreshStatePreserveTitle.html create mode 100644 uitest/src/com/vaadin/tests/application/RefreshStatePreserveTitle.java (limited to 'uitest/src') diff --git a/uitest/src/com/vaadin/tests/application/RefreshStatePreserveTitle.html b/uitest/src/com/vaadin/tests/application/RefreshStatePreserveTitle.html new file mode 100644 index 0000000000..f366054f45 --- /dev/null +++ b/uitest/src/com/vaadin/tests/application/RefreshStatePreserveTitle.html @@ -0,0 +1,36 @@ + + + + + + +New Test + + + + + + + + + + + + + + + + + + + + + + + + + + +
New Test
open/run/com.vaadin.tests.application.RefreshStatePreserveTitle?restartApplication
assertTitleTEST
open/run/com.vaadin.tests.application.RefreshStatePreserveTitle
assertTitleTEST
+ + diff --git a/uitest/src/com/vaadin/tests/application/RefreshStatePreserveTitle.java b/uitest/src/com/vaadin/tests/application/RefreshStatePreserveTitle.java new file mode 100644 index 0000000000..88b3a9b9f4 --- /dev/null +++ b/uitest/src/com/vaadin/tests/application/RefreshStatePreserveTitle.java @@ -0,0 +1,30 @@ +package com.vaadin.tests.application; + +import com.vaadin.annotations.PreserveOnRefresh; +import com.vaadin.server.VaadinRequest; +import com.vaadin.tests.components.AbstractTestUI; +import com.vaadin.tests.util.Log; +import com.vaadin.ui.Label; + +@PreserveOnRefresh +public class RefreshStatePreserveTitle extends AbstractTestUI { + + private Log log = new Log(5); + + @Override + protected void setup(VaadinRequest request) { + getPage().setTitle("TEST"); + addComponent(new Label( + "Refresh the page and observe that window title 'TEST' is lost.")); + } + + @Override + protected String getTestDescription() { + return "Refreshing the browser window should preserve the window title"; + } + + @Override + protected Integer getTicketNumber() { + return Integer.valueOf(11054); + } +} \ No newline at end of file -- cgit v1.2.3