OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/extensions/extension_apitest.h" | 5 #include "chrome/browser/extensions/extension_apitest.h" |
6 #include "chrome/browser/extensions/extension_message_service.h" | 6 #include "chrome/browser/extensions/extension_message_service.h" |
7 #include "chrome/browser/profile.h" | 7 #include "chrome/browser/profile.h" |
8 #include "chrome/common/notification_registrar.h" | 8 #include "chrome/common/notification_registrar.h" |
| 9 #include "googleurl/src/gurl.h" |
9 | 10 |
10 namespace { | 11 namespace { |
11 | 12 |
12 class MessageSender : public NotificationObserver { | 13 class MessageSender : public NotificationObserver { |
13 public: | 14 public: |
14 MessageSender() { | 15 MessageSender() { |
15 registrar_.Add(this, NotificationType::EXTENSION_HOST_DID_STOP_LOADING, | 16 registrar_.Add(this, NotificationType::EXTENSION_HOST_DID_STOP_LOADING, |
16 NotificationService::AllSources()); | 17 NotificationService::AllSources()); |
17 } | 18 } |
18 | 19 |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 | 65 |
65 ASSERT_TRUE(RunExtensionTest("messaging/connect_external")) << message_; | 66 ASSERT_TRUE(RunExtensionTest("messaging/connect_external")) << message_; |
66 } | 67 } |
67 | 68 |
68 // Tests that messages with event_urls are only passed to extensions with | 69 // Tests that messages with event_urls are only passed to extensions with |
69 // appropriate permissions. | 70 // appropriate permissions. |
70 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, MessagingEventURL) { | 71 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, MessagingEventURL) { |
71 MessageSender sender; | 72 MessageSender sender; |
72 ASSERT_TRUE(RunExtensionTest("messaging/event_url")) << message_; | 73 ASSERT_TRUE(RunExtensionTest("messaging/event_url")) << message_; |
73 } | 74 } |
OLD | NEW |