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

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

Issue 23499003: Improve <webview> autosize: (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Move dirtying autosize state to UpdateGuestAutoSizeState, otherwise we can miss autosize related at… 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 6e6efff529d8171f66b93e2aa1d170404afaba53..296f4d9ca15811bbf48ccb87d86cd639a52cea1e 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,6 +170,8 @@ 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.
@@ -184,14 +186,13 @@ function testAutosizeWithPartialAttributes() {
embedder.test.assertEq(640, e.newWidth);
// Tests when minwidth > maxwidth, minwidth = maxwidth.
- webview.maxheight = null;
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);
+ embedder.test.assertTrue(e.newHeight >= 200);
+ embedder.test.assertTrue(e.newHeight <= 600);
// Remove maxwidth and make sure the size returns to plugin size.
webview.removeAttribute('maxwidth');
@@ -199,7 +200,8 @@ function testAutosizeWithPartialAttributes() {
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