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> |