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

Side by Side Diff: third_party/WebKit/LayoutTests/typedcssom/computedstyle/background-image.html

Issue 2872103003: [Typed CSSOM] Add computed background-image test (Closed)
Patch Set: rebase Created 3 years, 7 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script src='../../resources/testharness.js'></script>
5 <script src='../../resources/testharnessreport.js'></script>
6 </head>
7 <body>
8 <div id='testElement'></div>
9 <style>
10 #testElement {
11 background-image: url("resources/1x1-green.png");
12 }
13 </style>
14 <script>
15 var locationPath = location.href.substring(0, location.href.lastIndexOf('/'));
16 var imagePath = locationPath + '/resources/1x1-green.png';
17
18 var computedStyleMap = getComputedStyleMap(testElement);
19
20 function checks() {
21 var result = computedStyleMap.get('background-image');
22 assert_true(result instanceof CSSURLImageValue);
23 assert_equals(result.cssText, 'url(\"' + imagePath + '\")');
24 assert_equals(result.state, 'loaded');
25 assert_equals(result.intrinsicWidth, 1);
26 assert_equals(result.intrinsicHeight, 1);
27 assert_equals(result.intrinsicRatio, 1);
28 }
29
30 var t1 = async_test('Getting a background-image with a relative URL image value returns a CSSURLImageValue');
31 function t1Callback() {
32 t1.step(checks);
33 t1.done();
34 }
35
36 var t2 = async_test('Getting a background-image with a URL image value returns a CSSURLImageValue');
37 function t2Callback() {
38 testElement.style.backgroundImage = 'url(\"' + imagePath + '\")';
39 t2.step(checks);
40 t2.done();
41 }
42
43 document.onreadystatechange = function() {
44 if(document.readyState == 'complete') {
45 t1Callback();
46 t2Callback();
47 }
48 };
49
50 </script>
51 </body>
52 </html>
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698