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

Unified Diff: net/dns/dns_config_service_win_unittest.cc

Issue 23522036: [net/dns] Treat Name Resolution Policy Table as unhandled option. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: responded to review Created 7 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/dns/dns_config_service_win.cc ('k') | net/dns/host_resolver_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/dns/dns_config_service_win_unittest.cc
diff --git a/net/dns/dns_config_service_win_unittest.cc b/net/dns/dns_config_service_win_unittest.cc
index b28b8e9554a233f8c60c5f5b3997614bbd42816c..3f3e4ed1e3758a34b7844dab51b96923421dd90b 100644
--- a/net/dns/dns_config_service_win_unittest.cc
+++ b/net/dns/dns_config_service_win_unittest.cc
@@ -4,6 +4,7 @@
#include "net/dns/dns_config_service_win.h"
+#include "base/basictypes.h"
#include "base/logging.h"
#include "base/win/windows_version.h"
#include "net/dns/dns_protocol.h"
@@ -420,10 +421,46 @@ TEST(DnsConfigServiceWinTest, AppendToMultiLabelName) {
DnsConfig config;
EXPECT_EQ(internal::CONFIG_PARSE_WIN_OK,
internal::ConvertSettingsToDnsConfig(settings, &config));
- EXPECT_EQ(config.append_to_multi_label_name, t.expected_output);
+ EXPECT_EQ(t.expected_output, config.append_to_multi_label_name);
}
}
+// Setting have_name_resolution_policy_table should set unhandled_options.
+TEST(DnsConfigServiceWinTest, HaveNRPT) {
+ AdapterInfo infos[2] = {
+ { IF_TYPE_USB, IfOperStatusUp, L"connection.suffix", { "1.0.0.1" } },
+ { 0 },
+ };
+
+ const struct TestCase {
+ bool have_nrpt;
+ bool unhandled_options;
+ internal::ConfigParseWinResult result;
+ } cases[] = {
+ { false, false, internal::CONFIG_PARSE_WIN_OK },
+ { true, true, internal::CONFIG_PARSE_WIN_UNHANDLED_OPTIONS },
+ };
+
+ for (size_t i = 0; i < arraysize(cases); ++i) {
+ const TestCase& t = cases[i];
+ internal::DnsSystemSettings settings = {
+ CreateAdapterAddresses(infos),
+ { false }, { false }, { false }, { false },
+ { { false }, { false } },
+ { { false }, { false } },
+ { { false }, { false } },
+ { false },
+ t.have_nrpt,
+ };
+ DnsConfig config;
+ EXPECT_EQ(t.result,
+ internal::ConvertSettingsToDnsConfig(settings, &config));
+ EXPECT_EQ(t.unhandled_options, config.unhandled_options);
+ EXPECT_EQ(t.have_nrpt, config.use_local_ipv6);
+ }
+}
+
+
} // namespace
} // namespace net
« no previous file with comments | « net/dns/dns_config_service_win.cc ('k') | net/dns/host_resolver_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698