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

Side by Side Diff: LayoutTests/fast/forms/suggestion-picker/week-suggestion-picker-reset-value-after-reload.html

Issue 214603003: Use a global variable in the test to avoid flakiness in the Mac port. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 9 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 | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/picker-common.js"></script> 5 <script src="../../forms/resources/picker-common.js"></script>
6 <script src="resources/suggestion-picker-common.js"></script> 6 <script src="resources/suggestion-picker-common.js"></script>
7 </head> 7 </head>
8 <body> 8 <body>
9 <script> 9 <script>
10 description('Checks reloading page resets input values'); 10 description('Checks reloading page resets input values');
11 11
12 var iframe; 12 var iframe;
13 var testInput1; 13 var testInput1;
14 var testInput2; 14 var testInput2;
15 15
16 var iframeReloaded = false;
17
16 function runOnOpenPopup1() { 18 function runOnOpenPopup1() {
19 if (iframeReloaded)
20 return;
21
17 iframe = document.getElementById('iframe'); 22 iframe = document.getElementById('iframe');
18 23
19 popupWindow.focus(); 24 popupWindow.focus();
20 25
21 shouldBeNull('highlightedEntry()'); 26 shouldBeNull('highlightedEntry()');
22 eventSender.keyDown('downArrow'); 27 eventSender.keyDown('downArrow');
23 shouldBeEqualToString('highlightedEntry()', '2012-W01'); 28 shouldBeEqualToString('highlightedEntry()', '2012-W01');
24 eventSender.keyDown('\n'); 29 eventSender.keyDown('\n');
25 waitUntilClosing(runOnOpenPopup1AfterClosing); 30 waitUntilClosing(runOnOpenPopup1AfterClosing);
26 } 31 }
(...skipping 14 matching lines...) Expand all
41 eventSender.keyDown('\n'); 46 eventSender.keyDown('\n');
42 waitUntilClosing(runOnOpenPopup2AfterClosing); 47 waitUntilClosing(runOnOpenPopup2AfterClosing);
43 } 48 }
44 49
45 function runOnOpenPopup2AfterClosing() { 50 function runOnOpenPopup2AfterClosing() {
46 shouldBeNull('document.getElementById("mock-page-popup")'); 51 shouldBeNull('document.getElementById("mock-page-popup")');
47 shouldBeEqualToString('iframe.contentDocument.getElementById("test2").value' , '2012-W01'); 52 shouldBeEqualToString('iframe.contentDocument.getElementById("test2").value' , '2012-W01');
48 53
49 iframe.addEventListener('load', function () { parent.runOnIFrameLoad(); }); 54 iframe.addEventListener('load', function () { parent.runOnIFrameLoad(); });
50 iframe.contentWindow.location.reload(); 55 iframe.contentWindow.location.reload();
56 iframeReloaded = true;
51 } 57 }
52 58
53 function runOnIFrameLoad() 59 function runOnIFrameLoad()
54 { 60 {
55 testInput1 = iframe.contentDocument.getElementById('test1'); 61 testInput1 = iframe.contentDocument.getElementById('test1');
56 testInput2 = iframe.contentDocument.getElementById('test2'); 62 testInput2 = iframe.contentDocument.getElementById('test2');
57 shouldBeEqualToString('testInput1.value', ''); 63 shouldBeEqualToString('testInput1.value', '');
58 shouldBeEqualToString('testInput2.value', '2002-W02'); 64 shouldBeEqualToString('testInput2.value', '2002-W02');
59 iframe.parentNode.removeChild(iframe); 65 iframe.parentNode.removeChild(iframe);
60 waitUntilClosing(finishJSTest); 66 waitUntilClosing(finishJSTest);
61 } 67 }
62 </script> 68 </script>
63 <iframe id=iframe onload="openPicker(event.target.contentDocument.getElementById ('test1'), runOnOpenPopup1);" srcdoc="<input type=week id=test1 list=suggestions ><input type=week id=test2 value=2002-W02 list=suggestions><datalist id=suggesti ons><option>2012-W01</option></datalist>"></iframe> 69 <iframe id=iframe onload="openPicker(event.target.contentDocument.getElementById ('test1'), runOnOpenPopup1);" srcdoc="<input type=week id=test1 list=suggestions ><input type=week id=test2 value=2002-W02 list=suggestions><datalist id=suggesti ons><option>2012-W01</option></datalist>"></iframe>
64 </body> 70 </body>
65 </html> 71 </html>
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698