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

Side by Side Diff: LayoutTests/fast/dom/Element/client-rect-list-argument.html

Issue 24203002: Improve generated "Not enough arguments." TypeError exceptions. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: NeedsRebaseline Created 7 years, 3 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 <link rel="help" href="http://dev.w3.org/csswg/cssom-view/#dom-clientrectlist-it em"> 4 <link rel="help" href="http://dev.w3.org/csswg/cssom-view/#dom-clientrectlist-it em">
5 <script src="../../js/resources/js-test-pre.js"></script> 5 <script src="../../js/resources/js-test-pre.js"></script>
6 <style> 6 <style>
7 #testArea { 7 #testArea {
8 width: 300px; 8 width: 300px;
9 } 9 }
10 #inner { 10 #inner {
(...skipping 12 matching lines...) Expand all
23 <script> 23 <script>
24 description("Tests that the ClientRectList.item() argument is correctly validate d."); 24 description("Tests that the ClientRectList.item() argument is correctly validate d.");
25 25
26 var clientRects = document.getElementById("testElement").getClientRects(); 26 var clientRects = document.getElementById("testElement").getClientRects();
27 shouldBe("clientRects.__proto__", "ClientRectList.prototype"); 27 shouldBe("clientRects.__proto__", "ClientRectList.prototype");
28 28
29 shouldBe("clientRects.length", "3"); 29 shouldBe("clientRects.length", "3");
30 shouldNotBe("clientRects.item(0)", "null"); 30 shouldNotBe("clientRects.item(0)", "null");
31 shouldNotBe("clientRects.item(1)", "null"); 31 shouldNotBe("clientRects.item(1)", "null");
32 shouldNotBe("clientRects.item(2)", "null"); 32 shouldNotBe("clientRects.item(2)", "null");
33 shouldThrow("clientRects.item()", "'TypeError: Not enough arguments'"); 33 shouldThrow("clientRects.item()", '"TypeError: Failed to execute \'item\' on \'C lientRectList\': 1 argument required, but only 0 present."');
34 shouldBe("clientRects.item(-4294967294)", "clientRects.item(2)"); // -4294967294 wraps to 2. 34 shouldBe("clientRects.item(-4294967294)", "clientRects.item(2)"); // -4294967294 wraps to 2.
35 35
36 // According to the specification, we should throw an IndexSizeError exception w hen index is 36 // According to the specification, we should throw an IndexSizeError exception w hen index is
37 // greater than the number of ClientRect objects associated with the object. 37 // greater than the number of ClientRect objects associated with the object.
38 // However, we currently just return null like Firefox 22. 38 // However, we currently just return null like Firefox 22.
39 shouldBeNull("clientRects.item(3)"); 39 shouldBeNull("clientRects.item(3)");
40 shouldBeNull("clientRects.item(999)"); 40 shouldBeNull("clientRects.item(999)");
41 shouldBeNull("clientRects.item(-1)"); 41 shouldBeNull("clientRects.item(-1)");
42 42
43 </script> 43 </script>
44 <script src="../../js/resources/js-test-post.js"></script> 44 <script src="../../js/resources/js-test-post.js"></script>
45 </body> 45 </body>
46 </html> 46 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698