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

Unified Diff: tests/html/node_validator_important_if_you_suppress_make_the_bug_critical_test.dart

Issue 1148893004: Make sanitizer tests handle IE11, where tagName can't be clobbered (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Removing paranoia around tagName, which wasn't likely to work anyway Created 5 years, 7 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 | « tests/html/html.status ('k') | tools/dom/src/Validators.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/html/node_validator_important_if_you_suppress_make_the_bug_critical_test.dart
diff --git a/tests/html/node_validator_important_if_you_suppress_make_the_bug_critical_test.dart b/tests/html/node_validator_important_if_you_suppress_make_the_bug_critical_test.dart
index 34e29bb54ad15732d2ce8c6f2e86c6ebb4d3ff3e..a2a23c6823e390c738df00ea26a971f5c6e791f9 100644
--- a/tests/html/node_validator_important_if_you_suppress_make_the_bug_critical_test.dart
+++ b/tests/html/node_validator_important_if_you_suppress_make_the_bug_critical_test.dart
@@ -529,14 +529,33 @@ main() {
"<input id='bad' onmouseover='alert(1)'>",
"");
- testHtml('tagName makes containing form invalid',
- validator,
- "<form onmouseover='alert(2)'><input name='tagName'>",
- "");
+ test('tagName makes containing form invalid', () {
+ var fragment = document.body.createFragment(
+ "<form onmouseover='alert(2)'><input name='tagName'>",
+ validator: validator);
+ var form = fragment.lastChild;
+ // If the tagName was clobbered, the sanitizer should have removed
+ // the whole thing and form is null.
+ // If the tagName was not clobbered, then there will be content,
+ // but the tagName should be the normal value. IE11 has started
+ // doing this.
+ if (form != null) {
+ expect(form.tagName, 'FORM');
+ }
+ });
- testHtml('tagName without mouseover',
- validator,
- "<form><input name='tagName'>",
- "");
+ test('tagName without mouseover', () {
+ var fragment = document.body.createFragment(
+ "<form><input name='tagName'>",
+ validator: validator);
+ var form = fragment.lastChild;
+ // If the tagName was clobbered, the sanitizer should have removed
+ // the whole thing and form is null.
+ // If the tagName was not clobbered, then there will be content,
+ // but the tagName should be the normal value.
+ if (form != null) {
+ expect(form.tagName, 'FORM');
+ }
+ });
});
}
« no previous file with comments | « tests/html/html.status ('k') | tools/dom/src/Validators.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698