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

Side by Side Diff: third_party/WebKit/LayoutTests/scrollbars/iframe-scrollbar-becomes-custom.html

Issue 2235693002: convert LayoutTest/scrollbars/* js-test.js tests to testharness.js based tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: addressed review comments Created 4 years, 4 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
OLDNEW
1 <!DOCTYPE HTML> 1 <!DOCTYPE HTML>
2 <script src="../resources/js-test.js"></script> 2 <script src="../resources/testharness.js"></script>
3 <iframe id="i" frameborder="0" style="margin-top: 10px"></iframe> 3 <script src="../resources/testharnessreport.js"></script>
4 <iframe frameborder="0" style="margin-top: 10px"></iframe>
4 <div id="content" style="display: none"> 5 <div id="content" style="display: none">
5 <div id="block1" style='background-color: #ccc'>100% width</div><br> 6 <div id="block1" style='background-color: #ccc'>100% width</div><br>
6 <div style='background-color: #ddf; width: 400px; height: 300px'></div> 7 <div style='background-color: #ddf; width: 400px; height: 300px'></div>
7 </div> 8 </div>
8 <script> 9 <script>
10 test(function() {
11 var iframedoc = document.querySelector("iframe").contentDocument;
12 var sheet = iframedoc.head.appendChild(iframedoc.createElement("style")).she et;
9 13
10 var idoc = document.querySelector("#i").contentDocument;
11 var sheet = idoc.head.appendChild(idoc.createElement("style")).sheet;
12 14
13 idoc.body.style.margin = '0'; 15 iframedoc.body.style.margin = "0";
14 idoc.body.innerHTML = document.querySelector('#content').innerHTML; 16 iframedoc.body.innerHTML = document.querySelector("#content").innerHTML;
15 17
16 var block = idoc.querySelector("#block1");
17 var origWidth = block.offsetWidth;
18 18
19 sheet.insertRule("::-webkit-scrollbar { width: 50px; height: 20px; }", 0); 19 var block = iframedoc.querySelector("#block1");
20 sheet.insertRule("::-webkit-scrollbar-thumb { background: #cce; }", 1); 20 var origWidth = block.offsetWidth;
21 21
22 var width = block.offsetWidth;
23 22
24 shouldBe("250", String(width)); 23 sheet.insertRule("::-webkit-scrollbar { width: 50px; height: 20px; }", 0);
25 shouldBeTrue("width < origWidth"); 24 sheet.insertRule("::-webkit-scrollbar-thumb { background: #cce; }", 1);
26 25
26 var width = block.offsetWidth;
27
28 assert_equals(250, width);
29 assert_less_than(width, origWidth);
30 });
27 </script> 31 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698