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

Side by Side Diff: third_party/WebKit/LayoutTests/imported/web-platform-tests/dom/nodes/Document-createProcessingInstruction.js

Issue 1529523002: Import dom/ from web-platform-tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: tweak W3CImportExpectations Created 5 years 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 test(function() {
2 var invalid = [
3 ["A", "?>"],
4 ["\u00B7A", "x"],
5 ["\u00D7A", "x"],
6 ["A\u00D7", "x"],
7 ["\\A", "x"],
8 ["\f", "x"],
9 [0, "x"],
10 ["0", "x"]
11 ],
12 valid = [
13 ["xml:fail", "x"],
14 ["A\u00B7A", "x"],
15 ["a0", "x"]
16 ]
17
18 for (var i = 0, il = invalid.length; i < il; i++) {
19 test(function() {
20 assert_throws("INVALID_CHARACTER_ERR", function() {
21 document.createProcessingInstruction(invalid[i][0], invalid[i][1])
22 })
23 }, "Should throw an INVALID_CHARACTER_ERR for target " +
24 format_value(invalid[i][0]) + " and data " +
25 format_value(invalid[i][1]) + ".")
26 }
27 for (var i = 0, il = valid.length; i < il; ++i) {
28 test(function() {
29 var pi = document.createProcessingInstruction(valid[i][0], valid[i][1]);
30 assert_equals(pi.target, valid[i][0]);
31 assert_equals(pi.data, valid[i][1]);
32 assert_equals(pi.ownerDocument, document);
33 assert_true(pi instanceof ProcessingInstruction);
34 assert_true(pi instanceof Node);
35 }, "Should get a ProcessingInstruction for target " +
36 format_value(valid[i][0]) + " and data " +
37 format_value(valid[i][1]) + ".")
38 }
39 })
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698