diff options
author | mpcomplete@google.com <mpcomplete@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-08 18:35:34 +0000 |
---|---|---|
committer | mpcomplete@google.com <mpcomplete@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-08 18:35:34 +0000 |
commit | a40caa97fbdae3760f52f95f6b265bd1f39b19ae (patch) | |
tree | b98dceab49c4efb854c9923660735cbf96addbcd /chrome/renderer/render_view_unittest.cc | |
parent | 1b812ea42f713908a9034fcf2a26e8d4a8a86a04 (diff) | |
download | chromium_src-a40caa97fbdae3760f52f95f6b265bd1f39b19ae.zip chromium_src-a40caa97fbdae3760f52f95f6b265bd1f39b19ae.tar.gz chromium_src-a40caa97fbdae3760f52f95f6b265bd1f39b19ae.tar.bz2 |
Add aa's Event class to our javascript bindings and use it in our extension
message passing API.
Review URL: http://codereview.chromium.org/62069
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13371 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer/render_view_unittest.cc')
-rw-r--r-- | chrome/renderer/render_view_unittest.cc | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/chrome/renderer/render_view_unittest.cc b/chrome/renderer/render_view_unittest.cc index c27bcbf..95a584bb 100644 --- a/chrome/renderer/render_view_unittest.cc +++ b/chrome/renderer/render_view_unittest.cc @@ -4,6 +4,7 @@ #include "base/scoped_ptr.h" #include "chrome/common/render_messages.h" +#include "chrome/renderer/extensions/event_bindings.h" #include "chrome/renderer/extensions/renderer_extension_bindings.h" #include "chrome/renderer/mock_render_process.h" #include "chrome/renderer/mock_render_thread.h" @@ -66,6 +67,7 @@ class RenderViewTest : public testing::Test { // testing::Test virtual void SetUp() { WebKit::initialize(&webkitclient_); + WebKit::registerExtension(EventBindings::Get()); WebKit::registerExtension( extensions_v8::RendererExtensionBindings::Get(&render_thread_)); @@ -378,8 +380,8 @@ TEST_F(RenderViewTest, ExtensionMessagesOpenChannel) { LoadHTML("<body></body>"); ExecuteJavaScript( "var e = new chromium.Extension('foobar');" - "var port = e.openChannel();" - "port.onMessage = doOnMessage;" + "var port = e.connect();" + "port.onmessage.addListener(doOnMessage);" "port.postMessage('content ready');" "function doOnMessage(msg, port) {" " alert('content got: ' + msg);" @@ -420,10 +422,10 @@ TEST_F(RenderViewTest, ExtensionMessagesOpenChannel) { TEST_F(RenderViewTest, ExtensionMessagesOnConnect) { LoadHTML("<body></body>"); ExecuteJavaScript( - "chromium.addConnectListener(function (port) {" - " port.onMessage = doOnMessage;" + "chromium.onconnect.addListener(function (port) {" + " port.onmessage.addListener(doOnMessage);" " port.postMessage('onconnect');" - " });" + "});" "function doOnMessage(msg, port) {" " alert('got: ' + msg);" "}"); |