OLD | NEW |
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 "chrome/browser/profiles/profile.h" | 5 #include "chrome/browser/profiles/profile.h" |
6 #include "chrome/browser/sync/profile_sync_service_harness.h" | 6 #include "chrome/browser/sync/profile_sync_service_harness.h" |
7 #include "chrome/browser/sync/test/integration/bookmarks_helper.h" | 7 #include "chrome/browser/sync/test/integration/bookmarks_helper.h" |
8 #include "chrome/browser/sync/test/integration/sync_test.h" | 8 #include "chrome/browser/sync/test/integration/sync_test.h" |
9 | 9 |
10 using bookmarks_helper::AddFolder; | 10 using bookmarks_helper::AddFolder; |
11 using bookmarks_helper::AddURL; | 11 using bookmarks_helper::AddURL; |
12 using bookmarks_helper::GetBookmarkBarNode; | 12 using bookmarks_helper::GetBookmarkBarNode; |
13 using bookmarks_helper::GetOtherNode; | 13 using bookmarks_helper::GetOtherNode; |
14 using bookmarks_helper::ModelMatchesVerifier; | 14 using bookmarks_helper::ModelMatchesVerifier; |
15 using bookmarks_helper::Move; | 15 using bookmarks_helper::Move; |
16 using bookmarks_helper::Remove; | 16 using bookmarks_helper::Remove; |
17 using bookmarks_helper::SetTitle; | 17 using bookmarks_helper::SetTitle; |
18 | 18 |
19 class SingleClientBookmarksSyncTest : public SyncTest { | 19 class SingleClientBookmarksSyncTest : public SyncTest { |
20 public: | 20 public: |
21 SingleClientBookmarksSyncTest() : SyncTest(SINGLE_CLIENT) {} | 21 SingleClientBookmarksSyncTest() : SyncTest(SINGLE_CLIENT) {} |
22 virtual ~SingleClientBookmarksSyncTest() {} | 22 virtual ~SingleClientBookmarksSyncTest() {} |
23 | 23 |
24 private: | 24 private: |
25 DISALLOW_COPY_AND_ASSIGN(SingleClientBookmarksSyncTest); | 25 DISALLOW_COPY_AND_ASSIGN(SingleClientBookmarksSyncTest); |
26 }; | 26 }; |
27 | 27 |
28 IN_PROC_BROWSER_TEST_F(SingleClientBookmarksSyncTest, OfflineToOnline) { | 28 // This test is flaky; http://crbug.com/105902. |
| 29 IN_PROC_BROWSER_TEST_F(SingleClientBookmarksSyncTest, FLAKY_OfflineToOnline) { |
29 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; | 30 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; |
30 | 31 |
31 DisableNetwork(GetProfile(0)); | 32 DisableNetwork(GetProfile(0)); |
32 const BookmarkNode* node = AddFolder(0, L"title"); | 33 const BookmarkNode* node = AddFolder(0, L"title"); |
33 SetTitle(0, node, L"new_title"); | 34 SetTitle(0, node, L"new_title"); |
34 ASSERT_FALSE(GetClient(0)->AwaitFullSyncCompletion("Offline state change.")); | 35 ASSERT_FALSE(GetClient(0)->AwaitFullSyncCompletion("Offline state change.")); |
35 ASSERT_EQ(ProfileSyncService::Status::OFFLINE_UNSYNCED, | 36 ASSERT_EQ(ProfileSyncService::Status::OFFLINE_UNSYNCED, |
36 GetClient(0)->GetStatus().summary); | 37 GetClient(0)->GetStatus().summary); |
37 | 38 |
38 EnableNetwork(GetProfile(0)); | 39 EnableNetwork(GetProfile(0)); |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 0, tier1_a, 0, L"Toronto Maple Leafs", GURL("http://mapleleafs.nhl.com")); | 142 0, tier1_a, 0, L"Toronto Maple Leafs", GURL("http://mapleleafs.nhl.com")); |
142 const BookmarkNode* wynn = AddURL(0, bar, 1, L"Wynn", | 143 const BookmarkNode* wynn = AddURL(0, bar, 1, L"Wynn", |
143 GURL("http://www.wynnlasvegas.com")); | 144 GURL("http://www.wynnlasvegas.com")); |
144 | 145 |
145 Move(0, wynn, tier3_b, 0); | 146 Move(0, wynn, tier3_b, 0); |
146 Move(0, leafs, tier3_b, 0); | 147 Move(0, leafs, tier3_b, 0); |
147 ASSERT_TRUE(GetClient(0)->AwaitFullSyncCompletion( | 148 ASSERT_TRUE(GetClient(0)->AwaitFullSyncCompletion( |
148 "Move after addition of bookmarks.")); | 149 "Move after addition of bookmarks.")); |
149 ASSERT_TRUE(ModelMatchesVerifier(0)); | 150 ASSERT_TRUE(ModelMatchesVerifier(0)); |
150 } | 151 } |
OLD | NEW |