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

Side by Side Diff: extensions/browser/api/sockets_tcp/sockets_tcp_apitest.cc

Issue 449303002: Move SocketsTcpApiTest.SocketsTcpCreateGood to app_shell_browsertests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Yoyo comments. Created 6 years, 4 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
« no previous file with comments | « extensions/browser/api/dns/dns_apitest.cc ('k') | extensions/browser/api_test_utils.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "extensions/browser/api/sockets_tcp/sockets_tcp_api.h"
6 #include "extensions/browser/api_test_utils.h"
7 #include "extensions/common/extension.h"
8 #include "extensions/common/test_util.h"
9 #include "extensions/shell/test/shell_test.h"
10
11 using extensions::api_test_utils::RunFunctionAndReturnSingleResult;
12
13 namespace extensions {
14
15 class SocketsTcpApiTest : public AppShellTest {};
16
17 IN_PROC_BROWSER_TEST_F(SocketsTcpApiTest, SocketsTcpCreateGood) {
18 scoped_refptr<extensions::core_api::SocketsTcpCreateFunction>
19 socket_create_function(
20 new extensions::core_api::SocketsTcpCreateFunction());
21 scoped_refptr<Extension> empty_extension = test_util::CreateEmptyExtension();
22
23 socket_create_function->set_extension(empty_extension.get());
24 socket_create_function->set_has_callback(true);
25
26 scoped_ptr<base::Value> result(RunFunctionAndReturnSingleResult(
27 socket_create_function.get(), "[]", browser_context()));
28
29 ASSERT_EQ(base::Value::TYPE_DICTIONARY, result->GetType());
30 base::DictionaryValue* value =
31 static_cast<base::DictionaryValue*>(result.get());
32 int socketId = -1;
33 EXPECT_TRUE(value->GetInteger("socketId", &socketId));
34 ASSERT_TRUE(socketId > 0);
35 }
36
37 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/browser/api/dns/dns_apitest.cc ('k') | extensions/browser/api_test_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698