OLD | NEW |
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 <string> | 5 #include <string> |
6 #include <vector> | 6 #include <vector> |
7 | 7 |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "chrome/browser/sessions/session_types.h" | 10 #include "chrome/browser/sessions/session_types.h" |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 tab.navigations.push_back(nav); | 122 tab.navigations.push_back(nav); |
123 // NewTab does not count as valid if it's the only navigation. | 123 // NewTab does not count as valid if it's the only navigation. |
124 ASSERT_FALSE(ShouldSyncSessionTab(tab)); | 124 ASSERT_FALSE(ShouldSyncSessionTab(tab)); |
125 } | 125 } |
126 | 126 |
127 } // namespace | 127 } // namespace |
128 | 128 |
129 TEST_F(SyncSessionModelAssociatorTest, PopulateSessionHeader) { | 129 TEST_F(SyncSessionModelAssociatorTest, PopulateSessionHeader) { |
130 sync_pb::SessionHeader header_s; | 130 sync_pb::SessionHeader header_s; |
131 header_s.set_client_name("Client 1"); | 131 header_s.set_client_name("Client 1"); |
132 header_s.set_device_type(sync_pb::SessionHeader_DeviceType_TYPE_WIN); | 132 header_s.set_device_type(sync_pb::SyncEnums_DeviceType_TYPE_WIN); |
133 | 133 |
134 SyncedSession session; | 134 SyncedSession session; |
135 base::Time time = base::Time::Now(); | 135 base::Time time = base::Time::Now(); |
136 SessionModelAssociator::PopulateSessionHeaderFromSpecifics( | 136 SessionModelAssociator::PopulateSessionHeaderFromSpecifics( |
137 header_s, time, &session); | 137 header_s, time, &session); |
138 ASSERT_EQ("Client 1", session.session_name); | 138 ASSERT_EQ("Client 1", session.session_name); |
139 ASSERT_EQ(SyncedSession::TYPE_WIN, session.device_type); | 139 ASSERT_EQ(SyncedSession::TYPE_WIN, session.device_type); |
140 ASSERT_EQ(time, session.modified_time); | 140 ASSERT_EQ(time, session.modified_time); |
141 } | 141 } |
142 | 142 |
(...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
610 session_tab.navigations[2].virtual_url()); | 610 session_tab.navigations[2].virtual_url()); |
611 EXPECT_EQ(kTime1, session_tab.navigations[0].timestamp()); | 611 EXPECT_EQ(kTime1, session_tab.navigations[0].timestamp()); |
612 EXPECT_EQ(kTime2, session_tab.navigations[1].timestamp()); | 612 EXPECT_EQ(kTime2, session_tab.navigations[1].timestamp()); |
613 EXPECT_EQ(kTime3, session_tab.navigations[2].timestamp()); | 613 EXPECT_EQ(kTime3, session_tab.navigations[2].timestamp()); |
614 EXPECT_TRUE(session_tab.session_storage_persistent_id.empty()); | 614 EXPECT_TRUE(session_tab.session_storage_persistent_id.empty()); |
615 } | 615 } |
616 | 616 |
617 } // namespace | 617 } // namespace |
618 | 618 |
619 } // namespace browser_sync | 619 } // namespace browser_sync |
OLD | NEW |