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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/scrollbars/iframe-scrollbar-becomes-custom.html
diff --git a/third_party/WebKit/LayoutTests/scrollbars/iframe-scrollbar-becomes-custom.html b/third_party/WebKit/LayoutTests/scrollbars/iframe-scrollbar-becomes-custom.html
index be1a938f36f5e7284e76f25719770457da2e329c..a07984f693ccae139398d0db2a4577edfa24bbab 100644
--- a/third_party/WebKit/LayoutTests/scrollbars/iframe-scrollbar-becomes-custom.html
+++ b/third_party/WebKit/LayoutTests/scrollbars/iframe-scrollbar-becomes-custom.html
@@ -1,27 +1,31 @@
<!DOCTYPE HTML>
-<script src="../resources/js-test.js"></script>
-<iframe id="i" frameborder="0" style="margin-top: 10px"></iframe>
+<script src="../resources/testharness.js"></script>
+<script src="../resources/testharnessreport.js"></script>
+<iframe frameborder="0" style="margin-top: 10px"></iframe>
<div id="content" style="display: none">
<div id="block1" style='background-color: #ccc'>100% width</div><br>
<div style='background-color: #ddf; width: 400px; height: 300px'></div>
</div>
<script>
+test(function() {
+ var iframedoc = document.querySelector("iframe").contentDocument;
+ var sheet = iframedoc.head.appendChild(iframedoc.createElement("style")).sheet;
-var idoc = document.querySelector("#i").contentDocument;
-var sheet = idoc.head.appendChild(idoc.createElement("style")).sheet;
-idoc.body.style.margin = '0';
-idoc.body.innerHTML = document.querySelector('#content').innerHTML;
+ iframedoc.body.style.margin = "0";
+ iframedoc.body.innerHTML = document.querySelector("#content").innerHTML;
-var block = idoc.querySelector("#block1");
-var origWidth = block.offsetWidth;
-sheet.insertRule("::-webkit-scrollbar { width: 50px; height: 20px; }", 0);
-sheet.insertRule("::-webkit-scrollbar-thumb { background: #cce; }", 1);
+ var block = iframedoc.querySelector("#block1");
+ var origWidth = block.offsetWidth;
-var width = block.offsetWidth;
-shouldBe("250", String(width));
-shouldBeTrue("width < origWidth");
+ sheet.insertRule("::-webkit-scrollbar { width: 50px; height: 20px; }", 0);
+ sheet.insertRule("::-webkit-scrollbar-thumb { background: #cce; }", 1);
+ var width = block.offsetWidth;
+
+ assert_equals(250, width);
+ assert_less_than(width, origWidth);
+});
</script>

Powered by Google App Engine
This is Rietveld 408576698