Skip to content

Commit

Permalink
Merge pull request #11314 from rwjblue/prevent-protocol-warnings
Browse files Browse the repository at this point in the history
[BUGFIX beta] Prevent `unsafe:` protocol popups in test suite.
  • Loading branch information
rwjblue committed May 31, 2015
2 parents 7e9cec4 + 4eab5d8 commit f932861
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions packages/ember-htmlbars/tests/attr_nodes/sanitized_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import EmberView from "ember-views/views/view";
import compile from "ember-template-compiler/system/compile";
import { SafeString } from "ember-htmlbars/utils/string";
import { runAppend, runDestroy } from "ember-runtime/tests/utils";
import { runDestroy } from "ember-runtime/tests/utils";
import environment from "ember-metal/environment";

var view;
Expand Down Expand Up @@ -71,7 +71,8 @@ for (var i=0, l=badTags.length; i<l; i++) {
context: { url: 'javascript://example.com' },
template: subject.unquotedTemplate
});
runAppend(view);

view.createElement();

equal(view.element.firstChild.getAttribute(subject.attr),
"unsafe:javascript://example.com",
Expand All @@ -83,7 +84,8 @@ for (var i=0, l=badTags.length; i<l; i++) {
context: { url: 'javascript://example.com' },
template: subject.quotedTemplate
});
runAppend(view);

view.createElement();

equal(view.element.firstChild.getAttribute(subject.attr),
"unsafe:javascript://example.com",
Expand All @@ -97,7 +99,7 @@ for (var i=0, l=badTags.length; i<l; i++) {
});

try {
runAppend(view);
view.createElement();

equal(view.element.firstChild.getAttribute(subject.attr),
"javascript://example.com",
Expand All @@ -113,7 +115,7 @@ for (var i=0, l=badTags.length; i<l; i++) {
context: { protocol: 'javascript:', path: '//example.com' },
template: subject.multipartTemplate
});
runAppend(view);
view.createElement();

equal(view.element.firstChild.getAttribute(subject.attr),
"unsafe:javascript://example.com",
Expand Down

0 comments on commit f932861

Please sign in to comment.