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

Side by Side Diff: components/view_manager/test_change_tracker.cc

Issue 1223153003: Move JoinString to the base namespace (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: windows Created 5 years, 5 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "components/view_manager/test_change_tracker.h" 5 #include "components/view_manager/test_change_tracker.h"
6 6
7 #include "base/strings/string_util.h" 7 #include "base/strings/string_util.h"
8 #include "base/strings/stringprintf.h" 8 #include "base/strings/stringprintf.h"
9 #include "components/view_manager/public/cpp/util.h" 9 #include "components/view_manager/public/cpp/util.h"
10 #include "mojo/common/common_type_converters.h" 10 #include "mojo/common/common_type_converters.h"
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 return "more than one changes and expected only one"; 126 return "more than one changes and expected only one";
127 return views[0].ToString(); 127 return views[0].ToString();
128 } 128 }
129 129
130 std::string ChangeViewDescription(const std::vector<Change>& changes) { 130 std::string ChangeViewDescription(const std::vector<Change>& changes) {
131 if (changes.size() != 1) 131 if (changes.size() != 1)
132 return std::string(); 132 return std::string();
133 std::vector<std::string> view_strings(changes[0].views.size()); 133 std::vector<std::string> view_strings(changes[0].views.size());
134 for (size_t i = 0; i < changes[0].views.size(); ++i) 134 for (size_t i = 0; i < changes[0].views.size(); ++i)
135 view_strings[i] = "[" + changes[0].views[i].ToString() + "]"; 135 view_strings[i] = "[" + changes[0].views[i].ToString() + "]";
136 return JoinString(view_strings, ','); 136 return base::JoinString(view_strings, ",");
137 } 137 }
138 138
139 TestView ViewDataToTestView(const ViewDataPtr& data) { 139 TestView ViewDataToTestView(const ViewDataPtr& data) {
140 TestView view; 140 TestView view;
141 view.parent_id = data->parent_id; 141 view.parent_id = data->parent_id;
142 view.view_id = data->view_id; 142 view.view_id = data->view_id;
143 view.visible = data->visible; 143 view.visible = data->visible;
144 view.drawn = data->drawn; 144 view.drawn = data->drawn;
145 view.properties = 145 view.properties =
146 data->properties.To<std::map<std::string, std::vector<uint8_t>>>(); 146 data->properties.To<std::map<std::string, std::vector<uint8_t>>>();
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
324 324
325 std::string TestView::ToString2() const { 325 std::string TestView::ToString2() const {
326 return base::StringPrintf("view=%s parent=%s visible=%s drawn=%s", 326 return base::StringPrintf("view=%s parent=%s visible=%s drawn=%s",
327 ViewIdToString(view_id).c_str(), 327 ViewIdToString(view_id).c_str(),
328 ViewIdToString(parent_id).c_str(), 328 ViewIdToString(parent_id).c_str(),
329 visible ? "true" : "false", 329 visible ? "true" : "false",
330 drawn ? "true" : "false"); 330 drawn ? "true" : "false");
331 } 331 }
332 332
333 } // namespace view_manager 333 } // namespace view_manager
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698