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 "base/rand_util.h" | 5 #include "base/rand_util.h" |
6 #include "base/stringprintf.h" | |
7 #include "chrome/browser/profiles/profile.h" | 6 #include "chrome/browser/profiles/profile.h" |
8 #include "chrome/browser/sync/profile_sync_service_harness.h" | 7 #include "chrome/browser/sync/profile_sync_service_harness.h" |
9 #include "chrome/test/live_sync/live_bookmarks_sync_test.h" | 8 #include "chrome/test/live_sync/live_bookmarks_sync_test.h" |
10 | 9 |
11 const std::string kGenericURL = "http://www.host.ext:1234/path/filename"; | 10 const std::string kGenericURL = "http://www.host.ext:1234/path/filename"; |
12 const std::wstring kGenericURLTitle = L"URL Title"; | 11 const std::wstring kGenericURLTitle = L"URL Title"; |
13 const std::wstring kGenericFolderName = L"Folder Name"; | 12 const std::wstring kGenericFolderName = L"Folder Name"; |
14 const std::wstring kGenericSubfolderName = L"Subfolder Name"; | 13 const std::wstring kGenericSubfolderName = L"Subfolder Name"; |
15 const std::wstring kGenericSubsubfolderName = L"Subsubfolder Name"; | 14 const std::wstring kGenericSubsubfolderName = L"Subsubfolder Name"; |
16 | 15 |
17 static std::string IndexedURL(int i) { | |
18 return StringPrintf("http://www.host.ext:1234/path/filename/%d", i); | |
19 } | |
20 | |
21 static std::wstring IndexedURLTitle(int i) { | |
22 return StringPrintf(L"URL Title %d", i); | |
23 } | |
24 | |
25 static std::wstring IndexedFolderName(int i) { | |
26 return StringPrintf(L"Folder Name %d", i); | |
27 } | |
28 | |
29 static std::wstring IndexedSubfolderName(int i) { | |
30 return StringPrintf(L"Subfolder Name %d", i); | |
31 } | |
32 | |
33 static std::wstring IndexedSubsubfolderName(int i) { | |
34 return StringPrintf(L"Subsubfolder Name %d", i); | |
35 } | |
36 | |
37 const std::vector<unsigned char> GenericFavicon() { | 16 const std::vector<unsigned char> GenericFavicon() { |
38 return LiveBookmarksSyncTest::CreateFavicon(254); | 17 return LiveBookmarksSyncTest::CreateFavicon(254); |
39 } | 18 } |
40 | 19 |
41 const std::vector<unsigned char> IndexedFavicon(int i) { | |
42 return LiveBookmarksSyncTest::CreateFavicon(i); | |
43 } | |
44 | |
45 // http://crbug.com/81256 | 20 // http://crbug.com/81256 |
46 IN_PROC_BROWSER_TEST_F(TwoClientLiveBookmarksSyncTest, FLAKY_Sanity) { | 21 IN_PROC_BROWSER_TEST_F(TwoClientLiveBookmarksSyncTest, FLAKY_Sanity) { |
47 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; | 22 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; |
48 ASSERT_TRUE(AllModelsMatchVerifier()); | 23 ASSERT_TRUE(AllModelsMatchVerifier()); |
49 | 24 |
50 GURL google_url("http://www.google.com"); | 25 GURL google_url("http://www.google.com"); |
51 ASSERT_TRUE(AddURL(0, L"Google", google_url) != NULL); | 26 ASSERT_TRUE(AddURL(0, L"Google", google_url) != NULL); |
52 ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1))); | 27 ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1))); |
53 ASSERT_TRUE(AddURL(1, L"Yahoo", GURL("http://www.yahoo.com")) != NULL); | 28 ASSERT_TRUE(AddURL(1, L"Yahoo", GURL("http://www.yahoo.com")) != NULL); |
54 ASSERT_TRUE(GetClient(1)->AwaitMutualSyncCycleCompletion(GetClient(0))); | 29 ASSERT_TRUE(GetClient(1)->AwaitMutualSyncCycleCompletion(GetClient(0))); |
(...skipping 1606 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1661 ASSERT_TRUE(AllModelsMatch()); | 1636 ASSERT_TRUE(AllModelsMatch()); |
1662 ASSERT_FALSE(ContainsDuplicateBookmarks(0)); | 1637 ASSERT_FALSE(ContainsDuplicateBookmarks(0)); |
1663 | 1638 |
1664 // Simultaneously rename folder C on both clients. | 1639 // Simultaneously rename folder C on both clients. |
1665 SetTitle(0, folderC[0], L"Folder C++"); | 1640 SetTitle(0, folderC[0], L"Folder C++"); |
1666 SetTitle(1, folderC[1], L"Folder C--"); | 1641 SetTitle(1, folderC[1], L"Folder C--"); |
1667 ASSERT_TRUE(AwaitQuiescence()); | 1642 ASSERT_TRUE(AwaitQuiescence()); |
1668 ASSERT_TRUE(AllModelsMatch()); | 1643 ASSERT_TRUE(AllModelsMatch()); |
1669 ASSERT_FALSE(ContainsDuplicateBookmarks(0)); | 1644 ASSERT_FALSE(ContainsDuplicateBookmarks(0)); |
1670 } | 1645 } |
OLD | NEW |