OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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 "extensions/browser/api/dns/host_resolver_wrapper.h" | 5 #include "extensions/browser/api/dns/host_resolver_wrapper.h" |
6 #include "extensions/browser/api/dns/mock_host_resolver_creator.h" | 6 #include "extensions/browser/api/dns/mock_host_resolver_creator.h" |
7 #include "extensions/browser/api/sockets_udp/sockets_udp_api.h" | 7 #include "extensions/browser/api/sockets_udp/sockets_udp_api.h" |
8 #include "extensions/browser/api_test_utils.h" | 8 #include "extensions/browser/api_test_utils.h" |
9 #include "extensions/common/extension.h" | 9 #include "extensions/common/extension.h" |
10 #include "extensions/common/test_util.h" | 10 #include "extensions/common/test_util.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 socket_create_function( | 21 socket_create_function( |
22 new extensions::core_api::SocketsUdpCreateFunction()); | 22 new extensions::core_api::SocketsUdpCreateFunction()); |
23 scoped_refptr<Extension> empty_extension = test_util::CreateEmptyExtension(); | 23 scoped_refptr<Extension> empty_extension = test_util::CreateEmptyExtension(); |
24 | 24 |
25 socket_create_function->set_extension(empty_extension.get()); | 25 socket_create_function->set_extension(empty_extension.get()); |
26 socket_create_function->set_has_callback(true); | 26 socket_create_function->set_has_callback(true); |
27 | 27 |
28 scoped_ptr<base::Value> result(RunFunctionAndReturnSingleResult( | 28 scoped_ptr<base::Value> result(RunFunctionAndReturnSingleResult( |
29 socket_create_function.get(), "[]", browser_context())); | 29 socket_create_function.get(), "[]", browser_context())); |
30 | 30 |
31 base::DictionaryValue* value = NULL; | 31 base::DictionaryValue* value = nullptr; |
32 ASSERT_TRUE(result->GetAsDictionary(&value)); | 32 ASSERT_TRUE(result->GetAsDictionary(&value)); |
33 int socketId = -1; | 33 int socketId = -1; |
34 EXPECT_TRUE(value->GetInteger("socketId", &socketId)); | 34 EXPECT_TRUE(value->GetInteger("socketId", &socketId)); |
35 ASSERT_TRUE(socketId > 0); | 35 ASSERT_TRUE(socketId > 0); |
36 } | 36 } |
37 | 37 |
38 } // namespace extensions | 38 } // namespace extensions |
OLD | NEW |