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

Side by Side Diff: chrome/browser/extensions/api/socket/socket_apitest.cc

Issue 10827390: Implement chrome.socket.bind/listen/accept for TCP server socket. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix tests Created 8 years, 2 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/memory/ref_counted.h" 5 #include "base/memory/ref_counted.h"
6 #include "base/stringprintf.h" 6 #include "base/stringprintf.h"
7 #include "chrome/browser/extensions/api/dns/host_resolver_wrapper.h" 7 #include "chrome/browser/extensions/api/dns/host_resolver_wrapper.h"
8 #include "chrome/browser/extensions/api/dns/mock_host_resolver_creator.h" 8 #include "chrome/browser/extensions/api/dns/mock_host_resolver_creator.h"
9 #include "chrome/browser/extensions/api/socket/socket_api.h" 9 #include "chrome/browser/extensions/api/socket/socket_api.h"
10 #include "chrome/browser/extensions/extension_apitest.h" 10 #include "chrome/browser/extensions/extension_apitest.h"
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 157
158 ExtensionTestMessageListener listener("info_please", true); 158 ExtensionTestMessageListener listener("info_please", true);
159 159
160 ASSERT_TRUE(LoadExtension(test_data_dir_.AppendASCII("socket/api"))); 160 ASSERT_TRUE(LoadExtension(test_data_dir_.AppendASCII("socket/api")));
161 EXPECT_TRUE(listener.WaitUntilSatisfied()); 161 EXPECT_TRUE(listener.WaitUntilSatisfied());
162 listener.Reply( 162 listener.Reply(
163 base::StringPrintf("tcp:%s:%d", host_port_pair.host().c_str(), port)); 163 base::StringPrintf("tcp:%s:%d", host_port_pair.host().c_str(), port));
164 164
165 EXPECT_TRUE(catcher.GetNextResult()) << catcher.message(); 165 EXPECT_TRUE(catcher.GetNextResult()) << catcher.message();
166 } 166 }
167
168 IN_PROC_BROWSER_TEST_F(SocketApiTest, SocketTCPServerExtension) {
169 ResultCatcher catcher;
170 catcher.RestrictToProfile(browser()->profile());
171 ExtensionTestMessageListener listener("info_please", true);
172 ASSERT_TRUE(LoadExtension(test_data_dir_.AppendASCII("socket/api")));
173 EXPECT_TRUE(listener.WaitUntilSatisfied());
174 listener.Reply(
175 base::StringPrintf("tcp_server:%s:%d", kHostname.c_str(), kPort));
176
177 EXPECT_TRUE(catcher.GetNextResult()) << catcher.message();
178 }
179
180 IN_PROC_BROWSER_TEST_F(SocketApiTest, SocketExperimentalPermissionTest) {
181 ResultCatcher catcher;
182 catcher.RestrictToProfile(browser()->profile());
183
184 ExtensionTestMessageListener listener("ready", true);
185
186 ASSERT_TRUE(LoadExtension(test_data_dir_.AppendASCII("socket/experimental")));
187 EXPECT_TRUE(listener.WaitUntilSatisfied());
188 listener.Reply("go");
189
190 EXPECT_TRUE(catcher.GetNextResult()) << catcher.message();
191 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/api/socket/socket_api.cc ('k') | chrome/browser/extensions/api/socket/tcp_socket.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698