Chromium Code Reviews| 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 86094df512d3b658dabcf60cfc73b0e976cbe0e9..0363488e69cdf12987fb268e8919f34ac61e79e2 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 |
| @@ -93,6 +93,32 @@ embedder.test.assertFalse = function(condition) { |
| // Tests begin. |
| +// This test verifies that a lengthy page with autosize enabled will report |
| +// the correct height in the sizechanged event. |
| +function testAutosizeHeight() { |
| + var webview = document.createElement('webview'); |
| + |
| + webview.setAttribute('autosize', 'true'); |
| + webview.setAttribute('minwidth', 200); |
| + webview.setAttribute('maxwidth', 210); |
| + webview.setAttribute('minheight', 40); |
| + webview.setAttribute('maxheight', 50); |
|
danakj
2014/09/05 21:13:19
This makes a layer tree in the child that is talle
Fady Samuel
2014/09/05 21:31:53
This test is focused on height. I've added steps t
|
| + |
| + webview.addEventListener('sizechanged', function(e) { |
| + embedder.test.assertEq(50, e.newHeight); |
| + embedder.test.succeed(); |
| + }); |
| + |
| + webview.setAttribute('src', |
| + 'data:text/html,' + |
| + 'a<br/>b<br/>c<br/>d<br/>e<br/>f<br/>' + |
| + 'a<br/>b<br/>c<br/>d<br/>e<br/>f<br/>' + |
| + 'a<br/>b<br/>c<br/>d<br/>e<br/>f<br/>' + |
| + 'a<br/>b<br/>c<br/>d<br/>e<br/>f<br/>' + |
| + 'a<br/>b<br/>c<br/>d<br/>e<br/>f<br/>'); |
| + document.body.appendChild(webview); |
| +} |
| + |
| // This test verifies that if a browser plugin is in autosize mode before |
| // navigation then the guest starts auto-sized. |
| function testAutosizeBeforeNavigation() { |
| @@ -1732,6 +1758,7 @@ function testFindAPI_findupdate() { |
| }; |
| embedder.test.testList = { |
| + 'testAutosizeHeight': testAutosizeHeight, |
| 'testAutosizeAfterNavigation': testAutosizeAfterNavigation, |
| 'testAutosizeBeforeNavigation': testAutosizeBeforeNavigation, |
| 'testAutosizeRemoveAttributes': testAutosizeRemoveAttributes, |