Permalink
Browse files

Merge pull request #2626 from ibolmo/fix-2609-add-message-Element-Nat…

…iveEvents

added to NativeEvents and added simple spec for compliance
  • Loading branch information...
arian committed Jul 4, 2014
2 parents d1dce0f + b1acc54 commit e01fdc18aebb73ef48424415e94a3ef92486ead2
Showing with 8 additions and 2 deletions.
  1. +1 −1 Source/Element/Element.Event.js
  2. +7 −1 Specs/Element/Element.Event.js
@@ -139,7 +139,7 @@ Element.NativeEvents = {
focus: 2, blur: 2, change: 2, reset: 2, select: 2, submit: 2, paste: 2, input: 2, //form elements
load: 2, unload: 1, beforeunload: 2, resize: 1, move: 1, DOMContentLoaded: 1, readystatechange: 1, //window
hashchange: 1, popstate: 2, // history
error: 1, abort: 1, scroll: 1 //misc
error: 1, abort: 1, scroll: 1, message: 2 //misc
};
Element.Events = {
@@ -202,7 +202,13 @@ describe('Element.Event', function(){
});
// Only run this spec in browsers other than IE6-8 because they can't properly simulate key events
if (window.postMessage && !navigator.userAgent.match(/phantomjs/i)) it('Should trigger message event', function(){
var spy = jasmine.createSpy('message');
window.addEvent('message', spy);
window.postMessage('test', 'http://localhost/');
expect(spy).toHaveBeenCalled();
});
it('Should watch for a key-down event', function(){
var callback = jasmine.createSpy('keydown');

0 comments on commit e01fdc1

Please sign in to comment.