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

Side by Side Diff: LayoutTests/fast/dom/HTMLDialogElement/dialog-return-value.html

Issue 373043004: IDL: Treat undefined as missing for optional arguments with defaults (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebased Created 6 years, 5 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 <!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 </head> 5 </head>
6 <body> 6 <body>
7 <dialog id="test-dialog"></dialog> 7 <dialog id="test-dialog"></dialog>
8 <script> 8 <script>
9 description("Tests that dialog.returnValue is settable and returns the last valu e set."); 9 description("Tests that dialog.returnValue is settable and returns the last valu e set.");
10 10
(...skipping 22 matching lines...) Expand all
33 33
34 dialog.show(); 34 dialog.show();
35 dialog.close(null); 35 dialog.close(null);
36 shouldBe("dialog.returnValue", "'null'"); 36 shouldBe("dialog.returnValue", "'null'");
37 37
38 dialog.returnValue = 'Should not change because no argument to close()'; 38 dialog.returnValue = 'Should not change because no argument to close()';
39 dialog.show(); 39 dialog.show();
40 dialog.close(); 40 dialog.close();
41 shouldBe("dialog.returnValue", "'Should not change because no argument to close( )'"); 41 shouldBe("dialog.returnValue", "'Should not change because no argument to close( )'");
42 42
43 dialog.returnValue = 'Should not change because of undefined argument to close() ';
44 dialog.show();
45 dialog.close(undefined);
46 shouldBe("dialog.returnValue", "'Should not change because of undefined argument to close()'");
47
43 dialog.returnValue = 'Should not change because close() is invalid'; 48 dialog.returnValue = 'Should not change because close() is invalid';
44 shouldThrow("dialog.close('blah')", '"InvalidStateError: Failed to execute \'clo se\' on \'HTMLDialogElement\': The element does not have an \'open\' attribute, and therefore cannot be closed."'); 49 shouldThrow("dialog.close('blah')", '"InvalidStateError: Failed to execute \'clo se\' on \'HTMLDialogElement\': The element does not have an \'open\' attribute, and therefore cannot be closed."');
45 shouldBe("dialog.returnValue", "'Should not change because close() is invalid'") ; 50 shouldBe("dialog.returnValue", "'Should not change because close() is invalid'") ;
46 </script> 51 </script>
47 </body> 52 </body>
48 </html> 53 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698