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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/dom/Window/script-tests/invalid-protocol.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 URL protocol setter.");
2
3 var a = document.createElement("a");
4 a.setAttribute("href", "http://www.apple.com/");
5 document.body.appendChild(a);
6
7 shouldThrow("location.protocol = ''", '"SyntaxError: Failed to set the \'protoco l\' property on \'Location\': \'\' is an invalid protocol."');
8 shouldThrow("location.protocol = ':'", '"SyntaxError: Failed to set the \'protoc ol\' property on \'Location\': \':\' is an invalid protocol."');
9 shouldThrow("location.protocol = 'é'", '"SyntaxError: Failed to set the \'protoc ol\' property on \'Location\': \'é\' is an invalid protocol."');
10 shouldThrow("location.protocol = '['", '"SyntaxError: Failed to set the \'protoc ol\' property on \'Location\': \'[\' is an invalid protocol."');
11 shouldThrow("location.protocol = '0'", '"SyntaxError: Failed to set the \'protoc ol\' property on \'Location\': \'0\' is an invalid protocol."');
12
13 // IE raises exceptions for anchors, too - but Firefox does not. In either case, protocol shouldn't change.
14 try { a.protocol = '' } catch (ex) { }
15 try { a.protocol = 'é' } catch (ex) { }
16 try { a.protocol = '[' } catch (ex) { }
17 try { a.protocol = '0' } catch (ex) { }
18 shouldBe("a.protocol", "'http:'");
19
20 a.protocol = "https";
21 shouldBe("a.href", "'https://www.apple.com/'");
22
23 a.protocol = "http:";
24 shouldBe("a.href", "'http://www.apple.com/'");
25
26 a.protocol = "https://foobar";
27 shouldBe("a.href", "'https://www.apple.com/'");
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698