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

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

Issue 2416483002: Use std::string instead of mojo::String in //net. (Closed)
Patch Set: Created 4 years, 2 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "net/proxy/mojo_proxy_resolver_v8_tracing_bindings.h" 5 #include "net/proxy/mojo_proxy_resolver_v8_tracing_bindings.h"
6 6
7 #include <string> 7 #include <string>
8 #include <utility> 8 #include <utility>
9 #include <vector> 9 #include <vector>
10 10
11 #include "base/macros.h" 11 #include "base/macros.h"
12 #include "base/strings/utf_string_conversions.h" 12 #include "base/strings/utf_string_conversions.h"
13 #include "testing/gtest/include/gtest/gtest.h" 13 #include "testing/gtest/include/gtest/gtest.h"
14 14
15 namespace net { 15 namespace net {
16 16
17 class MojoProxyResolverV8TracingBindingsTest : public testing::Test { 17 class MojoProxyResolverV8TracingBindingsTest : public testing::Test {
18 public: 18 public:
19 MojoProxyResolverV8TracingBindingsTest() = default; 19 MojoProxyResolverV8TracingBindingsTest() = default;
20 20
21 void SetUp() override { 21 void SetUp() override {
22 bindings_.reset(new MojoProxyResolverV8TracingBindings< 22 bindings_.reset(new MojoProxyResolverV8TracingBindings<
23 MojoProxyResolverV8TracingBindingsTest>(this)); 23 MojoProxyResolverV8TracingBindingsTest>(this));
24 } 24 }
25 25
26 void Alert(const mojo::String& message) { 26 void Alert(const std::string& message) { alerts_.push_back(message); }
27 alerts_.push_back(message.To<std::string>());
28 }
29 27
30 void OnError(int32_t line_number, const mojo::String& message) { 28 void OnError(int32_t line_number, const std::string& message) {
31 errors_.push_back(std::make_pair(line_number, message.To<std::string>())); 29 errors_.push_back(std::make_pair(line_number, message));
32 } 30 }
33 31
34 void ResolveDns(std::unique_ptr<HostResolver::RequestInfo> request_info, 32 void ResolveDns(std::unique_ptr<HostResolver::RequestInfo> request_info,
35 interfaces::HostResolverRequestClientPtr client) {} 33 interfaces::HostResolverRequestClientPtr client) {}
36 34
37 protected: 35 protected:
38 std::unique_ptr<MojoProxyResolverV8TracingBindings< 36 std::unique_ptr<MojoProxyResolverV8TracingBindings<
39 MojoProxyResolverV8TracingBindingsTest>> 37 MojoProxyResolverV8TracingBindingsTest>>
40 bindings_; 38 bindings_;
41 39
(...skipping 12 matching lines...) Expand all
54 EXPECT_FALSE(bindings_->GetNetLogWithSource().net_log()); 52 EXPECT_FALSE(bindings_->GetNetLogWithSource().net_log());
55 53
56 ASSERT_EQ(1u, alerts_.size()); 54 ASSERT_EQ(1u, alerts_.size());
57 EXPECT_EQ("alert", alerts_[0]); 55 EXPECT_EQ("alert", alerts_[0]);
58 ASSERT_EQ(1u, errors_.size()); 56 ASSERT_EQ(1u, errors_.size());
59 EXPECT_EQ(-1, errors_[0].first); 57 EXPECT_EQ(-1, errors_[0].first);
60 EXPECT_EQ("error", errors_[0].second); 58 EXPECT_EQ("error", errors_[0].second);
61 } 59 }
62 60
63 } // namespace net 61 } // namespace net
OLDNEW
« no previous file with comments | « net/proxy/mojo_proxy_resolver_v8_tracing_bindings.h ('k') | net/proxy/proxy_resolver_factory_mojo.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698