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

Side by Side Diff: components/sync/test/fake_server/sessions_hierarchy.cc

Issue 2725813003: reland of [sync] Add Sessions integration tests (Closed)
Patch Set: Switch back to WaitForURLOnServer, make everything a constant 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 | « components/sync/test/fake_server/sessions_hierarchy.h ('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 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 "components/sync/test/fake_server/sessions_hierarchy.h" 5 #include "components/sync/test/fake_server/sessions_hierarchy.h"
6 6
7 #include <sstream> 7 #include <sstream>
8 8
9 namespace fake_server { 9 namespace fake_server {
10 10
11 SessionsHierarchy::SessionsHierarchy() {} 11 SessionsHierarchy::SessionsHierarchy() {}
12 12
13 SessionsHierarchy::SessionsHierarchy(const SessionsHierarchy& other) = default;
14
15 SessionsHierarchy::SessionsHierarchy(
16 std::initializer_list<std::multiset<std::string>> windows)
17 : windows_(windows) {}
18
13 SessionsHierarchy::~SessionsHierarchy() {} 19 SessionsHierarchy::~SessionsHierarchy() {}
14 20
15 void SessionsHierarchy::AddWindow(const std::string& tab) { 21 void SessionsHierarchy::AddWindow(const std::string& tab) {
16 SessionsHierarchy::Window window; 22 windows_.insert({tab});
17 window.insert(tab);
18 windows_.insert(window);
19 } 23 }
20 24
21 void SessionsHierarchy::AddWindow(const std::multiset<std::string>& tabs) { 25 void SessionsHierarchy::AddWindow(const std::multiset<std::string>& tabs) {
22 windows_.insert(tabs); 26 windows_.insert(tabs);
23 } 27 }
24 28
25 std::string SessionsHierarchy::ToString() const { 29 std::string SessionsHierarchy::ToString() const {
26 std::stringstream output; 30 std::stringstream output;
27 output << "{"; 31 output << "{";
28 for (WindowContainer::const_iterator window_it = windows_.begin(); 32 for (WindowContainer::const_iterator window_it = windows_.begin();
(...skipping 13 matching lines...) Expand all
42 } 46 }
43 output << "}"; 47 output << "}";
44 return output.str(); 48 return output.str();
45 } 49 }
46 50
47 bool SessionsHierarchy::Equals(const SessionsHierarchy& other) const { 51 bool SessionsHierarchy::Equals(const SessionsHierarchy& other) const {
48 return windows_ == other.windows_; 52 return windows_ == other.windows_;
49 } 53 }
50 54
51 } // namespace fake_server 55 } // namespace fake_server
OLDNEW
« no previous file with comments | « components/sync/test/fake_server/sessions_hierarchy.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698