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

Side by Side Diff: net/proxy/proxy_resolver_v8_unittest.cc

Issue 112963005: Update uses of UTF conversions in courgette/, device/, extensions/, google_apis/, gpu/, ipc/, media… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 12 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 | Annotate | Revision Log
« no previous file with comments | « net/proxy/proxy_resolver_v8.cc ('k') | net/proxy/proxy_resolver_winhttp.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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/compiler_specific.h" 5 #include "base/compiler_specific.h"
6 #include "base/file_util.h" 6 #include "base/file_util.h"
7 #include "base/path_service.h" 7 #include "base/path_service.h"
8 #include "base/strings/string_util.h" 8 #include "base/strings/string_util.h"
9 #include "base/strings/stringprintf.h" 9 #include "base/strings/stringprintf.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 10 matching lines...) Expand all
21 // Javascript bindings for ProxyResolverV8, which returns mock values. 21 // Javascript bindings for ProxyResolverV8, which returns mock values.
22 // Each time one of the bindings is called into, we push the input into a 22 // Each time one of the bindings is called into, we push the input into a
23 // list, for later verification. 23 // list, for later verification.
24 class MockJSBindings : public ProxyResolverV8::JSBindings { 24 class MockJSBindings : public ProxyResolverV8::JSBindings {
25 public: 25 public:
26 MockJSBindings() : my_ip_address_count(0), my_ip_address_ex_count(0), 26 MockJSBindings() : my_ip_address_count(0), my_ip_address_ex_count(0),
27 should_terminate(false) {} 27 should_terminate(false) {}
28 28
29 virtual void Alert(const base::string16& message) OVERRIDE { 29 virtual void Alert(const base::string16& message) OVERRIDE {
30 VLOG(1) << "PAC-alert: " << message; // Helpful when debugging. 30 VLOG(1) << "PAC-alert: " << message; // Helpful when debugging.
31 alerts.push_back(UTF16ToUTF8(message)); 31 alerts.push_back(base::UTF16ToUTF8(message));
32 } 32 }
33 33
34 virtual bool ResolveDns(const std::string& host, 34 virtual bool ResolveDns(const std::string& host,
35 ResolveDnsOperation op, 35 ResolveDnsOperation op,
36 std::string* output, 36 std::string* output,
37 bool* terminate) OVERRIDE { 37 bool* terminate) OVERRIDE {
38 *terminate = should_terminate; 38 *terminate = should_terminate;
39 39
40 if (op == MY_IP_ADDRESS) { 40 if (op == MY_IP_ADDRESS) {
41 my_ip_address_count++; 41 my_ip_address_count++;
(...skipping 21 matching lines...) Expand all
63 63
64 CHECK(false); 64 CHECK(false);
65 return false; 65 return false;
66 } 66 }
67 67
68 virtual void OnError(int line_number, 68 virtual void OnError(int line_number,
69 const base::string16& message) OVERRIDE { 69 const base::string16& message) OVERRIDE {
70 // Helpful when debugging. 70 // Helpful when debugging.
71 VLOG(1) << "PAC-error: [" << line_number << "] " << message; 71 VLOG(1) << "PAC-error: [" << line_number << "] " << message;
72 72
73 errors.push_back(UTF16ToUTF8(message)); 73 errors.push_back(base::UTF16ToUTF8(message));
74 errors_line_number.push_back(line_number); 74 errors_line_number.push_back(line_number);
75 } 75 }
76 76
77 // Mock values to return. 77 // Mock values to return.
78 std::string my_ip_address_result; 78 std::string my_ip_address_result;
79 std::string my_ip_address_ex_result; 79 std::string my_ip_address_ex_result;
80 std::string dns_resolve_result; 80 std::string dns_resolve_result;
81 std::string dns_resolve_ex_result; 81 std::string dns_resolve_ex_result;
82 82
83 // Inputs we got called with. 83 // Inputs we got called with.
(...skipping 535 matching lines...) Expand 10 before | Expand all | Expand 10 after
619 GURL("http://kittens/"), &proxy_info, 619 GURL("http://kittens/"), &proxy_info,
620 CompletionCallback(), NULL, BoundNetLog()); 620 CompletionCallback(), NULL, BoundNetLog());
621 621
622 EXPECT_EQ(OK, result); 622 EXPECT_EQ(OK, result);
623 EXPECT_EQ(0u, bindings->errors.size()); 623 EXPECT_EQ(0u, bindings->errors.size());
624 EXPECT_EQ("kittens:88", proxy_info.proxy_server().ToURI()); 624 EXPECT_EQ("kittens:88", proxy_info.proxy_server().ToURI());
625 } 625 }
626 626
627 } // namespace 627 } // namespace
628 } // namespace net 628 } // namespace net
OLDNEW
« no previous file with comments | « net/proxy/proxy_resolver_v8.cc ('k') | net/proxy/proxy_resolver_winhttp.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698