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

Unified Diff: net/proxy/proxy_resolver_v8_unittest.cc

Issue 38001: Implement the PAC js-binding for "myIpAddress()". (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: update unittest for DnsResolve based on new empty string Created 11 years, 10 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/proxy/proxy_resolver_v8.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/proxy/proxy_resolver_v8_unittest.cc
===================================================================
--- net/proxy/proxy_resolver_v8_unittest.cc (revision 10746)
+++ net/proxy/proxy_resolver_v8_unittest.cc (working copy)
@@ -380,12 +380,14 @@
net::ProxyResolverV8 resolver;
net::ProxyResolverV8::JSBindings* bindings = resolver.js_bindings();
+ // Considered an error.
+ EXPECT_EQ("", bindings->DnsResolve(""));
+
const struct {
const char* input;
const char* expected;
} tests[] = {
{"www.google.com", "127.0.0.1"},
- {"", ""},
{".", ""},
{"foo@google.com", ""},
{"@google.com", ""},
@@ -424,3 +426,14 @@
}
}
+TEST(ProxyResolverV8DefaultBindingsTest, MyIpAddress) {
+ // Get a hold of a DefaultJSBindings* (it is a hidden impl class).
+ net::ProxyResolverV8 resolver;
+ net::ProxyResolverV8::JSBindings* bindings = resolver.js_bindings();
+
+ // Our ip address is always going to be 127.0.0.1, since we are using a
+ // mock host mapper when running in unit-test mode.
+ std::string my_ip_address = bindings->MyIpAddress();
+
+ EXPECT_EQ("127.0.0.1", my_ip_address);
+}
« no previous file with comments | « net/proxy/proxy_resolver_v8.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698