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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/dom/Range/script-tests/range-exceptions.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(
2 "This test checks some DOM Range exceptions."
3 );
4
5 // Test to be sure the name BAD_BOUNDARYPOINTS_ERR dumps properly.
6 var node = document.createElement("DIV");
7 node.innerHTML = "<BAR>AB<MOO>C</MOO>DE</BAR>";
8 shouldBe("node.innerHTML", "'<bar>AB<moo>C</moo>DE</bar>'");
9
10 // Ensure that we throw BAD_BOUNDARYPOINTS_ERR when trying to split a comment
11 // (non-text but character-offset node). (Test adapted from Acid3.)
12 var c1 = document.createComment("aaaaa");
13 node.appendChild(c1);
14 var c2 = document.createComment("bbbbb");
15 node.appendChild(c2);
16 var r = document.createRange();
17 r.setStart(c1, 2);
18 r.setEnd(c2, 3);
19 shouldThrow("r.surroundContents(document.createElement('a'))", '"InvalidStateErr or: Failed to execute \'surroundContents\' on \'Range\': The Range has partially selected a non-Text node."');
20
21 // But not when we don't try to split the comment.
22 r.setStart(c1, 0);
23 r.setEnd(c1, 5);
24 shouldThrow("r.surroundContents(document.createElement('a'))", '"HierarchyReques tError: Failed to execute \'surroundContents\' on \'Range\': The node to be inse rted is a \'A\' node, which may not be inserted here."');
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698