Index: LayoutTests/screen_orientation/screenorientation-api.html |
diff --git a/LayoutTests/screen_orientation/screenorientation-api.html b/LayoutTests/screen_orientation/screenorientation-api.html |
index 6d731bdc8a2d4e12d30424fe09ca6d69c1a3ec3c..fefb3fe32840c2a43806a0ea5eb42c7b9e2f0c5c 100644 |
--- a/LayoutTests/screen_orientation/screenorientation-api.html |
+++ b/LayoutTests/screen_orientation/screenorientation-api.html |
@@ -6,29 +6,72 @@ |
<script> |
test(function() { |
- assert_true('orientation' in window.screen); |
- assert_true('angle' in window.screen.orientation); |
- assert_true('type' in window.screen.orientation); |
- assert_true('lock' in window.screen.orientation); |
- assert_true('unlock' in window.screen.orientation); |
- assert_true('onchange' in window.screen.orientation); |
-}, "Test that the Screen Orientation API is present.") |
+ assert_true('autocapitalize' in document.createElement('input')); |
+}, "Test that the autocapitalize is avaible on HTMLInputElement.") |
test(function() { |
- assert_equals(typeof(screen.orientation), "object"); |
- assert_equals(typeof(screen.orientation.angle), "number"); |
- assert_equals(typeof(screen.orientation.type), "string"); |
- assert_equals(typeof(screen.orientation.lock), "function"); |
- assert_equals(typeof(screen.orientation.unlock), "function"); |
- assert_equals(typeof(screen.orientation.onchange), "object"); |
-}, "Test Screen Orientation API property types."); |
+ assert_true('autocapitalize' in document.createElement('textarea')); |
+}, "Test that the autocapitalize is avaible on HTMLTextAreaElement.") |
test(function() { |
- assert_true('addEventListener' in screen.orientation); |
- assert_true('removeEventListener' in screen.orientation); |
- assert_true('dispatchEvent' in screen.orientation); |
- assert_true(screen.orientation instanceof EventTarget) |
-}, "Test that screen.orientation is an EventTarget."); |
+ var elements = [ document.createElement('input'), |
+ document.createElement('textarea') ]; |
+ |
+ elements.forEach(function(e) { |
+ e.autocapitalize = 'on'; |
+ assert_equals('sentences', e.autocapitalize); |
+ |
+ e.autocapitalize = 'off'; |
+ assert_equals('none', e.autocapitalize); |
+ }); |
+}, "Test deprecated values of autocapitalize."); |
+ |
+test(function() { |
+ var elements = [ document.createElement('input'), |
+ document.createElement('textarea') ]; |
+ var knownValues = [ 'none', 'characters', 'words', 'sentences' ]; |
+ |
+ var defaultValue = 'sentences'; |
+ elements.forEach(function(e) { |
+ // Default value. |
+ assert_equals(defaultValue, e.autocapitalize); |
+ |
+ // Invalid value. |
+ e.autocapitalize = 'foo'; |
+ assert_equals(defaultValue, e.autocapitalize); |
+ assert_equals('foo', e.getAtribute('autocapitalize')); |
+ e.setAttribute('autocapitalize', 'bar'); |
+ assert_equals(defaultValue, e.autocapitalize); |
+ assert_equals('bar', e.getAtribute('autocapitalize')); |
+ |
+ // Default value. |
+ e.removeAttribute('autocapitalize'); |
+ assert_equals(defaultValue, e.autocapitalize); |
+ assert_equals(null, e.getAtribute('autocapitalize')); |
+ |
+ // Case insensitive. |
+ e.setAttribute('autocapitalize', 'NoNe'); |
+ assert_equals('none', e.autocapitalize); |
+ assert_equals('none', e.getAtribute('autocapitalize')); |
+ e.autocapitalize = 'WORDS'; |
+ assert_equals('words', e.autocapitalize); |
+ assert_equals('words', e.getAtribute('autocapitalize')); |
+ |
+ knownValues.forEach(function(value) { |
+ e.setAttribute('autocapitalize', value); |
+ assert_equals(value, e.autocapitalize); |
+ assert_equals(value, e.getAtribute('autocapitalize')); |
+ |
+ e.removeAttribute('autocapitalize'); |
+ |
+ e.autocapitalize = value; |
+ assert_equals(value, e.autocapitalize); |
+ assert_equals(value, e.getAtribute('autocapitalize')); |
+ |
+ e.removeAttribute('autocapitalize'); |
+ }); |
+ }); |
+}, "Test reflection of autocapitalize."); |
</script> |
</body> |