OLD | NEW |
---|---|
(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/dns/host_resolver_wrapper.h" | |
6 #include "extensions/browser/api/dns/mock_host_resolver_creator.h" | |
Yoyo Zhou
2014/08/08 20:12:07
These don't seem to be used.
Daniel Nishi
2014/08/08 20:30:26
Done.
| |
7 #include "extensions/browser/api/sockets_tcp/sockets_tcp_api.h" | |
8 #include "extensions/browser/api_test_utils.h" | |
9 #include "extensions/common/extension.h" | |
10 #include "extensions/common/test_util.h" | |
11 #include "extensions/shell/test/shell_test.h" | |
12 | |
13 using extensions::api_test_utils::RunFunctionAndReturnSingleResult; | |
14 | |
15 namespace extensions { | |
16 | |
17 class SocketsTcpApiTest : public AppShellTest {}; | |
18 | |
19 IN_PROC_BROWSER_TEST_F(SocketsTcpApiTest, SocketsTcpCreateGood) { | |
20 scoped_refptr<extensions::core_api::SocketsTcpCreateFunction> | |
21 socket_create_function( | |
22 new extensions::core_api::SocketsTcpCreateFunction()); | |
23 scoped_refptr<Extension> empty_extension = test_util::CreateEmptyExtension(); | |
24 | |
25 socket_create_function->set_extension(empty_extension.get()); | |
26 socket_create_function->set_has_callback(true); | |
27 | |
28 scoped_ptr<base::Value> result(RunFunctionAndReturnSingleResult( | |
29 socket_create_function.get(), "[]", browser_context())); | |
30 | |
31 ASSERT_EQ(base::Value::TYPE_DICTIONARY, result->GetType()); | |
32 base::DictionaryValue* value = | |
33 static_cast<base::DictionaryValue*>(result.get()); | |
34 int socketId = -1; | |
35 EXPECT_TRUE(value->GetInteger("socketId", &socketId)); | |
36 ASSERT_TRUE(socketId > 0); | |
37 } | |
38 | |
39 } // namespace extensions | |
OLD | NEW |