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

Side by Side Diff: LayoutTests/fast/js/script-tests/custom-constructors.js

Issue 839733003: Image() constructor's arguments should not have default values (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 11 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 description( 1 description(
2 "This test checks construction of objects with custom constructors." 2 "This test checks construction of objects with custom constructors."
3 ); 3 );
4 4
5 // Image tests 5 // Image tests
6 shouldBeNonNull("new Image()"); 6 shouldBeNonNull("new Image()");
7 shouldBeEqualToString("new Image().tagName", "IMG"); 7 shouldBeEqualToString("new Image().tagName", "IMG");
8 8
9 shouldBe("new Image().height", "0"); 9 shouldBe("new Image().height", "0");
10 shouldBe("new Image().width", "0"); 10 shouldBe("new Image().width", "0");
11 shouldBe("new Image(0).width", "0");
12 shouldBe("new Image(0, 0).height", "0");
11 shouldBe("new Image(100).width", "100"); 13 shouldBe("new Image(100).width", "100");
12 shouldBe("new Image(100, 200).height", "200"); 14 shouldBe("new Image(100, 200).height", "200");
13 shouldBe("new Image(-100).width", "-100"); 15 shouldBe("new Image(-100).width", "-100");
14 shouldBe("new Image(-100, -200).height", "-200"); 16 shouldBe("new Image(-100, -200).height", "-200");
15 17
18 shouldBe("new Image().hasAttribute('height')", "false");
19 shouldBe("new Image().hasAttribute('width')", "false");
20 shouldBe("new Image(0).hasAttribute('height')", "false");
21 shouldBe("new Image(0).hasAttribute('width')", "true");
22 shouldBe("new Image(0, 0).hasAttribute('height')", "true");
23 shouldBe("new Image(0, 0).hasAttribute('width')", "true");
24
16 shouldBeEqualToString("new Image().outerHTML","<img>"); 25 shouldBeEqualToString("new Image().outerHTML","<img>");
17 // FIXME: shouldBeEqualToString strips quotes from the string. 26 // FIXME: shouldBeEqualToString strips quotes from the string.
18 shouldBeEqualToString("new Image(100, 100).outerHTML.replace(/\"/g, \"'\")", "<i mg width='100' height='100'>"); 27 shouldBeEqualToString("new Image(100, 100).outerHTML.replace(/\"/g, \"'\")", "<i mg width='100' height='100'>");
19 28
20 // Option tests 29 // Option tests
21 shouldBeNonNull("new Option()"); 30 shouldBeNonNull("new Option()");
22 shouldBeEqualToString("new Option().tagName", "OPTION"); 31 shouldBeEqualToString("new Option().tagName", "OPTION");
23 32
24 shouldBeEqualToString("new Option().innerText", ""); 33 shouldBeEqualToString("new Option().innerText", "");
25 shouldBeEqualToString("new Option(null).innerText", "null"); 34 shouldBeEqualToString("new Option(null).innerText", "null");
(...skipping 22 matching lines...) Expand all
48 shouldBeEqualToString("new Option('somedata', 'somevalue', true).outerHTML.repla ce(/\"/g,\"'\")", "<option value='somevalue' selected=''>somedata</option>"); 57 shouldBeEqualToString("new Option('somedata', 'somevalue', true).outerHTML.repla ce(/\"/g,\"'\")", "<option value='somevalue' selected=''>somedata</option>");
49 58
50 // Audio tests 59 // Audio tests
51 shouldBeNonNull("new Audio()"); 60 shouldBeNonNull("new Audio()");
52 shouldBeEqualToString("new Audio().tagName", "AUDIO"); 61 shouldBeEqualToString("new Audio().tagName", "AUDIO");
53 62
54 shouldBeEqualToString("new Audio().src", ""); 63 shouldBeEqualToString("new Audio().src", "");
55 shouldBeEqualToString("new Audio().preload", "auto"); 64 shouldBeEqualToString("new Audio().preload", "auto");
56 shouldBeEqualToString("new Audio('http://127.0.0.1/someurl').src", "http://127.0 .0.1/someurl"); 65 shouldBeEqualToString("new Audio('http://127.0.0.1/someurl').src", "http://127.0 .0.1/someurl");
57 shouldBeEqualToString("new Audio('http://127.0.0.1/someurl').preload", "auto"); 66 shouldBeEqualToString("new Audio('http://127.0.0.1/someurl').preload", "auto");
OLDNEW
« no previous file with comments | « LayoutTests/fast/js/custom-constructors-expected.txt ('k') | Source/core/html/HTMLImageElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698