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

Unified Diff: chrome/test/data/extensions/platform_apps/web_view/shim/main.js

Issue 23503023: Reland after fix: Improve <webview> autosize: (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixes for re-land. Created 7 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: chrome/test/data/extensions/platform_apps/web_view/shim/main.js
diff --git a/chrome/test/data/extensions/platform_apps/web_view/shim/main.js b/chrome/test/data/extensions/platform_apps/web_view/shim/main.js
index c3d0eae03edcb93187c37c2f1c36d65e7bb1a084..3a502d312d8715975b430386d615041a35e64c11 100644
--- a/chrome/test/data/extensions/platform_apps/web_view/shim/main.js
+++ b/chrome/test/data/extensions/platform_apps/web_view/shim/main.js
@@ -170,36 +170,30 @@ function testAutosizeWithPartialAttributes() {
var step = 1;
var sizeChangeHandler = function(e) {
+ window.console.log('sizeChangeHandler, new: ' +
+ e.newWidth + ' X ' + e.newHeight);
switch (step) {
case 1:
// Expect 300x200.
embedder.test.assertEq(300, e.newWidth);
embedder.test.assertEq(200, e.newHeight);
- // Remove an autosize attribute and verify that it causes relayout.
- webview.minwidth = null;
+ // Change the min size to cause a relayout.
+ webview.minwidth = 500;
break;
case 2:
- // Expect 640x?
- embedder.test.assertEq(640, e.newWidth);
+ embedder.test.assertTrue(e.newWidth >= 500);
+ embedder.test.assertTrue(e.newWidth <= 700);
sadrul 2013/09/03 18:04:20 can 500 and 700 be written as webview.minWidth/web
lazyboy 2013/09/03 18:47:35 Done.
// Tests when minwidth > maxwidth, minwidth = maxwidth.
- webview.maxheight = null;
+ // i.e. minwidth is essentially 700.
webview.minwidth = 800;
- webview.minheight = 800;
break;
case 3:
- // Expect 700X480
+ // Expect 700X?
embedder.test.assertEq(700, e.newWidth);
- embedder.test.assertEq(480, e.newHeight);
-
- // Remove maxwidth and make sure the size returns to plugin size.
- webview.removeAttribute('maxwidth');
- break;
- case 4:
- // Expect original size, 640x480.
- embedder.test.assertEq(640, e.newWidth);
- embedder.test.assertEq(480, e.newHeight);
+ embedder.test.assertTrue(e.newHeight >= 200);
+ embedder.test.assertTrue(e.newHeight <= 600);
embedder.test.succeed();
break;

Powered by Google App Engine
This is Rietveld 408576698