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

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

Issue 544313002: BrowserPlugin: Grab the correct viewsize to report to BrowserPluginGuestDelegate (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed extra spaces Created 6 years, 3 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
« no previous file with comments | « chrome/browser/apps/web_view_browsertest.cc ('k') | content/browser/browser_plugin/browser_plugin_guest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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,
« no previous file with comments | « chrome/browser/apps/web_view_browsertest.cc ('k') | content/browser/browser_plugin/browser_plugin_guest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698