| OLD | NEW |
| 1 HOLA!!! If you dont see the message DONE, then there is an error in the script. | 1 HOLA!!! If you dont see the message DONE, then there is an error in the script. |
| 2 <br> | 2 <br> |
| 3 | 3 |
| 4 <script type="text/javascript"> | 4 <script type="text/javascript"> |
| 5 // This extension registers for all tab and window events, and whenever one | 5 // This extension registers for all tab and window events, and whenever one |
| 6 // is received, it calls postMessage to send it back to the test automation | 6 // is received, it calls postMessage to send it back to the test automation |
| 7 // driver. | 7 // driver. |
| 8 | 8 |
| 9 // Wait for the automation server to create a port so that we can communicate | 9 // Wait for the automation server to create a port so that we can communicate |
| 10 // back to it. | 10 // back to it. |
| 11 var portToAutomation; | 11 var portToAutomation; |
| 12 chrome.self.onConnect.addListener(function(port) { | 12 chrome.extension.onConnect.addListener(function(port) { |
| 13 portToAutomation = port; | 13 portToAutomation = port; |
| 14 portToAutomation.postMessage('ACK'); | 14 portToAutomation.postMessage('ACK'); |
| 15 }); | 15 }); |
| 16 | 16 |
| 17 // Window events. | 17 // Window events. |
| 18 chrome.windows.onCreated.addListener(function(createInfo) { | 18 chrome.windows.onCreated.addListener(function(createInfo) { |
| 19 portToAutomation.postMessage(chrome.windows.onCreated.eventName_); | 19 portToAutomation.postMessage(chrome.windows.onCreated.eventName_); |
| 20 }); | 20 }); |
| 21 chrome.windows.onRemoved.addListener(function(windowId) { | 21 chrome.windows.onRemoved.addListener(function(windowId) { |
| 22 portToAutomation.postMessage(chrome.windows.onRemoved.eventName_); | 22 portToAutomation.postMessage(chrome.windows.onRemoved.eventName_); |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 portToAutomation.postMessage( | 66 portToAutomation.postMessage( |
| 67 chrome.bookmarks.onChildrenReordered.eventName_); | 67 chrome.bookmarks.onChildrenReordered.eventName_); |
| 68 }); | 68 }); |
| 69 | 69 |
| 70 // Call chrome window api. The result of this api is not important, as this | 70 // Call chrome window api. The result of this api is not important, as this |
| 71 // is used only to let the automation test driver know that this page is | 71 // is used only to let the automation test driver know that this page is |
| 72 // loaded and ready to receive events. | 72 // loaded and ready to receive events. |
| 73 chrome.windows.getCurrent(function() {}); | 73 chrome.windows.getCurrent(function() {}); |
| 74 document.write('DONE'); | 74 document.write('DONE'); |
| 75 </script> | 75 </script> |
| OLD | NEW |