OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "base/files/file_path.h" | 5 #include "base/files/file_path.h" |
6 #include "base/path_service.h" | 6 #include "base/path_service.h" |
7 #include "base/strings/string_number_conversions.h" | 7 #include "base/strings/string_number_conversions.h" |
8 #include "base/strings/stringprintf.h" | 8 #include "base/strings/stringprintf.h" |
9 #include "base/values.h" | 9 #include "base/values.h" |
10 #include "chrome/browser/extensions/event_router.h" | 10 #include "chrome/browser/extensions/event_router.h" |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 GURL())); | 85 GURL())); |
86 } | 86 } |
87 | 87 |
88 content::NotificationRegistrar registrar_; | 88 content::NotificationRegistrar registrar_; |
89 }; | 89 }; |
90 | 90 |
91 } // namespace | 91 } // namespace |
92 | 92 |
93 // Tests that message passing between extensions and content scripts works. | 93 // Tests that message passing between extensions and content scripts works. |
94 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, Messaging) { | 94 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, Messaging) { |
95 ASSERT_TRUE(StartTestServer()); | 95 ASSERT_TRUE(StartEmbeddedTestServer()); |
96 ASSERT_TRUE(RunExtensionTest("messaging/connect")) << message_; | 96 ASSERT_TRUE(RunExtensionTest("messaging/connect")) << message_; |
97 } | 97 } |
98 | 98 |
99 // Tests that message passing from one extension to another works. | 99 // Tests that message passing from one extension to another works. |
100 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, MessagingExternal) { | 100 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, MessagingExternal) { |
101 ASSERT_TRUE(LoadExtension( | 101 ASSERT_TRUE(LoadExtension( |
102 test_data_dir_.AppendASCII("..").AppendASCII("good") | 102 test_data_dir_.AppendASCII("..").AppendASCII("good") |
103 .AppendASCII("Extensions") | 103 .AppendASCII("Extensions") |
104 .AppendASCII("bjafgdebaacbbbecmhlhpofkepfkgcpa") | 104 .AppendASCII("bjafgdebaacbbbecmhlhpofkepfkgcpa") |
105 .AppendASCII("1.0"))); | 105 .AppendASCII("1.0"))); |
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
307 // will no longer exist. | 307 // will no longer exist. |
308 DisableExtension(web_connectable->id()); | 308 DisableExtension(web_connectable->id()); |
309 EXPECT_EQ(NAMESPACE_NOT_DEFINED, | 309 EXPECT_EQ(NAMESPACE_NOT_DEFINED, |
310 CanConnectAndSendMessages(web_connectable->id())); | 310 CanConnectAndSendMessages(web_connectable->id())); |
311 | 311 |
312 EnableExtension(web_connectable->id()); | 312 EnableExtension(web_connectable->id()); |
313 EXPECT_EQ(OK, CanConnectAndSendMessages(web_connectable->id())); | 313 EXPECT_EQ(OK, CanConnectAndSendMessages(web_connectable->id())); |
314 EXPECT_EQ(COULD_NOT_ESTABLISH_CONNECTION_ERROR, | 314 EXPECT_EQ(COULD_NOT_ESTABLISH_CONNECTION_ERROR, |
315 CanConnectAndSendMessages(not_connectable->id())); | 315 CanConnectAndSendMessages(not_connectable->id())); |
316 } | 316 } |
OLD | NEW |