Index: LayoutTests/fast/events/resize-events-count.html |
diff --git a/LayoutTests/fast/events/resize-events.html b/LayoutTests/fast/events/resize-events-count.html |
similarity index 62% |
copy from LayoutTests/fast/events/resize-events.html |
copy to LayoutTests/fast/events/resize-events-count.html |
index 3e005a9846950949fcebe1a42acdb5ecc229d820..78f9b94beb0d6a8a78e207483184ed10fef49a77 100644 |
--- a/LayoutTests/fast/events/resize-events.html |
+++ b/LayoutTests/fast/events/resize-events-count.html |
@@ -14,11 +14,9 @@ |
</head> |
<body> |
<div> |
- Test how many resize events are emitted during page load and dynamic content generation. |
- |
- Do not resize the page. It invalidates the test. |
+ Test how many resize events are emitted during resizing window. |
<p style="text-indent: 10px" id=result1> |
- Resize events (should be 0): <span id=count1>0</span> |
+ Resize events (should be 1): <span id=count1>0</span> |
</div> |
<div id=expandingblock> |
</div> |
@@ -27,21 +25,14 @@ |
testRunner.dumpAsText(); |
testRunner.waitUntilDone(); |
} |
- |
- var blockcount = 0; |
- function addBlock() { |
- var el = document.createElement('div'); |
- el.setAttribute('class','block'); |
- document.getElementById('expandingblock').appendChild(el); |
- if (++blockcount < 10) |
- setTimeout(addBlock, 20); |
- else |
- finish(); |
+ function resizeWindow() { |
+ window.resizeBy(10, 10); |
+ setTimeout(finish, 20); |
kenneth.r.christiansen
2013/05/06 19:50:51
Any way to avoid setTimeout. It would be sad if th
|
} |
function finish() { |
var result; |
// No resize events are acceptable. |
- if (resizecount < 1) |
+ if (resizecount == 1) |
result = '<p style="color: green">PASS'; |
else |
result = '<p style="color: red">FAIL'; |
@@ -50,6 +41,6 @@ |
if (window.testRunner) |
testRunner.notifyDone(); |
} |
- onload = addBlock; |
+ onload = resizeWindow; |
</script> |
</body> |