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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/dom/HTMLAnchorElement/script-tests/set-href-attribute-whitespace.js

Issue 2667393002: Stop using script-tests in fast/dom/. (Closed)
Patch Set: . Created 3 years, 10 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
(Empty)
1 description('Test setting the href attribute of an HTMLAnchorElement to a URL wi th leading and trailing whitespace.');
2
3 var a = document.createElement('a');
4
5 debug("Set href that starts with a space");
6 a.href = " https://www.mydomain.com/path/testurl.html?key=value";
7 shouldBe("a.hostname", "'www.mydomain.com'");
8
9 debug("Set href that starts with a newline");
10 a.href = "\nhttps://www.mydomain.com/path/testurl.html?key=value";
11 shouldBe("a.hostname", "'www.mydomain.com'");
12
13 debug("Set href that starts with a tab");
14 a.href = "\thttps://www.mydomain.com/path/testurl.html?key=value";
15 shouldBe("a.hostname", "'www.mydomain.com'");
16
17 debug("Set href that starts with a carriage return");
18 a.href = "\rhttps://www.mydomain.com/path/testurl.html?key=value";
19 shouldBe("a.hostname", "'www.mydomain.com'");
20
21 debug("Set href that starts with a combination of newlines, spaces and tabs");
22 a.href = "\n \t\r \nhttps://www.mydomain.com/path/testurl.html?key=value";
23 shouldBe("a.hostname", "'www.mydomain.com'");
24
25 debug("Set href that ends with a space");
26 a.href = "https://www.mydomain.com/path/testurl.html?key=value ";
27 shouldBe("a.hostname", "'www.mydomain.com'");
28
29 debug("Set href that ends with a newline");
30 a.href = "https://www.mydomain.com/path/testurl.html?key=value\n";
31 shouldBe("a.hostname", "'www.mydomain.com'");
32
33 debug("Set href that ends with a tab");
34 a.href = "https://www.mydomain.com/path/testurl.html?key=value\t";
35 shouldBe("a.hostname", "'www.mydomain.com'");
36
37 debug("Set href that ends with a carriage return");
38 a.href = "https://www.mydomain.com/path/testurl.html?key=value\r";
39 shouldBe("a.hostname", "'www.mydomain.com'");
40
41 debug("Set href that ends with a combination of newlines, spaces and tabs");
42 a.href = "https://www.mydomain.com/path/testurl.html?key=value\n \t\r \n";
43 shouldBe("a.hostname", "'www.mydomain.com'");
44
45 debug("Set href that starts and ends with a combination of newlines, spaces and tabs");
46 a.href = "\n \t\r \nhttps://www.mydomain.com/path/testurl.html?key=value\n \t\r \n";
47 shouldBe("a.hostname", "'www.mydomain.com'");
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698