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

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: Remove unrelated changes. 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 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 155
156 ExtensionTestMessageListener listener("info_please", true); 156 ExtensionTestMessageListener listener("info_please", true);
157 157
158 ASSERT_TRUE(LoadExtension(test_data_dir_.AppendASCII("socket/api"))); 158 ASSERT_TRUE(LoadExtension(test_data_dir_.AppendASCII("socket/api")));
159 EXPECT_TRUE(listener.WaitUntilSatisfied()); 159 EXPECT_TRUE(listener.WaitUntilSatisfied());
160 listener.Reply( 160 listener.Reply(
161 base::StringPrintf("tcp:%s:%d", host_port_pair.host().c_str(), port)); 161 base::StringPrintf("tcp:%s:%d", host_port_pair.host().c_str(), port));
162 162
163 EXPECT_TRUE(catcher.GetNextResult()) << catcher.message(); 163 EXPECT_TRUE(catcher.GetNextResult()) << catcher.message();
164 } 164 }
165
166 IN_PROC_BROWSER_TEST_F(SocketApiTest, SocketTCPServerExtension) {
167 ResultCatcher catcher;
168 catcher.RestrictToProfile(browser()->profile());
169 ExtensionTestMessageListener listener("info_please", true);
170 ASSERT_TRUE(LoadExtension(test_data_dir_.AppendASCII("socket/api")));
171 EXPECT_TRUE(listener.WaitUntilSatisfied());
172 listener.Reply(
173 base::StringPrintf("tcp_server:%s:%d", kHostname.c_str(), kPort));
174
175 EXPECT_TRUE(catcher.GetNextResult()) << catcher.message();
176 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698