diff options
author | lipalani@chromium.org <lipalani@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-05 23:54:35 +0000 |
---|---|---|
committer | lipalani@chromium.org <lipalani@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-05 23:54:35 +0000 |
commit | 94237a99f9985c42a4795f2ec1fb1d1638d0d08c (patch) | |
tree | 6dc643ac84c0b9193766b44c0d37716a681a1849 /chrome/browser/sync | |
parent | b46848479ffd4950f44dfff33f2dcb58beb3e733 (diff) | |
download | chromium_src-94237a99f9985c42a4795f2ec1fb1d1638d0d08c.zip chromium_src-94237a99f9985c42a4795f2ec1fb1d1638d0d08c.tar.gz chromium_src-94237a99f9985c42a4795f2ec1fb1d1638d0d08c.tar.bz2 |
Depending on when the network change notification fires the client could go to OFFLINE or OFFLINE_UNSYNCED state. Update the code to reflect this.
BUG=105902
TEST=sync_integration_tests.exe
Review URL: http://codereview.chromium.org/9022035
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@116588 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/sync')
-rw-r--r-- | chrome/browser/sync/test/integration/single_client_bookmarks_sync_test.cc | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/chrome/browser/sync/test/integration/single_client_bookmarks_sync_test.cc b/chrome/browser/sync/test/integration/single_client_bookmarks_sync_test.cc index 009f33a..990d363 100644 --- a/chrome/browser/sync/test/integration/single_client_bookmarks_sync_test.cc +++ b/chrome/browser/sync/test/integration/single_client_bookmarks_sync_test.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -25,16 +25,22 @@ class SingleClientBookmarksSyncTest : public SyncTest { DISALLOW_COPY_AND_ASSIGN(SingleClientBookmarksSyncTest); }; -// This test is flaky; http://crbug.com/105902. -IN_PROC_BROWSER_TEST_F(SingleClientBookmarksSyncTest, FLAKY_OfflineToOnline) { +IN_PROC_BROWSER_TEST_F(SingleClientBookmarksSyncTest, OfflineToOnline) { ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; DisableNetwork(GetProfile(0)); const BookmarkNode* node = AddFolder(0, L"title"); SetTitle(0, node, L"new_title"); ASSERT_FALSE(GetClient(0)->AwaitFullSyncCompletion("Offline state change.")); - ASSERT_EQ(ProfileSyncService::Status::OFFLINE_UNSYNCED, - GetClient(0)->GetStatus().summary); + ProfileSyncService::Status status = GetClient(0)->GetStatus(); + + // Depending on when exactly the network change notification occurs the + // client could go to OFFLINE_UNSYNCED or OFFLINE. OFFLINE_UNSYNCED indicates + // client tried to sync a local change and could not connect to the server. + // OFFLINE indicates client received a network change notification of + // the disconnection even before it tried to sync. + ASSERT_TRUE(ProfileSyncService::Status::OFFLINE_UNSYNCED == status.summary || + ProfileSyncService::Status::OFFLINE == status.summary); EnableNetwork(GetProfile(0)); ASSERT_TRUE(GetClient(0)->AwaitFullSyncCompletion("Commit changes.")); |