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

Unified Diff: third_party/WebKit/LayoutTests/external/wpt/selection/collapseToStartEnd.html

Issue 2709623002: selection: Do not run invalid sub-tests with unselectable endpoints. (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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/external/wpt/selection/collapseToStartEnd-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/external/wpt/selection/collapseToStartEnd.html
diff --git a/third_party/WebKit/LayoutTests/external/wpt/selection/collapseToStartEnd.html b/third_party/WebKit/LayoutTests/external/wpt/selection/collapseToStartEnd.html
index 37c57fa788170cbca38f36cb7fd484b2fc1d77f8..07c2b843b40acad772eb477a118228be2444aff8 100644
--- a/third_party/WebKit/LayoutTests/external/wpt/selection/collapseToStartEnd.html
+++ b/third_party/WebKit/LayoutTests/external/wpt/selection/collapseToStartEnd.html
@@ -7,19 +7,19 @@
<script>
"use strict";
-// Also test a selection with no ranges
-testRanges.unshift("[]");
+test(function() {
+ selection.removeAllRanges();
+ assert_throws("INVALID_STATE_ERR", function() {
+ selection.collapseToStart();
+ });
+}, "Must throw InvalidStateErr if the selection's range is null");
for (var i = 0; i < testRanges.length; i++) {
+ var endpoints = eval(testRanges[i]);
+ if (!isSelectableNode(endpoints[0]) || !isSelectableNode(endpoints[2]))
+ continue;
test(function() {
selection.removeAllRanges();
- var endpoints = eval(testRanges[i]);
- if (!endpoints.length) {
- assert_throws("INVALID_STATE_ERR", function() {
- selection.collapseToStart();
- }, "Must throw InvalidStateErr if the selection's range is null");
- return;
- }
var addedRange = ownerDocument(endpoints[0]).createRange();
addedRange.setStart(endpoints[0], endpoints[1]);
@@ -66,13 +66,6 @@ for (var i = 0; i < testRanges.length; i++) {
// Copy-paste of above
test(function() {
selection.removeAllRanges();
- var endpoints = eval(testRanges[i]);
- if (!endpoints.length) {
- assert_throws("INVALID_STATE_ERR", function() {
- selection.collapseToEnd();
- }, "Must throw InvalidStateErr if the selection's range is null");
- return;
- }
var addedRange = ownerDocument(endpoints[0]).createRange();
addedRange.setStart(endpoints[0], endpoints[1]);
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/external/wpt/selection/collapseToStartEnd-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698