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

Unified Diff: chrome/browser/sync/glue/session_model_associator_unittest.cc

Issue 7740055: Set user-visible machine names and devices types for synced sessions. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Fix tests Created 9 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/sync/glue/session_model_associator_mac.mm ('k') | chrome/browser/sync/glue/synced_session.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « chrome/browser/sync/glue/session_model_associator_mac.mm ('k') | chrome/browser/sync/glue/synced_session.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698