Index: chrome/browser/sync/glue/session_model_associator_unittest.cc |
diff --git a/chrome/browser/sync/glue/session_model_associator_unittest.cc b/chrome/browser/sync/glue/session_model_associator_unittest.cc |
index b6c5986f4829beeea5db4c4f61d47d404def6e6f..f3f7b290faf0ba5abb318cabc190296ccda16fda 100644 |
--- a/chrome/browser/sync/glue/session_model_associator_unittest.cc |
+++ b/chrome/browser/sync/glue/session_model_associator_unittest.cc |
@@ -15,6 +15,7 @@ |
using browser_sync::SessionModelAssociator; |
using browser_sync::SyncedSessionTracker; |
+ |
namespace browser_sync { |
typedef testing::Test SessionModelAssociatorTest; |
@@ -51,6 +52,18 @@ TEST_F(SessionModelAssociatorTest, IsValidSessionTab) { |
ASSERT_TRUE(SessionModelAssociator::IsValidSessionTab(tab)); |
} |
+TEST_F(SessionModelAssociatorTest, PopulateSessionHeader) { |
+ sync_pb::SessionHeader header_s; |
+ header_s.set_client_name("Client 1"); |
+ header_s.set_device_type(sync_pb::SessionHeader_DeviceType_TYPE_WIN); |
+ |
+ SyncedSession session; |
+ SessionModelAssociator::PopulateSessionHeaderFromSpecifics( |
+ header_s, &session); |
+ ASSERT_EQ("Client 1", session.session_name); |
+ ASSERT_EQ(SyncedSession::TYPE_WIN, session.device_type); |
+} |
+ |
TEST_F(SessionModelAssociatorTest, PopulateSessionWindow) { |
sync_pb::SessionWindow window_s; |
window_s.add_tab(0); |
@@ -158,5 +171,22 @@ TEST_F(SessionModelAssociatorTest, SyncedSessionTracker) { |
ASSERT_EQ(0U, tracker.num_synced_sessions()); |
} |
-} // namespace browser_sync |
+#if defined(OS_WIN) |
+// The test is somewhat silly, and just verifies that we return a computer name. |
+TEST(SessionModelAssociatorTest, TestGetComputerName) { |
+ std::string computer_name = SessionModelAssociator::GetComputerName(); |
+ EXPECT_TRUE(!computer_name.empty()); |
+} |
+#endif |
+ |
+#if defined(OS_MACOSX) |
+// The test is somewhat silly, and just verifies that we return a hardware |
+// model name. |
+TEST_F(SessionModelAssociatorTest, GetHardwareModelName) { |
+ std::string hardware_model = SessionModelAssociator::GetHardwareModelName(); |
+ EXPECT_TRUE(!hardware_model.empty()); |
+} |
+#endif |
+ |
+} // namespace browser_sync |