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

Side by Side Diff: chrome/browser/ui/webui/options/preferences_browsertest.cc

Issue 2771923005: Implement comparison operators for base::Value (Closed)
Patch Set: Fix compilation error Created 3 years, 9 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 | « base/values.cc ('k') | no next file » | 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 "chrome/browser/ui/webui/options/preferences_browsertest.h" 5 #include "chrome/browser/ui/webui/options/preferences_browsertest.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <iostream> 9 #include <iostream>
10 #include <memory> 10 #include <memory>
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 #endif 60 #endif
61 61
62 using testing::AllOf; 62 using testing::AllOf;
63 using testing::Mock; 63 using testing::Mock;
64 using testing::Property; 64 using testing::Property;
65 using testing::Return; 65 using testing::Return;
66 using testing::_; 66 using testing::_;
67 67
68 namespace base { 68 namespace base {
69 69
70 // Helper for using EXPECT_EQ() with base::Value.
71 bool operator==(const base::Value& first, const base::Value& second) {
72 return first.Equals(&second);
73 }
74
75 // Helper for pretty-printing the contents of base::Value in case of failures. 70 // Helper for pretty-printing the contents of base::Value in case of failures.
76 void PrintTo(const base::Value& value, std::ostream* stream) { 71 void PrintTo(const base::Value& value, std::ostream* stream) {
jdoerrie 2017/03/24 16:33:16 Given the presence of |std::ostream& operator<<(st
77 std::string json; 72 std::string json;
78 JSONWriter::Write(value, &json); 73 JSONWriter::Write(value, &json);
79 *stream << json; 74 *stream << json;
80 } 75 }
81 76
82 } // namespace base 77 } // namespace base
83 78
84 // Googlemock matcher for base::Value. 79 // Googlemock matcher for base::Value.
85 MATCHER_P(EqualsValue, expected, "") { 80 MATCHER_P(EqualsValue, expected, "") {
86 return arg && arg->Equals(expected); 81 return arg && arg->Equals(expected);
(...skipping 1015 matching lines...) Expand 10 before | Expand all | Expand 10 after
1102 base::Value(3)); 1097 base::Value(3));
1103 SetProxyPref(chromeos::proxy_cros_settings_parser::kProxySocksPort, 1098 SetProxyPref(chromeos::proxy_cros_settings_parser::kProxySocksPort,
1104 base::Value(4)); 1099 base::Value(4));
1105 1100
1106 VerifyCurrentProxyServer( 1101 VerifyCurrentProxyServer(
1107 "http=a.com:1;https=4.3.2.1:2;ftp=c.com:3;socks=socks4://d.com:4", 1102 "http=a.com:1;https=4.3.2.1:2;ftp=c.com:3;socks=socks4://d.com:4",
1108 onc::ONC_SOURCE_NONE); 1103 onc::ONC_SOURCE_NONE);
1109 } 1104 }
1110 1105
1111 #endif 1106 #endif
OLDNEW
« no previous file with comments | « base/values.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698