Merge branch 'master' into v1

This commit is contained in:
2015-06-08 10:10:51 +02:00
73 changed files with 5913 additions and 82 deletions

View File

@@ -0,0 +1,107 @@
note
description : "test application root class"
date : "$Date$"
revision : "$Revision$"
class
APPLICATION
inherit
ARGUMENTS
create
make
feature {NONE} -- Initialization
make
-- Run application.
local
l_text_input: WSF_FORM_TEXT_INPUT
l_theme: WSF_NULL_THEME
l_input_type: WSF_FORM_SUBMIT_INPUT
l_search_type: WSF_FORM_SEARCH_INPUT
l_email_type: WSF_FORM_EMAIL_INPUT
l_number_type: WSF_FORM_NUMBER_INPUT
do
create l_theme.make
-- Basic example
create l_text_input.make_with_text ("fullname", "some text example")
print (l_text_input.to_html (l_theme))
io.put_new_line
-- Placeholder
create l_text_input.make ("fullname")
l_text_input.set_placeholder ("John Doe")
print (l_text_input.to_html (l_theme))
io.put_new_line
-- autofocus
create l_text_input.make ("fullname")
l_text_input.enable_autofocus
print (l_text_input.to_html (l_theme))
io.put_new_line
-- autocomplete
create l_text_input.make ("fullname")
l_text_input.disable_autocomplete
print (l_text_input.to_html (l_theme))
io.put_new_line
-- required
create l_text_input.make ("fullname")
l_text_input.enable_required
print (l_text_input.to_html (l_theme))
io.put_new_line
-- pattern
create l_text_input.make ("product")
l_text_input.set_pattern ("[0-9][A-Z]{3}")
print (l_text_input.to_html (l_theme))
io.put_new_line
-- basic submit
create l_input_type.make ("Submit")
print (l_input_type.to_html (l_theme))
io.put_new_line
-- basic submit with formnovalidate
create l_input_type.make ("Submit")
l_input_type.set_formnovalidate
print (l_input_type.to_html (l_theme))
io.put_new_line
-- input search
create l_search_type.make ("Search")
print (l_search_type.to_html (l_theme))
io.put_new_line
-- input email
create l_email_type.make ("Email")
print (l_email_type.to_html (l_theme))
io.put_new_line
-- input number
create l_number_type.make ("Price")
l_number_type.set_min (1)
l_number_type.set_max (10)
l_number_type.set_step (0.5)
print (l_number_type.to_html (l_theme))
end
end

View File

@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<system xmlns="http://www.eiffel.com/developers/xml/configuration-1-13-0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.eiffel.com/developers/xml/configuration-1-13-0 http://www.eiffel.com/developers/xml/configuration-1-13-0.xsd" name="test" uuid="F428CCD3-FF90-4E80-8C60-BFF17F72F0FA">
<target name="test">
<root class="APPLICATION" feature="make"/>
<option warning="true">
<assertions precondition="true" postcondition="true" check="true" invariant="true" loop="true" supplier_precondition="true"/>
</option>
<setting name="console_application" value="true"/>
<precompile name="base_pre" location="$ISE_PRECOMP\base-safe.ecf"/>
<library name="base" location="$ISE_LIBRARY\library\base\base-safe.ecf"/>
<library name="testing" location="$ISE_LIBRARY\library\testing\testing-safe.ecf"/>
<library name="wsf_html" location="..\..\..\library\server\wsf_html\wsf_html-safe.ecf" readonly="false"/>
<cluster name="test" location=".\" recursive="true">
<file_rule>
<exclude>/EIFGENs$</exclude>
<exclude>/CVS$</exclude>
<exclude>/.svn$</exclude>
</file_rule>
</cluster>
</target>
</system>

View File

