diff options
author | rafaelw@chromium.org <rafaelw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-16 23:13:55 +0000 |
---|---|---|
committer | rafaelw@chromium.org <rafaelw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-16 23:13:55 +0000 |
commit | a902489dc0a391b0bfa92b8a172aa6369b568436 (patch) | |
tree | df5210dd269a1b5ba952a66f40e1740592da1cf6 /chrome/test | |
parent | 560541ea404af23c1e91f0ef83b4ed11022a84c7 (diff) | |
download | chromium_src-a902489dc0a391b0bfa92b8a172aa6369b568436.zip chromium_src-a902489dc0a391b0bfa92b8a172aa6369b568436.tar.gz chromium_src-a902489dc0a391b0bfa92b8a172aa6369b568436.tar.bz2 |
submitted on behalf of rogerta (Roger Tawa).
Original issue: http://codereview.chromium.org/119325
r=rafaelw,Jói,stoyan,aa
Review URL: http://codereview.chromium.org/125206
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18555 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test')
-rwxr-xr-x | chrome/test/data/extensions/uitest/event_sink/manifest.json | 5 | ||||
-rwxr-xr-x | chrome/test/data/extensions/uitest/event_sink/test.html | 79 |
2 files changed, 84 insertions, 0 deletions
diff --git a/chrome/test/data/extensions/uitest/event_sink/manifest.json b/chrome/test/data/extensions/uitest/event_sink/manifest.json new file mode 100755 index 0000000..830243d --- /dev/null +++ b/chrome/test/data/extensions/uitest/event_sink/manifest.json @@ -0,0 +1,5 @@ +{ + "version": "1.0.0.0", + "name": "Browser Event Sink Test Extension", + "description": "An extension UITest for testing the sending of browser events." +} diff --git a/chrome/test/data/extensions/uitest/event_sink/test.html b/chrome/test/data/extensions/uitest/event_sink/test.html new file mode 100755 index 0000000..2520d48 --- /dev/null +++ b/chrome/test/data/extensions/uitest/event_sink/test.html @@ -0,0 +1,79 @@ +HOLA!!! + +<script type="text/javascript"> + // This extension registers for all tab and window events, and whenever one + // is received, it calls postMessage to send it back to the test automation + // driver. + + // Wait for the automation server to create a port so that we can communicate + // back to it. + var portToAutomation; + chrome.self.onConnect.addListener(function(port) { + portToAutomation = port; + portToAutomation.postMessage('ACK'); + }); + + // Window events. + chrome.windows.onCreated.addListener(function(windowId) { + portToAutomation.postMessage(chrome.windows.onCreated.eventName_); + }); + chrome.windows.onRemoved.addListener(function(windowId) { + portToAutomation.postMessage(chrome.windows.onRemoved.eventName_); + }); + chrome.windows.onFocusChanged.addListener(function(windowId) { + portToAutomation.postMessage(chrome.windows.onFocusChanged.eventName_); + }); + + // Tab events. + chrome.tabs.onCreated.addListener(function(tab) { + portToAutomation.postMessage(chrome.tabs.onCreated.eventName_); + }); + chrome.tabs.onUpdated.addListener(function(tabId, info) { + portToAutomation.postMessage(chrome.tabs.onUpdated.eventName_); + }); + chrome.tabs.onMoved.addListener(function(tabId, info) { + portToAutomation.postMessage(chrome.tabs.onMoved.eventName_); + }); + chrome.tabs.onSelectionChanged.addListener(function(tabId, info) { + portToAutomation.postMessage(chrome.tabs.onSelectionChanged.eventName_); + }); + chrome.tabs.onAttached.addListener(function(tabId, info) { + portToAutomation.postMessage(chrome.tabs.onAttached.eventName_); + }); + chrome.tabs.onDetached.addListener(function(tabId, info) { + portToAutomation.postMessage(chrome.tabs.onDetached.eventName_); + }); + chrome.tabs.onRemoved.addListener(function(tabId) { + portToAutomation.postMessage(chrome.tabs.onRemoved.eventName_); + }); + + // Page action events. + chrome.pageActions.onExecute.addListener(function(info) { + portToAutomation.postMessage(chrome.pageActions.onExecute.eventName_); + }); + + // Bookmark events. + chrome.bookmarks.onAdded.addListener(function(info) { + portToAutomation.postMessage(chrome.bookmarks.onAdded.eventName_); + }); + chrome.bookmarks.onRemoved.addListener(function(info) { + portToAutomation.postMessage(chrome.bookmarks.onRemoved.eventName_); + }); + chrome.bookmarks.onChanged.addListener(function(bookmarkId, info) { + portToAutomation.postMessage(chrome.bookmarks.onChanged.eventName_); + }); + chrome.bookmarks.onMoved.addListener(function(info) { + portToAutomation.postMessage(chrome.bookmarks.onMoved.eventName_); + }); + chrome.bookmarks.onChildrenReordered.addListener(function(bookmarkId, + children) { + portToAutomation.postMessage( + chrome.bookmarks.onChildrenReordered.eventName_); + }); + + // Call chrome window api. The result of this api is not important, as this + // is used only to let the automation test driver know that this page is + // loaded and ready to receive events. + chrome.windows.getCurrent(function() {}); + document.write('DONE'); +</script> |