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

Side by Side Diff: sync/sessions/sync_session_unittest.cc

Issue 10917234: sync: make scheduling logic and job ownership more obvious. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: eof Created 8 years, 1 month 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
« no previous file with comments | « sync/sessions/sync_session.cc ('k') | sync/sessions/test_util.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "sync/sessions/sync_session.h" 5 #include "sync/sessions/sync_session.h"
6 6
7 #include "base/compiler_specific.h" 7 #include "base/compiler_specific.h"
8 #include "base/location.h" 8 #include "base/location.h"
9 #include "base/memory/ref_counted.h" 9 #include "base/memory/ref_counted.h"
10 #include "base/message_loop.h" 10 #include "base/message_loop.h"
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after
340 expected_enabled_groups_one.insert(GROUP_DB); 340 expected_enabled_groups_one.insert(GROUP_DB);
341 341
342 std::set<ModelSafeGroup> expected_enabled_groups_two; 342 std::set<ModelSafeGroup> expected_enabled_groups_two;
343 expected_enabled_groups_two.insert(GROUP_PASSIVE); 343 expected_enabled_groups_two.insert(GROUP_PASSIVE);
344 expected_enabled_groups_two.insert(GROUP_DB); 344 expected_enabled_groups_two.insert(GROUP_DB);
345 expected_enabled_groups_two.insert(GROUP_UI); 345 expected_enabled_groups_two.insert(GROUP_UI);
346 346
347 EXPECT_EQ(expected_enabled_groups_one, one.GetEnabledGroups()); 347 EXPECT_EQ(expected_enabled_groups_one, one.GetEnabledGroups());
348 EXPECT_EQ(expected_enabled_groups_two, two.GetEnabledGroups()); 348 EXPECT_EQ(expected_enabled_groups_two, two.GetEnabledGroups());
349 349
350 two.RebaseRoutingInfoWithLatest(one); 350 two.RebaseRoutingInfoWithLatest(one.routing_info(), one.workers());
351 351
352 EXPECT_EQ(expected_enabled_groups_one, one.GetEnabledGroups()); 352 EXPECT_EQ(expected_enabled_groups_one, one.GetEnabledGroups());
353 EXPECT_EQ(expected_enabled_groups_one, two.GetEnabledGroups()); 353 EXPECT_EQ(expected_enabled_groups_one, two.GetEnabledGroups());
354 354
355 // Make sure the source has not been touched. 355 // Make sure the source has not been touched.
356 EXPECT_EQ(two.source().updates_source, 356 EXPECT_EQ(two.source().updates_source,
357 sync_pb::GetUpdatesCallerInfo::LOCAL); 357 sync_pb::GetUpdatesCallerInfo::LOCAL);
358 358
359 // Make sure the payload is reduced to one. 359 // Make sure the payload is reduced to one.
360 EXPECT_THAT(one_type, Eq(two.source().types)); 360 EXPECT_THAT(one_type, Eq(two.source().types));
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
410 workers_second); 410 workers_second);
411 411
412 std::set<ModelSafeGroup> expected_enabled_groups; 412 std::set<ModelSafeGroup> expected_enabled_groups;
413 expected_enabled_groups.insert(GROUP_PASSIVE); 413 expected_enabled_groups.insert(GROUP_PASSIVE);
414 expected_enabled_groups.insert(GROUP_DB); 414 expected_enabled_groups.insert(GROUP_DB);
415 expected_enabled_groups.insert(GROUP_UI); 415 expected_enabled_groups.insert(GROUP_UI);
416 416
417 EXPECT_EQ(expected_enabled_groups, first.GetEnabledGroups()); 417 EXPECT_EQ(expected_enabled_groups, first.GetEnabledGroups());
418 EXPECT_EQ(expected_enabled_groups, second.GetEnabledGroups()); 418 EXPECT_EQ(expected_enabled_groups, second.GetEnabledGroups());
419 419
420 second.RebaseRoutingInfoWithLatest(first); 420 second.RebaseRoutingInfoWithLatest(first.routing_info(), first.workers());
421 421
422 EXPECT_EQ(expected_enabled_groups, first.GetEnabledGroups()); 422 EXPECT_EQ(expected_enabled_groups, first.GetEnabledGroups());
423 EXPECT_EQ(expected_enabled_groups, second.GetEnabledGroups()); 423 EXPECT_EQ(expected_enabled_groups, second.GetEnabledGroups());
424 424
425 // Make sure the source has not been touched. 425 // Make sure the source has not been touched.
426 EXPECT_EQ(second.source().updates_source, 426 EXPECT_EQ(second.source().updates_source,
427 sync_pb::GetUpdatesCallerInfo::LOCAL); 427 sync_pb::GetUpdatesCallerInfo::LOCAL);
428 428
429 // Make sure our payload is still the same. 429 // Make sure our payload is still the same.
430 EXPECT_THAT(all_types, Eq(second.source().types)); 430 EXPECT_THAT(all_types, Eq(second.source().types));
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
476 476
477 ASSERT_EQ(3U, invalidation_map.size()); 477 ASSERT_EQ(3U, invalidation_map.size());
478 EXPECT_EQ(invalidation_map[BOOKMARKS].payload, payload); 478 EXPECT_EQ(invalidation_map[BOOKMARKS].payload, payload);
479 EXPECT_EQ(invalidation_map[PASSWORDS].payload, payload); 479 EXPECT_EQ(invalidation_map[PASSWORDS].payload, payload);
480 EXPECT_EQ(invalidation_map[AUTOFILL].payload, payload); 480 EXPECT_EQ(invalidation_map[AUTOFILL].payload, payload);
481 } 481 }
482 482
483 } // namespace 483 } // namespace
484 } // namespace sessions 484 } // namespace sessions
485 } // namespace syncer 485 } // namespace syncer
OLDNEW
« no previous file with comments | « sync/sessions/sync_session.cc ('k') | sync/sessions/test_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698