(self, *args)
| 46 | return self.search_app_instance(node.get_parent()) |
| 47 | |
| 48 | def refresh(self, *args): |
| 49 | if self.app_instance==None: |
| 50 | self.app_instance = self.search_app_instance(self) |
| 51 | if self.app_instance==None: |
| 52 | return |
| 53 | self.frame_index = self.frame_index + 1 |
| 54 | self.app_instance.execute_javascript(""" |
| 55 | url = '/%(id)s/get_image_data?index=%(frame_index)s'; |
| 56 | |
| 57 | xhr = null; |
| 58 | xhr = new XMLHttpRequest(); |
| 59 | xhr.open('GET', url, true); |
| 60 | xhr.responseType = 'blob' |
| 61 | xhr.onload = function(e){ |
| 62 | urlCreator = window.URL || window.webkitURL; |
| 63 | urlCreator.revokeObjectURL(document.getElementById('%(id)s').src); |
| 64 | imageUrl = urlCreator.createObjectURL(this.response); |
| 65 | document.getElementById('%(id)s').src = imageUrl; |
| 66 | } |
| 67 | xhr.send(); |
| 68 | """ % {'id': id(self), 'frame_index':self.frame_index}) |
| 69 | |
| 70 | def get_image_data(self, index=0): |
| 71 | try: |
no test coverage detected