@@ -0,0 +1,118 @@
note
description: "[
Eiffel tests that can be executed by testing tool.
]"
author: "EiffelStudio test wizard"
date: "$Date$"
revision: "$Revision$"
testing: "type/manual"
class
WSF_FORM_INPUT_HTML5_TEST_SET
inherit
EQA_TEST_SET
feature -- Test routines
test_placeholder
-- <input type="text" name="fullname" placeholder="John Doe">
local
l_text_input: WSF_FORM_TEXT_INPUT
l_theme: WSF_NULL_THEME
l_placeholder: STRING
do
l_placeholder := "<div><input type=%"text%" name=%"fullname%" placeholder=%"John Doe%"/></div>"
create l_theme.make
create l_text_input.make ("fullname")
l_text_input.set_placeholder ("John Doe")
assert ("expected input with placeholder",l_text_input.to_html (l_theme).is_case_insensitive_equal_general (l_placeholder) )
end
test_autofocus
-- <input type="text" name="fullname" autofocus>
local
l_text_input: WSF_FORM_TEXT_INPUT
l_theme: WSF_NULL_THEME
l_autofocus: STRING
do
l_autofocus := "<div><input type=%"text%" name=%"fullname%" autofocus/></div>"
create l_theme.make
create l_text_input.make ("fullname")
l_text_input.enable_autofocus
assert ("expected input with autofocus",l_text_input.to_html (l_theme).is_case_insensitive_equal_general (l_autofocus) )
l_text_input.disable_autofocus
l_autofocus := "<div><input type=%"text%" name=%"fullname%"/></div>"
assert ("expected input without autofocus",l_text_input.to_html (l_theme).is_case_insensitive_equal_general (l_autofocus) )
end
test_autocomplete
-- <input type="text" name="fullname" autocomplete="off">
local
l_text_input: WSF_FORM_TEXT_INPUT
l_theme: WSF_NULL_THEME
l_autocomplete: STRING
do
l_autocomplete := "<div><input type=%"text%" name=%"fullname%" autocomplete=%"off%"/></div>"
create l_theme.make
create l_text_input.make ("fullname")
l_text_input.disable_autocomplete
assert ("expected input with autocomplete in off",l_text_input.to_html (l_theme).is_case_insensitive_equal_general (l_autocomplete) )
l_text_input.enable_autocomplete
l_autocomplete := "<div><input type=%"text%" name=%"fullname%"/></div>"
assert ("expected input without autocomplete",l_text_input.to_html (l_theme).is_case_insensitive_equal_general (l_autocomplete) )
end
test_required
-- <input type="text" name="fullname" required>
local
l_text_input: WSF_FORM_TEXT_INPUT
l_theme: WSF_NULL_THEME
l_required: STRING
do
l_required := "<div><input type=%"text%" name=%"fullname%" required/></div>"
create l_theme.make
create l_text_input.make ("fullname")
l_text_input.enable_required
assert ("expected input with required",l_text_input.to_html (l_theme).is_case_insensitive_equal_general (l_required) )
l_text_input.disable_required
l_required := "<div><input type=%"text%" name=%"fullname%"/></div>"
assert ("expected input without required",l_text_input.to_html (l_theme).is_case_insensitive_equal_general (l_required) )
end
test_pattern
-- <input type="text" name="product" pattern="[0-9][A-Z]{3}"/>
local
l_text_input: WSF_FORM_TEXT_INPUT
l_theme: WSF_NULL_THEME
l_pattern: STRING
do
l_pattern := "<div><input type=%"text%" name=%"product%" pattern=%"[0-9][A-Z]{3}%"/></div>"
create l_theme.make
create l_text_input.make ("product")
l_text_input.set_pattern ("[0-9][A-Z]{3}")
assert ("expected input with pattern",l_text_input.to_html (l_theme).is_case_insensitive_equal_general (l_pattern) )
end
end

View File

@@ -0,0 +1,31 @@
note
description: " Null theme for void-safety and test purpose."
date: "$Date$"
revision: "$Revision$"
class
WSF_NULL_THEME
inherit
WSF_THEME
create
make
feature {NONE} -- Initialization
make
do
end
feature -- Core
site_url: STRING = ""
base_url: detachable READABLE_STRING_8
-- Base url if any.
do
end
end