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

Side by Side Diff: LayoutTests/fast/forms/page-popup/page-popup-adjust-rect.html

Issue 243173004: Make window.screen property non replaceable (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase Created 6 years, 8 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 | Annotate | Revision Log
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html> 2 <html>
3 <head> 3 <head>
4 <script src="../../../resources/js-test.js"></script> 4 <script src="../../../resources/js-test.js"></script>
5 <script src="../../forms/resources/common.js"></script> 5 <script src="../../forms/resources/common.js"></script>
6 <script src="../../forms/resources/picker-common.js"></script> 6 <script src="../../forms/resources/picker-common.js"></script>
7 <script src="../calendar-picker/resources/calendar-picker-common.js"></script> 7 <script src="../calendar-picker/resources/calendar-picker-common.js"></script>
8 </head> 8 </head>
9 <body> 9 <body>
10 <p id="description"></p> 10 <p id="description"></p>
11 <div id="console"></div> 11 <div id="console"></div>
12 12
13 <input type="date" id="date"> 13 <input type="date" id="date">
14 14
15 <script> 15 <script>
16 description('Test for child elements of a datalist element.'); 16 description('Test for child elements of a datalist element.');
17 17
18 openPicker(document.getElementById('date'), test); 18 openPicker(document.getElementById('date'), test);
19 19
20 function makeRect(x, y, width, height) { 20 function makeRect(x, y, width, height) {
21 return { 21 return {
22 x: x, 22 x: x,
23 y: y, 23 y: y,
24 width: width, 24 width: width,
25 height: height 25 height: height
26 }; 26 };
27 } 27 }
28 28
29 function test() { 29 function test() {
30 popupWindow.screen = { 30 Object.defineProperty(popupWindow, 'screen', {
31 width: 80, 31 value: {
32 height: 60, 32 width: 80,
33 availLeft: 0, 33 height: 60,
34 availTop: 0, 34 availLeft: 0,
35 availWidth: 80, 35 availTop: 0,
36 availHeight: 60, 36 availWidth: 80,
37 }; 37 availHeight: 60
38 }
39 });
38 40
39 debug("Move anchor element along the vertical axis."); 41 debug("Move anchor element along the vertical axis.");
40 42
41 popupWindow.global.params.anchorRectInScreen = makeRect(0, -20, 20, 10); 43 popupWindow.global.params.anchorRectInScreen = makeRect(0, -20, 20, 10);
42 shouldBeEqualToString('popupWindow.adjustWindowRect(30, 10, 30, 10).toString ()', 'Rectangle(0,0,30,10)'); 44 shouldBeEqualToString('popupWindow.adjustWindowRect(30, 10, 30, 10).toString ()', 'Rectangle(0,0,30,10)');
43 45
44 popupWindow.global.params.anchorRectInScreen = makeRect(0, -10, 20, 10); 46 popupWindow.global.params.anchorRectInScreen = makeRect(0, -10, 20, 10);
45 shouldBeEqualToString('popupWindow.adjustWindowRect(30, 10, 30, 10).toString ()', 'Rectangle(0,0,30,10)'); 47 shouldBeEqualToString('popupWindow.adjustWindowRect(30, 10, 30, 10).toString ()', 'Rectangle(0,0,30,10)');
46 48
47 popupWindow.global.params.anchorRectInScreen = makeRect(0, 0, 20, 10); 49 popupWindow.global.params.anchorRectInScreen = makeRect(0, 0, 20, 10);
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 212
211 popupWindow.global.params.anchorRectInScreen = makeRect(30, 0, 30, 10); 213 popupWindow.global.params.anchorRectInScreen = makeRect(30, 0, 30, 10);
212 shouldBeEqualToString('popupWindow.adjustWindowRect(90, 10, 90, 10).toString ()', 'Rectangle(0,10,90,10)'); 214 shouldBeEqualToString('popupWindow.adjustWindowRect(90, 10, 90, 10).toString ()', 'Rectangle(0,10,90,10)');
213 215
214 finishJSTest(); 216 finishJSTest();
215 } 217 }
216 218
217 </script> 219 </script>
218 </body> 220 </body>
219 </html> 221 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698