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

Side by Side Diff: chrome/browser/sync/glue/session_model_associator_unittest.cc

Issue 10911073: NOT FOR COMMIT: Add DeviceInfo type and ChangeProcessor (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix several issues Created 8 years, 3 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 | Annotate | Revision Log
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 <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
122 string16(ASCIIToUTF16("title")), 122 string16(ASCIIToUTF16("title")),
123 std::string("state"), content::PageTransitionFromInt(0)); 123 std::string("state"), content::PageTransitionFromInt(0));
124 tab.navigations.push_back(nav); 124 tab.navigations.push_back(nav);
125 // NewTab does not count as valid if it's the only navigation. 125 // NewTab does not count as valid if it's the only navigation.
126 ASSERT_FALSE(ShouldSyncSessionTab(tab)); 126 ASSERT_FALSE(ShouldSyncSessionTab(tab));
127 } 127 }
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 688 matching lines...) Expand 10 before | Expand all | Expand 10 after
831 sync_tab.navigation(2).virtual_url()); 831 sync_tab.navigation(2).virtual_url());
832 EXPECT_EQ(1, sync_tab.current_navigation_index()); 832 EXPECT_EQ(1, sync_tab.current_navigation_index());
833 EXPECT_EQ(2, sync_tab.navigation(0).timestamp()); 833 EXPECT_EQ(2, sync_tab.navigation(0).timestamp());
834 EXPECT_LE(now, sync_tab.navigation(1).timestamp()); 834 EXPECT_LE(now, sync_tab.navigation(1).timestamp());
835 EXPECT_LE(now, sync_tab.navigation(2).timestamp()); 835 EXPECT_LE(now, sync_tab.navigation(2).timestamp());
836 EXPECT_EQ(3U, prev_tab.navigations.size()); 836 EXPECT_EQ(3U, prev_tab.navigations.size());
837 EXPECT_EQ(3U, prev_tab.synced_tab_navigations.size()); 837 EXPECT_EQ(3U, prev_tab.synced_tab_navigations.size());
838 } 838 }
839 839
840 } // namespace browser_sync 840 } // namespace browser_sync
OLDNEW
« no previous file with comments | « chrome/browser/sync/glue/session_model_associator.cc ('k') | chrome/browser/sync/glue/sync_backend_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698