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

Side by Side Diff: chrome/browser/sync/profile_sync_service_session_unittest.cc

Issue 7977034: Revert 102184 - [Sync] use base::Time in sync (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 <map> 5 #include <map>
6 #include <string> 6 #include <string>
7 7
8 #include "base/location.h" 8 #include "base/location.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/message_loop.h" 10 #include "base/message_loop.h"
11 #include "base/scoped_temp_dir.h" 11 #include "base/scoped_temp_dir.h"
12 #include "base/stl_util.h" 12 #include "base/stl_util.h"
13 #include "base/task.h" 13 #include "base/task.h"
14 #include "base/time.h"
15 #include "chrome/browser/sessions/session_service_factory.h" 14 #include "chrome/browser/sessions/session_service_factory.h"
16 #include "chrome/browser/sessions/session_service.h" 15 #include "chrome/browser/sessions/session_service.h"
17 #include "chrome/browser/sessions/session_service_test_helper.h" 16 #include "chrome/browser/sessions/session_service_test_helper.h"
18 #include "chrome/browser/sync/abstract_profile_sync_service_test.h" 17 #include "chrome/browser/sync/abstract_profile_sync_service_test.h"
19 #include "chrome/browser/sync/glue/session_change_processor.h" 18 #include "chrome/browser/sync/glue/session_change_processor.h"
20 #include "chrome/browser/sync/glue/session_data_type_controller.h" 19 #include "chrome/browser/sync/glue/session_data_type_controller.h"
21 #include "chrome/browser/sync/glue/session_model_associator.h" 20 #include "chrome/browser/sync/glue/session_model_associator.h"
22 #include "chrome/browser/sync/glue/sync_backend_host.h" 21 #include "chrome/browser/sync/glue/sync_backend_host.h"
23 #include "chrome/browser/sync/internal_api/change_record.h" 22 #include "chrome/browser/sync/internal_api/change_record.h"
24 #include "chrome/browser/sync/internal_api/read_node.h" 23 #include "chrome/browser/sync/internal_api/read_node.h"
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after
309 tab->set_extension_app_id("app_id"); 308 tab->set_extension_app_id("app_id");
310 sync_pb::TabNavigation* navigation = tab->add_navigation(); 309 sync_pb::TabNavigation* navigation = tab->add_navigation();
311 navigation->set_index(12); 310 navigation->set_index(12);
312 navigation->set_virtual_url("http://foo/1"); 311 navigation->set_virtual_url("http://foo/1");
313 navigation->set_referrer("referrer"); 312 navigation->set_referrer("referrer");
314 navigation->set_title("title"); 313 navigation->set_title("title");
315 navigation->set_page_transition(sync_pb::TabNavigation_PageTransition_TYPED); 314 navigation->set_page_transition(sync_pb::TabNavigation_PageTransition_TYPED);
316 315
317 // Update the server with the session specifics. 316 // Update the server with the session specifics.
318 { 317 {
319 model_associator_->AssociateForeignSpecifics(meta_specifics, base::Time()); 318 model_associator_->AssociateForeignSpecifics(meta_specifics, 0);
320 model_associator_->AssociateForeignSpecifics(tab_specifics, base::Time()); 319 model_associator_->AssociateForeignSpecifics(tab_specifics, 0);
321 } 320 }
322 321
323 // Check that the foreign session was associated and retrieve the data. 322 // Check that the foreign session was associated and retrieve the data.
324 std::vector<const SyncedSession*> foreign_sessions; 323 std::vector<const SyncedSession*> foreign_sessions;
325 model_associator_->GetAllForeignSessions(&foreign_sessions); 324 model_associator_->GetAllForeignSessions(&foreign_sessions);
326 ASSERT_EQ(1U, foreign_sessions.size()); 325 ASSERT_EQ(1U, foreign_sessions.size());
327 ASSERT_EQ(machine_tag, foreign_sessions[0]->session_tag); 326 ASSERT_EQ(machine_tag, foreign_sessions[0]->session_tag);
328 ASSERT_EQ(1U, foreign_sessions[0]->windows.size()); 327 ASSERT_EQ(1U, foreign_sessions[0]->windows.size());
329 ASSERT_EQ(1U, foreign_sessions[0]->windows[0]->tabs.size()); 328 ASSERT_EQ(1U, foreign_sessions[0]->windows[0]->tabs.size());
330 ASSERT_EQ(1U, foreign_sessions[0]->windows[0]->tabs[0]->navigations.size()); 329 ASSERT_EQ(1U, foreign_sessions[0]->windows[0]->tabs[0]->navigations.size());
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
457 ASSERT_FALSE(model_associator_->tab_pool_.full()); 456 ASSERT_FALSE(model_associator_->tab_pool_.full());
458 for (size_t i = 0; i < num_ids; ++i) { 457 for (size_t i = 0; i < num_ids; ++i) {
459 model_associator_->tab_pool_.FreeTabNode(node_ids[i]); 458 model_associator_->tab_pool_.FreeTabNode(node_ids[i]);
460 } 459 }
461 ASSERT_EQ(num_ids, model_associator_->tab_pool_.capacity()); 460 ASSERT_EQ(num_ids, model_associator_->tab_pool_.capacity());
462 ASSERT_FALSE(model_associator_->tab_pool_.empty()); 461 ASSERT_FALSE(model_associator_->tab_pool_.empty());
463 ASSERT_TRUE(model_associator_->tab_pool_.full()); 462 ASSERT_TRUE(model_associator_->tab_pool_.full());
464 } 463 }
465 464
466 } // namespace browser_sync 465 } // namespace browser_sync
OLDNEW
« no previous file with comments | « chrome/browser/sync/internal_api/syncapi_unittest.cc ('k') | chrome/browser/sync/sessions/sync_session_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698