Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Bug 800240: Add tests against custom DOM events. #603

Closed
wants to merge 1 commit into from

4 participants

@ochameau
Owner

Try to reproduce regression reported in following bug without success.

https://bugzilla.mozilla.org/show_bug.cgi?id=800240

@KWierso KWierso closed this
@Mossop Mossop reopened this
@Gozala
Owner

@gozala you update the patch

@KWierso
Owner

Closing so @Gozala can open his own.

@KWierso KWierso closed this
@Gozala Gozala reopened this
@Gozala Gozala closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Oct 11, 2012
  1. @ochameau
This page is out of date. Refresh to see the latest.
Showing with 25 additions and 0 deletions.
  1. +25 −0 test/test-page-mod.js
View
25 test/test-page-mod.js
@@ -781,3 +781,28 @@ exports.testPageModCssAutomaticDestroy = function(test) {
}
});
};
+
+exports.testEvents = function(test) {
+ let content = "<script>\n new " + function DocumentScope() {
+ window.addEventListener("ContentScriptEvent", function () {
+ window.receivedEvent = true;
+ }, false);
+ } + "\n</script>";
+ let url = "data:text/html;charset=utf-8," + encodeURIComponent(content);
+ testPageMod(test, url, [{
+ include: "data:*",
+ contentScript: 'new ' + function WorkerScope() {
+ let evt = document.createEvent("Event");
+ evt.initEvent("ContentScriptEvent", true, true);
+ document.body.dispatchEvent(evt);
+ }
+ }],
+ function(win, done) {
+ test.assert(
+ win.receivedEvent,
+ "Content script sent an event and document received it"
+ );
+ done();
+ }
+ );
+};
Something went wrong with that request. Please try again.