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

Unified Diff: third_party/WebKit/LayoutTests/typedcssom/computedstyle/computedStylePropertyMap.html

Issue 1849653003: Implement ComputedStylePropertyMap for Typed OM. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@maps-inline
Patch Set: Fix compilation 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/computedstyle/computedStylePropertyMap.html
diff --git a/third_party/WebKit/LayoutTests/typedcssom/computedstyle/computedStylePropertyMap.html b/third_party/WebKit/LayoutTests/typedcssom/computedstyle/computedStylePropertyMap.html
new file mode 100644
index 0000000000000000000000000000000000000000..abe65910c71541c733e46688e06f7acfd6037f88
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/typedcssom/computedstyle/computedStylePropertyMap.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<script src='../../resources/testharness.js'></script>
+<script src='../../resources/testharnessreport.js'></script>
+
+<div id="testElement"></div>
+
+<script>
+
+var computedStyleMap = getComputedStyleMap(testElement);
+var computedStyle = getComputedStyle(testElement);
+
+test(function() {
+ var properties = computedStyleMap.getProperties();
+
+ assert_equals(properties.length, computedStyle.length);
+}, "Computed StyleMap.getProperties returns the same number of properties as ComputedStyle");
+
+test(function() {
+ var properties = computedStyleMap.getProperties();
+ for (var i = 0; i < properties.length; i++) {
+ var property = properties[i];
+ var styleValues = computedStyleMap.getAll(property);
+ if (styleValues.length == 1) {
+ // TODO(meade): Remove this if statement once all properties are supported.
+ // TODO(meade): Handle sequence types.
+ assert_equals(computedStyleMap.get(property).cssString, computedStyle[property]);
+ }
+ }
+}, 'Properties retrieved from ComputedStyleMap reflect the same values as from ComputedStyle');
+
+test(function() {
+ assert_throws(new TypeError(), function() {
+ getComputedStyleMap(null);
+ });
+}, 'Test that passing null to getComputedStyleMap does not crash');
+
+</script>

Powered by Google App Engine
This is Rietveld 408576698