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

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

Issue 2312293003: [CSSTypedOM] Computed StylePropertyMap use ComputedStyle for Lengths (Closed)
Patch Set: rebase Created 4 years, 2 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/width.html
diff --git a/third_party/WebKit/LayoutTests/typedcssom/computedstyle/width.html b/third_party/WebKit/LayoutTests/typedcssom/computedstyle/width.html
index d1ea20e8e111af1ec74262f68d8b44908d871ca8..89ae83719821e37232b913a29059707ab40f1493 100644
--- a/third_party/WebKit/LayoutTests/typedcssom/computedstyle/width.html
+++ b/third_party/WebKit/LayoutTests/typedcssom/computedstyle/width.html
@@ -1,27 +1,40 @@
<!DOCTYPE html>
+<html>
+<head>
<script src='../../resources/testharness.js'></script>
<script src='../../resources/testharnessreport.js'></script>
-
-<div id="testElement"></div>
+</head>
+<body>
+<div id='testElement'></div>
<script>
-var computedStyleMap = getComputedStyleMap(testElement);
-
-test(function() {
- testElement.style.width = '10px';
-
- var result = computedStyleMap.get('width');
- assert_true(result instanceof CSSSimpleLength);
- assert_equals(result.cssText, '10px');
-}, "Getting a 10px width results in a CSSSimpleLength");
-
-test(function() {
- testElement.style.width = '20px';
-
- var result = computedStyleMap.getAll('width');
- assert_equals(result.length, 1);
- assert_equals(result[0].cssText, '20px');
-}, "getAll for width returns a single value");
+testElement.style.width = '10px';
+var computedStyleMap;
+
+var t1 = async_test("Getting a 10px width results in a CSSSimpleLength");
+var t2 = async_test("getAll for width returns a single value");
+
+document.onreadystatechange = function() {
+ if(document.readyState == 'complete') {
+ t1.step(function() {
+ computedStyleMap = getComputedStyleMap(testElement);
+ var result = computedStyleMap.get('width');
+ assert_true(result instanceof CSSSimpleLength);
+ assert_equals(result.cssText, '10px');
+ });
+ t1.done();
+
+ t2.step(function() {
+ testElement.style.width = '20px';
+ var result = computedStyleMap.getAll('width');
+ assert_equals(result.length, 1);
+ assert_equals(result[0].cssText, '20px');
+ });
+ t2.done();
+ }
+};
</script>
+</body>
+</html>
« no previous file with comments | « third_party/WebKit/LayoutTests/TestExpectations ('k') | third_party/WebKit/Source/core/css/CSSComputedStyleDeclaration.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698