OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 function MockEventSource() { | 5 function MockEventSource() { |
6 this.listeners_ = []; | 6 this.listeners_ = []; |
7 } | 7 } |
8 | 8 |
9 /** | 9 /** |
10 * Add a listener. | 10 * Add a listener. |
(...skipping 795 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
806 | 806 |
807 /** | 807 /** |
808 * Mock object for |chrome.mediaPlayerPrivate|. | 808 * Mock object for |chrome.mediaPlayerPrivate|. |
809 */ | 809 */ |
810 chrome.mediaPlayerPrivate = { | 810 chrome.mediaPlayerPrivate = { |
811 | 811 |
812 onPlaylistChanged: new MockEventSource(), | 812 onPlaylistChanged: new MockEventSource(), |
813 | 813 |
814 onTogglePlayState: new MockEventSource(), | 814 onTogglePlayState: new MockEventSource(), |
815 | 815 |
| 816 onNextTrack: new MockEventSource(), |
| 817 |
| 818 onPrevTrack: new MockEventSource(), |
| 819 |
816 play: function(urls, position) { | 820 play: function(urls, position) { |
817 this.playlist_ = { items: urls, position: position }; | 821 this.playlist_ = { items: urls, position: position }; |
818 | 822 |
819 if (this.popup_) { | 823 if (this.popup_) { |
820 this.onPlaylistChanged.notify(); | 824 this.onPlaylistChanged.notify(); |
821 return; | 825 return; |
822 } | 826 } |
823 | 827 |
824 // Using global document is OK for the test harness. | 828 // Using global document is OK for the test harness. |
825 this.popup_ = document.createElement('iframe'); | 829 this.popup_ = document.createElement('iframe'); |
(...skipping 19 matching lines...) Expand all Loading... |
845 | 849 |
846 setWindowHeight: function(height) { | 850 setWindowHeight: function(height) { |
847 this.popup_.style.height = height + 'px'; | 851 this.popup_.style.height = height + 'px'; |
848 }, | 852 }, |
849 | 853 |
850 closeWindow: function() { | 854 closeWindow: function() { |
851 this.popup_.parentNode.removeChild(this.popup_); | 855 this.popup_.parentNode.removeChild(this.popup_); |
852 this.popup_ = null; | 856 this.popup_ = null; |
853 } | 857 } |
854 }; | 858 }; |
OLD | NEW |