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

Side by Side Diff: extensions/browser/api/system_network/system_network_apitest.cc

Issue 2539363004: Make base::Value::TYPE a scoped enum. (Closed)
Patch Set: Rebase Created 4 years 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/storage/storage_api.cc ('k') | extensions/browser/extension_function.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/strings/stringprintf.h" 6 #include "base/strings/stringprintf.h"
7 #include "extensions/browser/api/system_network/system_network_api.h" 7 #include "extensions/browser/api/system_network/system_network_api.h"
8 #include "extensions/browser/api_test_utils.h" 8 #include "extensions/browser/api_test_utils.h"
9 #include "extensions/common/test_util.h" 9 #include "extensions/common/test_util.h"
10 #include "extensions/shell/test/shell_apitest.h" 10 #include "extensions/shell/test/shell_apitest.h"
(...skipping 18 matching lines...) Expand all
29 scoped_refptr<SystemNetworkGetNetworkInterfacesFunction> socket_function( 29 scoped_refptr<SystemNetworkGetNetworkInterfacesFunction> socket_function(
30 new SystemNetworkGetNetworkInterfacesFunction()); 30 new SystemNetworkGetNetworkInterfacesFunction());
31 scoped_refptr<Extension> empty_extension( 31 scoped_refptr<Extension> empty_extension(
32 extensions::test_util::CreateEmptyExtension()); 32 extensions::test_util::CreateEmptyExtension());
33 33
34 socket_function->set_extension(empty_extension.get()); 34 socket_function->set_extension(empty_extension.get());
35 socket_function->set_has_callback(true); 35 socket_function->set_has_callback(true);
36 36
37 std::unique_ptr<base::Value> result(RunFunctionAndReturnSingleResult( 37 std::unique_ptr<base::Value> result(RunFunctionAndReturnSingleResult(
38 socket_function.get(), "[]", browser_context())); 38 socket_function.get(), "[]", browser_context()));
39 ASSERT_EQ(base::Value::TYPE_LIST, result->GetType()); 39 ASSERT_EQ(base::Value::Type::LIST, result->GetType());
40 40
41 // All we can confirm is that we have at least one address, but not what it 41 // All we can confirm is that we have at least one address, but not what it
42 // is. 42 // is.
43 base::ListValue* value = static_cast<base::ListValue*>(result.get()); 43 base::ListValue* value = static_cast<base::ListValue*>(result.get());
44 ASSERT_TRUE(value->GetSize() > 0); 44 ASSERT_TRUE(value->GetSize() > 0);
45 45
46 for (const auto& network_interface_value : *value) { 46 for (const auto& network_interface_value : *value) {
47 NetworkInterface network_interface; 47 NetworkInterface network_interface;
48 ASSERT_TRUE(NetworkInterface::Populate(*network_interface_value, 48 ASSERT_TRUE(NetworkInterface::Populate(*network_interface_value,
49 &network_interface)); 49 &network_interface));
50 50
51 LOG(INFO) << "Network interface: address=" << network_interface.address 51 LOG(INFO) << "Network interface: address=" << network_interface.address
52 << ", name=" << network_interface.name 52 << ", name=" << network_interface.name
53 << ", prefix length=" << network_interface.prefix_length; 53 << ", prefix length=" << network_interface.prefix_length;
54 ASSERT_NE(std::string(), network_interface.address); 54 ASSERT_NE(std::string(), network_interface.address);
55 ASSERT_NE(std::string(), network_interface.name); 55 ASSERT_NE(std::string(), network_interface.name);
56 ASSERT_LE(0, network_interface.prefix_length); 56 ASSERT_LE(0, network_interface.prefix_length);
57 } 57 }
58 } 58 }
OLDNEW
« no previous file with comments | « extensions/browser/api/storage/storage_api.cc ('k') | extensions/browser/extension_function.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698