Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(182)

Unified Diff: third_party/WebKit/LayoutTests/typedcssom/inlinestyle/inlineStylePropertyMap_getProperties.html

Issue 1590193002: Partial implementation of inline StylePropertyMap. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@maps
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/typedcssom/inlinestyle/inlineStylePropertyMap_getProperties.html
diff --git a/third_party/WebKit/LayoutTests/typedcssom/inlinestyle/inlineStylePropertyMap_getProperties.html b/third_party/WebKit/LayoutTests/typedcssom/inlinestyle/inlineStylePropertyMap_getProperties.html
new file mode 100644
index 0000000000000000000000000000000000000000..8b4d0e87a6106ca9eda13c1d7f65522b99180cf5
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/typedcssom/inlinestyle/inlineStylePropertyMap_getProperties.html
@@ -0,0 +1,48 @@
+<!DOCTYPE html>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+
+<div id="testElement"></div>
+
+<script>
+
+test(function() {
+ testElement.style = '';
+ assert_array_equals(testElement.styleMap.getProperties(), []);
+}, "getProperties returns an empty list when no properties have been set");
+
+test(function() {
+ testElement.style = '';
+ testElement.styleMap.set('width', new SimpleLength(10, 'px'));
+ assert_array_equals(testElement.styleMap.getProperties(), ['width']);
+}, "getProperties returns the name of a property if it is set");
+
+test(function() {
+ testElement.styleMap.set('width', new SimpleLength(10, 'px'));
+ assert_array_equals(testElement.styleMap.getProperties(), ['width']);
+
+ testElement.styleMap.get('height');
+ assert_array_equals(testElement.styleMap.getProperties(), ['width']);
+}, "Accessing another property doesn't add a spurious result");
+
+test(function() {
+ testElement.styleMap.set('width', new SimpleLength(10, 'px'));
+ assert_array_equals(testElement.styleMap.getProperties(), ['width']);
+
+ testElement.styleMap.delete('width');
+ assert_array_equals(testElement.styleMap.getProperties(), []);
+}, "property name does not appear in result after deletion");
+
+test(function() {
+ testElement.styleMap.set('width', new SimpleLength(10, 'px'));
+ assert_array_equals(testElement.styleMap.getProperties(), ['width']);
+
+ testElement.styleMap.set('border-top-width', new SimpleLength(10, 'px'));
+ var result = testElement.styleMap.getProperties();
+ // TODO(meade): The spec should describe an order for this.
+ assert_equals(2, result.length, 2);
+ assert_true(result.indexOf('width') >= 0);
+ assert_true(result.indexOf('border-top-width') >= 0);
+}, "getProperties returns multiple properties if they are set.");
+
+</script>

Powered by Google App Engine
This is Rietveld 408576698