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

Unified Diff: LayoutTests/fast/events/resize-events-count.html

Issue 14766010: Clarify the size of a document view (a.k.a layout size) that causes FrameView to emit the resize ev… (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Add new test: fast/events/resize-events-count.html Created 7 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 side-by-side diff with in-line comments
Download patch
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>

Powered by Google App Engine
This is Rietveld 408576698