diff options
author | Jouni Koivuviita <jouni@vaadin.com> | 2012-08-10 11:17:49 +0300 |
---|---|---|
committer | Jouni Koivuviita <jouni@vaadin.com> | 2012-08-10 11:17:49 +0300 |
commit | 559775efaf0a8f0f9f1ad6246084667732b15a0f (patch) | |
tree | 58e8046b9f32aca3ffef3f21f8b716daf39a3695 /tests/testbench | |
parent | 76a8403b7e409d1782af325b4d424b914438b8b9 (diff) | |
parent | 454f44738b20b22aeeb327523f1306b46d3cbef6 (diff) | |
download | vaadin-framework-559775efaf0a8f0f9f1ad6246084667732b15a0f.tar.gz vaadin-framework-559775efaf0a8f0f9f1ad6246084667732b15a0f.zip |
Merge branch 'master' into layoutgraph
Diffstat (limited to 'tests/testbench')
5 files changed, 97 insertions, 3 deletions
diff --git a/tests/testbench/META-INF/services/com.vaadin.terminal.gwt.server.VaadinContextListener b/tests/testbench/META-INF/services/com.vaadin.terminal.gwt.server.VaadinContextListener new file mode 100644 index 0000000000..fd5ebaa53e --- /dev/null +++ b/tests/testbench/META-INF/services/com.vaadin.terminal.gwt.server.VaadinContextListener @@ -0,0 +1 @@ +com.vaadin.tests.vaadincontext.TestVaadinContextListener
\ No newline at end of file diff --git a/tests/testbench/com/vaadin/tests/minitutorials/v7a3/complex_types_connector.js b/tests/testbench/com/vaadin/tests/minitutorials/v7a3/complex_types_connector.js index 85dfb1369b..496afce432 100644 --- a/tests/testbench/com/vaadin/tests/minitutorials/v7a3/complex_types_connector.js +++ b/tests/testbench/com/vaadin/tests/minitutorials/v7a3/complex_types_connector.js @@ -1,8 +1,9 @@ window.com_vaadin_tests_minitutorials_v7a3_ComplexTypesComponent = function() { + var connectorId = this.getConnectorId(); + var element = this.getElement(); + this.registerRpc({ sendComplexTypes: function(list, stringMap, otherMap, connectorMap, bits, matrix, bean) { - var connectorId = this.getConnectorId(); - var message = 'list[2] = "' + list[2] + '"<br />'; message += 'stringMap.two = ' + stringMap.two + '<br />'; message += 'otherMap[1][1] = "' + otherMap[1][1] + '"<br />'; @@ -11,7 +12,7 @@ window.com_vaadin_tests_minitutorials_v7a3_ComplexTypesComponent = function() { message += 'matrix[0][1] = ' + matrix[0][1] + '<br />'; message += 'bean.bean.integer = ' + bean.bean.integer + '<br />'; - this.getElement().innerHTML = message; + element.innerHTML = message; } }); }
\ No newline at end of file diff --git a/tests/testbench/com/vaadin/tests/vaadincontext/BoostrapModify.html b/tests/testbench/com/vaadin/tests/vaadincontext/BoostrapModify.html new file mode 100644 index 0000000000..d5ab5af108 --- /dev/null +++ b/tests/testbench/com/vaadin/tests/vaadincontext/BoostrapModify.html @@ -0,0 +1,31 @@ +<?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/com.vaadin.tests.vaadincontext.BoostrapModifyRoot?restartApplication</td> + <td></td> +</tr> +<tr> + <td>assertText</td> + <td>vaadin=runcomvaadintestsvaadincontextBoostrapModifyRoot::/VVerticalLayout[0]/VLabel[0]</td> + <td>There should be a static h1 in the HTML of the bootstrap page for this Root</td> +</tr> +<tr> + <td>assertText</td> + <td>//h1</td> + <td>This is a heading</td> +</tr> +</tbody></table> +</body> +</html> diff --git a/tests/testbench/com/vaadin/tests/vaadincontext/BoostrapModifyRoot.java b/tests/testbench/com/vaadin/tests/vaadincontext/BoostrapModifyRoot.java new file mode 100644 index 0000000000..3af096ff37 --- /dev/null +++ b/tests/testbench/com/vaadin/tests/vaadincontext/BoostrapModifyRoot.java @@ -0,0 +1,28 @@ +/* +@VaadinApache2LicenseForJavaFiles@ + */ + +package com.vaadin.tests.vaadincontext; + +import com.vaadin.terminal.WrappedRequest; +import com.vaadin.tests.components.AbstractTestRoot; + +public class BoostrapModifyRoot extends AbstractTestRoot { + + @Override + protected void setup(WrappedRequest request) { + // TODO Auto-generated method stub + + } + + @Override + protected String getTestDescription() { + return "There should be a static h1 in the HTML of the bootstrap page for this Root"; + } + + @Override + protected Integer getTicketNumber() { + return Integer.valueOf(9274); + } + +} diff --git a/tests/testbench/com/vaadin/tests/vaadincontext/TestVaadinContextListener.java b/tests/testbench/com/vaadin/tests/vaadincontext/TestVaadinContextListener.java new file mode 100644 index 0000000000..fa2767a023 --- /dev/null +++ b/tests/testbench/com/vaadin/tests/vaadincontext/TestVaadinContextListener.java @@ -0,0 +1,33 @@ +/* +@VaadinApache2LicenseForJavaFiles@ + */ + +package com.vaadin.tests.vaadincontext; + +import com.vaadin.terminal.gwt.server.BootstrapListener; +import com.vaadin.terminal.gwt.server.BootstrapResponse; +import com.vaadin.terminal.gwt.server.VaadinContextEvent; +import com.vaadin.terminal.gwt.server.VaadinContextListener; +import com.vaadin.ui.Root; + +public class TestVaadinContextListener implements VaadinContextListener { + @Override + public void contextCreated(VaadinContextEvent event) { + event.getVaadinContext().addBootstrapListener(new BootstrapListener() { + @Override + public void modifyBootstrap(BootstrapResponse response) { + Root root = response.getRoot(); + if (root != null && root.getClass() == BoostrapModifyRoot.class) { + response.getApplicationTag().before( + "<h1>This is a heading</h1>"); + } + } + }); + } + + @Override + public void contextDestoryed(VaadinContextEvent event) { + // Nothing to do + } + +} |