summaryrefslogtreecommitdiffstats
path: root/chrome/browser/extensions/extension_messages_apitest.cc
diff options
context:
space:
mode:
authorkoz@chromium.org <koz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-06-25 03:40:08 +0000
committerkoz@chromium.org <koz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-06-25 03:40:08 +0000
commit64804d573437ccefc95c88306523850009fcc516 (patch)
tree6f82cee566aaa7075cb2726512bdc6b3cba7295d /chrome/browser/extensions/extension_messages_apitest.cc
parentab95315836cae6073fac88174f50653c6b2b0025 (diff)
downloadchromium_src-64804d573437ccefc95c88306523850009fcc516.zip
chromium_src-64804d573437ccefc95c88306523850009fcc516.tar.gz
chromium_src-64804d573437ccefc95c88306523850009fcc516.tar.bz2
Filtered events.
Makes web_navigation events support filters, eg: chrome.webNavigation.onBeforeCommitted.addListener(callback, {url: [{hostSuffix: 'google.com'}]}); Now callback will only be called when the event has a URL with a host suffix of google.com. BUG=121479 Review URL: https://chromiumcodereview.appspot.com/10514013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@143872 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions/extension_messages_apitest.cc')
-rw-r--r--chrome/browser/extensions/extension_messages_apitest.cc12
1 files changed, 8 insertions, 4 deletions
diff --git a/chrome/browser/extensions/extension_messages_apitest.cc b/chrome/browser/extensions/extension_messages_apitest.cc
index afb94ca..a61882d 100644
--- a/chrome/browser/extensions/extension_messages_apitest.cc
+++ b/chrome/browser/extensions/extension_messages_apitest.cc
@@ -31,19 +31,23 @@ class MessageSender : public content::NotificationObserver {
event_router->DispatchEventToRenderers("test.onMessage",
"[{\"lastMessage\":false,\"data\":\"no restriction\"}]",
content::Source<Profile>(source).ptr(),
- GURL());
+ GURL(),
+ EventFilteringInfo());
event_router->DispatchEventToRenderers("test.onMessage",
"[{\"lastMessage\":false,\"data\":\"http://a.com/\"}]",
content::Source<Profile>(source).ptr(),
- GURL("http://a.com/"));
+ GURL("http://a.com/"),
+ EventFilteringInfo());
event_router->DispatchEventToRenderers("test.onMessage",
"[{\"lastMessage\":false,\"data\":\"http://b.com/\"}]",
content::Source<Profile>(source).ptr(),
- GURL("http://b.com/"));
+ GURL("http://b.com/"),
+ EventFilteringInfo());
event_router->DispatchEventToRenderers("test.onMessage",
"[{\"lastMessage\":true,\"data\":\"last message\"}]",
content::Source<Profile>(source).ptr(),
- GURL());
+ GURL(),
+ EventFilteringInfo());
}
content::NotificationRegistrar registrar_;