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

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: comments Created 8 years, 3 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 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 173
174 ExtensionTestMessageListener listener("info_please", true); 174 ExtensionTestMessageListener listener("info_please", true);
175 175
176 ASSERT_TRUE(LoadExtension(test_data_dir_.AppendASCII("socket/api"))); 176 ASSERT_TRUE(LoadExtension(test_data_dir_.AppendASCII("socket/api")));
177 EXPECT_TRUE(listener.WaitUntilSatisfied()); 177 EXPECT_TRUE(listener.WaitUntilSatisfied());
178 listener.Reply( 178 listener.Reply(
179 base::StringPrintf("tcp:%s:%d", host_port_pair.host().c_str(), port)); 179 base::StringPrintf("tcp:%s:%d", host_port_pair.host().c_str(), port));
180 180
181 EXPECT_TRUE(catcher.GetNextResult()) << catcher.message(); 181 EXPECT_TRUE(catcher.GetNextResult()) << catcher.message();
182 } 182 }
183
184 IN_PROC_BROWSER_TEST_F(SocketApiTest, SocketTCPServerExtension) {
185 ResultCatcher catcher;
186 catcher.RestrictToProfile(browser()->profile());
187 ExtensionTestMessageListener listener("info_please", true);
188 ASSERT_TRUE(LoadExtension(test_data_dir_.AppendASCII("socket/api")));
189 EXPECT_TRUE(listener.WaitUntilSatisfied());
190 listener.Reply(
191 base::StringPrintf("tcp_server:%s:%d", kHostname.c_str(), kPort));
192
193 EXPECT_TRUE(catcher.GetNextResult()) << catcher.message();
194 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698