| OLD | NEW |
| 1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 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 #ifdef CHROME_PERSONALIZATION | 5 #ifdef CHROME_PERSONALIZATION |
| 6 | 6 |
| 7 #include <stdlib.h> | 7 #include <stdlib.h> |
| 8 | 8 |
| 9 #include "base/string16.h" | 9 #include "base/string16.h" |
| 10 #include "base/rand_util.h" | 10 #include "base/rand_util.h" |
| (...skipping 936 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 947 verifier->ExpectMatch(model_one); | 947 verifier->ExpectMatch(model_one); |
| 948 verifier->ExpectMatch(model_two); | 948 verifier->ExpectMatch(model_two); |
| 949 // Let's add first bookmark folder to client1 | 949 // Let's add first bookmark folder to client1 |
| 950 const BookmarkNode* bm_folder_one = | 950 const BookmarkNode* bm_folder_one = |
| 951 verifier->AddGroup(model_one, bbn_one, 0, L"TestFolder"); | 951 verifier->AddGroup(model_one, bbn_one, 0, L"TestFolder"); |
| 952 // Let's add some bookmarks(without favicon) | 952 // Let's add some bookmarks(without favicon) |
| 953 for (int index = 1; index < 15; index++) { | 953 for (int index = 1; index < 15; index++) { |
| 954 int random_int = base::RandInt(1, 100); | 954 int random_int = base::RandInt(1, 100); |
| 955 // To create randomness in order, 40% of time add bookmarks | 955 // To create randomness in order, 40% of time add bookmarks |
| 956 if (random_int > 60) { | 956 if (random_int > 60) { |
| 957 string16 title(L"BB - TestBookmark"); | 957 string16 title(L"BB - TestBookmark"); |
| 958 string16 url(L"http://www.nofaviconurl"); | 958 string16 url(L"http://www.nofaviconurl"); |
| 959 string16 index_str = IntToString16(index); | 959 string16 index_str = IntToString16(index); |
| 960 title.append(index_str); | 960 title.append(index_str); |
| 961 url.append(index_str); | 961 url.append(index_str); |
| 962 url.append(L".com"); | 962 url.append(L".com"); |
| 963 const BookmarkNode* nofavicon_bm = verifier->AddURL(model_one, bbn_one, | 963 const BookmarkNode* nofavicon_bm = verifier->AddURL(model_one, bbn_one, |
| 964 index, title, GURL(url)); | 964 index, title, GURL(url)); |
| 965 } else { | 965 } else { |
| 966 // Remaining % of time - Add Bookmark folders | 966 // Remaining % of time - Add Bookmark folders |
| 967 string16 title(L"BB - TestBMFolder"); | 967 string16 title(L"BB - TestBMFolder"); |
| 968 string16 index_str = IntToString16(index); | 968 string16 index_str = IntToString16(index); |
| 969 title.append(index_str); | 969 title.append(index_str); |
| 970 const BookmarkNode* bm_folder = verifier->AddGroup(model_one, bbn_one, | 970 const BookmarkNode* bm_folder = verifier->AddGroup(model_one, bbn_one, |
| 971 index, title); | 971 index, title); |
| 972 } | 972 } |
| 973 } | 973 } |
| 974 ASSERT_TRUE(client1()->AwaitMutualSyncCycleCompletion(client2())); | 974 ASSERT_TRUE(client1()->AwaitMutualSyncCycleCompletion(client2())); |
| 975 verifier->ExpectMatch(model_one); | 975 verifier->ExpectMatch(model_one); |
| 976 verifier->ExpectMatch(model_two); | 976 verifier->ExpectMatch(model_two); |
| 977 | 977 |
| 978 // Let's delete the first empty bookmark folder | 978 // Let's delete the first empty bookmark folder |
| 979 verifier->Remove(model_one, bbn_one, 0); | 979 verifier->Remove(model_one, bbn_one, 0); |
| 980 | 980 |
| 981 ASSERT_TRUE(client1()->AwaitMutualSyncCycleCompletion(client2())); | 981 ASSERT_TRUE(client1()->AwaitMutualSyncCycleCompletion(client2())); |
| (...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1241 verifier->Move(model_one, bm_folder_one->GetChild(0), | 1241 verifier->Move(model_one, bm_folder_one->GetChild(0), |
| 1242 bbn_one, bbn_one->GetChildCount()); | 1242 bbn_one, bbn_one->GetChildCount()); |
| 1243 ASSERT_TRUE(client1()->AwaitMutualSyncCycleCompletion(client2())); | 1243 ASSERT_TRUE(client1()->AwaitMutualSyncCycleCompletion(client2())); |
| 1244 verifier->ExpectMatch(model_one); | 1244 verifier->ExpectMatch(model_one); |
| 1245 verifier->ExpectMatch(model_two); | 1245 verifier->ExpectMatch(model_two); |
| 1246 } | 1246 } |
| 1247 Cleanup(); | 1247 Cleanup(); |
| 1248 } | 1248 } |
| 1249 | 1249 |
| 1250 #endif // CHROME_PERSONALIZATION | 1250 #endif // CHROME_PERSONALIZATION |
| OLD | NEW |