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

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

Issue 2816513002: Revert of Change base::Value::ListStorage to std::vector<base::Value> (Closed)
Patch Set: Created 3 years, 8 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/storage/storage_api.cc ('k') | extensions/browser/extension_prefs.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 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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/system_network/system_network_api.h" 5 #include "extensions/browser/api/system_network/system_network_api.h"
6 #include "extensions/browser/api_test_utils.h" 6 #include "extensions/browser/api_test_utils.h"
7 #include "extensions/browser/api_unittest.h" 7 #include "extensions/browser/api_unittest.h"
8 #include "extensions/common/test_util.h" 8 #include "extensions/common/test_util.h"
9 9
10 using extensions::api_test_utils::RunFunctionAndReturnSingleResult; 10 using extensions::api_test_utils::RunFunctionAndReturnSingleResult;
(...skipping 21 matching lines...) Expand all
32 socket_function.get(), "[]", browser_context())); 32 socket_function.get(), "[]", browser_context()));
33 ASSERT_EQ(base::Value::Type::LIST, result->GetType()); 33 ASSERT_EQ(base::Value::Type::LIST, result->GetType());
34 34
35 // All we can confirm is that we have at least one address, but not what it 35 // All we can confirm is that we have at least one address, but not what it
36 // is. 36 // is.
37 base::ListValue* value = static_cast<base::ListValue*>(result.get()); 37 base::ListValue* value = static_cast<base::ListValue*>(result.get());
38 ASSERT_TRUE(value->GetSize() > 0); 38 ASSERT_TRUE(value->GetSize() > 0);
39 39
40 for (const auto& network_interface_value : *value) { 40 for (const auto& network_interface_value : *value) {
41 NetworkInterface network_interface; 41 NetworkInterface network_interface;
42 ASSERT_TRUE(NetworkInterface::Populate(network_interface_value, 42 ASSERT_TRUE(NetworkInterface::Populate(*network_interface_value,
43 &network_interface)); 43 &network_interface));
44 44
45 LOG(INFO) << "Network interface: address=" << network_interface.address 45 LOG(INFO) << "Network interface: address=" << network_interface.address
46 << ", name=" << network_interface.name 46 << ", name=" << network_interface.name
47 << ", prefix length=" << network_interface.prefix_length; 47 << ", prefix length=" << network_interface.prefix_length;
48 ASSERT_NE(std::string(), network_interface.address); 48 ASSERT_NE(std::string(), network_interface.address);
49 ASSERT_NE(std::string(), network_interface.name); 49 ASSERT_NE(std::string(), network_interface.name);
50 ASSERT_LE(0, network_interface.prefix_length); 50 ASSERT_LE(0, network_interface.prefix_length);
51 } 51 }
52 } 52 }
53 53
54 } // namespace extensions 54 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/browser/api/storage/storage_api.cc ('k') | extensions/browser/extension_prefs.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698