| OLD | NEW |
| 1 window.jsTestIsAsync = true; | 1 window.jsTestIsAsync = true; |
| 2 | 2 |
| 3 var popupWindow = null; | 3 var popupWindow = null; |
| 4 | 4 |
| 5 var popupOpenCallback = null; | 5 var popupOpenCallback = null; |
| 6 | 6 |
| 7 function popupOpenCallbackWrapper() { | 7 function popupOpenCallbackWrapper() { |
| 8 popupWindow.removeEventListener("didOpenPicker", popupOpenCallbackWrapper); | 8 popupWindow.removeEventListener("didOpenPicker", popupOpenCallbackWrapper); |
| 9 setTimeout(popupOpenCallback, 0); | 9 setTimeout(popupOpenCallback, 0); |
| 10 } | 10 } |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 | 61 |
| 62 function setPopupOpenCallback(callback) { | 62 function setPopupOpenCallback(callback) { |
| 63 console.assert(popupWindow); | 63 console.assert(popupWindow); |
| 64 popupOpenCallback = (function(callback) { | 64 popupOpenCallback = (function(callback) { |
| 65 // We need to move the window to the top left of available space | 65 // We need to move the window to the top left of available space |
| 66 // because the window will move back to (0, 0) when the | 66 // because the window will move back to (0, 0) when the |
| 67 // ShellViewMsg_SetTestConfiguration IPC arrives. | 67 // ShellViewMsg_SetTestConfiguration IPC arrives. |
| 68 rootWindow().moveTo(); | 68 rootWindow().moveTo(); |
| 69 callback(); | 69 callback(); |
| 70 }).bind(this, callback); | 70 }).bind(this, callback); |
| 71 popupWindow.addEventListener("didOpenPicker", popupOpenCallbackWrapper, fals
e); | 71 try { |
| 72 popupWindow.addEventListener("didOpenPicker", popupOpenCallbackWrapper,
false); |
| 73 } catch(e) { |
| 74 debug(e.name); |
| 75 } |
| 72 } | 76 } |
| OLD | NEW |