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

Side by Side Diff: chrome/test/data/extensions/api_test/popup/popup.html

Issue 295051: Constrain extension popups to a min/max size (Closed)
Patch Set: Created 11 years, 2 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
OLDNEW
1 <head> 1 <head>
2 <script> 2 <script>
3 function run_tests() { 3 function run_tests() {
4 // Compute the size of the popup. 4 // Compute the size of the popup.
5 var width = 100; 5 var width = 0;
6 var height = 100; 6 var height = 0;
7 if (localStorage.height) { 7 if (localStorage.height) {
8 height = parseInt(localStorage.height); 8 height = parseInt(localStorage.height);
9 } 9 }
10 if (localStorage.width) { 10 if (localStorage.width) {
11 width = parseInt(localStorage.width); 11 width = parseInt(localStorage.width);
12 } 12 }
13 13
14 // Set the div's size. 14 // Set the div's size.
15 var test = document.getElementById("test"); 15 var test = document.getElementById("test");
16 test.style.width = width + "px"; 16 test.style.width = width + "px";
17 test.style.height = height + "px"; 17 test.style.height = height + "px";
18 chrome.test.log("height: " + test.offsetHeight); 18 chrome.test.log("height: " + test.offsetHeight);
19 chrome.test.log("width: " + test.offsetWidth); 19 chrome.test.log("width: " + test.offsetWidth);
20 20
21 // We should be done. Let the test harness know. 21 // We should be done. Let the test harness know.
22 //window.setTimeout(chrome.test.notifyPass, 0); 22 //window.setTimeout(chrome.test.notifyPass, 0);
23 chrome.test.notifyPass(); 23 chrome.test.notifyPass();
24 24
25 height += 100; 25 height += 500;
26 width += 100; 26 width += 500;
27 localStorage.height = JSON.stringify(height); 27 localStorage.height = JSON.stringify(height);
28 localStorage.width = JSON.stringify(width); 28 localStorage.width = JSON.stringify(width);
29 } 29 }
30 </script> 30 </script>
31 <style> 31 <style>
32 body { 32 body {
33 padding: 0px; 33 padding: 0px;
34 margin: 0px; 34 margin: 0px;
35 } 35 }
36 div { 36 div {
37 padding: 0px; 37 padding: 0px;
38 margin: 0px; 38 margin: 0px;
39 } 39 }
40 </style> 40 </style>
41 </head> 41 </head>
42 <body onload="window.setTimeout(run_tests, 0)"> 42 <body onload="window.setTimeout(run_tests, 0)">
43 <div id="test">TEST</div> 43 <div id="test">A</div>
44 </body> 44 </body>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698