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

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

Issue 851813002: Fixed and reenabled the flaky test "WebViewAPITest.TestAutosizeAfterNavigation". (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed test. Created 5 years, 11 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 unified diff | Download patch
« no previous file with comments | « no previous file | content/browser/browser_plugin/browser_plugin_guest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 var util = {}; 5 var util = {};
6 var embedder = {}; 6 var embedder = {};
7 embedder.baseGuestURL = ''; 7 embedder.baseGuestURL = '';
8 embedder.emptyGuestURL = ''; 8 embedder.emptyGuestURL = '';
9 embedder.windowOpenGuestURL = ''; 9 embedder.windowOpenGuestURL = '';
10 embedder.noReferrerGuestURL = ''; 10 embedder.noReferrerGuestURL = '';
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 function testAutosizeBeforeNavigation() { 171 function testAutosizeBeforeNavigation() {
172 var webview = document.createElement('webview'); 172 var webview = document.createElement('webview');
173 173
174 webview.setAttribute('autosize', 'true'); 174 webview.setAttribute('autosize', 'true');
175 webview.setAttribute('minwidth', 200); 175 webview.setAttribute('minwidth', 200);
176 webview.setAttribute('maxwidth', 210); 176 webview.setAttribute('maxwidth', 210);
177 webview.setAttribute('minheight', 100); 177 webview.setAttribute('minheight', 100);
178 webview.setAttribute('maxheight', 110); 178 webview.setAttribute('maxheight', 110);
179 179
180 webview.addEventListener('sizechanged', function(e) { 180 webview.addEventListener('sizechanged', function(e) {
181 embedder.test.assertEq(0, e.oldWidth); 181 // The old size should be the default size of the webview, which at the time
182 embedder.test.assertEq(0, e.oldHeight); 182 // of writing this comment is 300 x 300, but is not important to this test
183 // and could change in the future, so it is not checked here.
183 embedder.test.assertTrue(e.newWidth >= 200 && e.newWidth <= 210); 184 embedder.test.assertTrue(e.newWidth >= 200 && e.newWidth <= 210);
184 embedder.test.assertTrue(e.newHeight >= 100 && e.newHeight <= 110); 185 embedder.test.assertTrue(e.newHeight >= 100 && e.newHeight <= 110);
185 embedder.test.succeed(); 186 embedder.test.succeed();
186 }); 187 });
187 188
188 webview.setAttribute('src', 'data:text/html,webview test sizechanged event'); 189 webview.setAttribute('src', 'data:text/html,webview test sizechanged event');
189 document.body.appendChild(webview); 190 document.body.appendChild(webview);
190 } 191 }
191 192
192 // Makes sure 'sizechanged' event is fired only if autosize attribute is 193 // Makes sure 'sizechanged' event is fired only if autosize attribute is
(...skipping 1940 matching lines...) Expand 10 before | Expand all | Expand 10 after
2133 'testFindAPI_findupdate': testFindAPI, 2134 'testFindAPI_findupdate': testFindAPI,
2134 'testLoadDataAPI': testLoadDataAPI 2135 'testLoadDataAPI': testLoadDataAPI
2135 }; 2136 };
2136 2137
2137 onload = function() { 2138 onload = function() {
2138 chrome.test.getConfig(function(config) { 2139 chrome.test.getConfig(function(config) {
2139 embedder.setUp_(config); 2140 embedder.setUp_(config);
2140 chrome.test.sendMessage("Launched"); 2141 chrome.test.sendMessage("Launched");
2141 }); 2142 });
2142 }; 2143 };
OLDNEW
« no previous file with comments | « no previous file | content/browser/browser_plugin/browser_plugin_guest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698