Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(194)

Side by Side Diff: chrome/browser/extensions/extension_messages_apitest.cc

Issue 16268017: GTTF: convert some tests in chrome to use EmbeddedTestServer patch nr 1 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_javascript_url_apitest.cc ('k') | chrome/browser/extensions/extension_tabs_apitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698