Lines Matching defs:shim
109 PartnerBookmarksShim* shim = partner_bookmarks_shim();
110 ASSERT_FALSE(shim->IsLoaded());
111 shim->SetPartnerBookmarksRoot(root_partner_node);
112 ASSERT_TRUE(shim->IsLoaded());
114 ASSERT_TRUE(shim->IsPartnerBookmark(root_partner_node));
115 ASSERT_EQ(shim->GetNodeByID(0), root_partner_node);
116 ASSERT_EQ(shim->GetNodeByID(1), partner_folder1);
117 ASSERT_EQ(shim->GetNodeByID(4), partner_bookmark2);
122 PartnerBookmarksShim* shim = partner_bookmarks_shim();
123 shim->AddObserver(&observer_);
125 EXPECT_CALL(observer_, PartnerShimLoaded(shim)).Times(1);
126 shim->SetPartnerBookmarksRoot(NULL);
138 PartnerBookmarksShim* shim = partner_bookmarks_shim();
139 shim->AddObserver(&observer_);
141 EXPECT_CALL(observer_, PartnerShimLoaded(shim)).Times(1);
142 shim->SetPartnerBookmarksRoot(root_partner_node);
146 PartnerBookmarksShim* shim = partner_bookmarks_shim();
147 shim->AddObserver(&observer_);
149 EXPECT_CALL(observer_, PartnerShimLoaded(shim)).Times(0);
150 EXPECT_CALL(observer_, PartnerShimChanged(shim)).Times(0);
182 ASSERT_FALSE(shim->IsLoaded());
183 EXPECT_CALL(observer_, PartnerShimLoaded(shim)).Times(1);
184 shim->SetPartnerBookmarksRoot(root_partner_node);
185 ASSERT_TRUE(shim->IsLoaded());
187 EXPECT_EQ(root_partner_node, shim->GetNodeByID(0));
188 EXPECT_EQ(partner_folder1, shim->GetNodeByID(1));
189 EXPECT_EQ(partner_folder2, shim->GetNodeByID(2));
190 EXPECT_EQ(partner_bookmark1, shim->GetNodeByID(3));
191 EXPECT_EQ(partner_bookmark2, shim->GetNodeByID(4));
192 EXPECT_EQ(partner_folder3, shim->GetNodeByID(5));
193 EXPECT_EQ(partner_bookmark3, shim->GetNodeByID(6));
195 EXPECT_TRUE(shim->IsReachable(root_partner_node));
196 EXPECT_TRUE(shim->IsReachable(partner_folder1));
197 EXPECT_TRUE(shim->IsReachable(partner_folder2));
198 EXPECT_TRUE(shim->IsReachable(partner_bookmark1));
199 EXPECT_TRUE(shim->IsReachable(partner_bookmark2));
200 EXPECT_TRUE(shim->IsReachable(partner_folder3));
201 EXPECT_TRUE(shim->IsReachable(partner_bookmark3));
203 EXPECT_CALL(observer_, PartnerShimChanged(shim)).Times(1);
204 shim->RemoveBookmark(partner_bookmark2);
205 EXPECT_TRUE(shim->IsReachable(root_partner_node));
206 EXPECT_TRUE(shim->IsReachable(partner_folder1));
207 EXPECT_TRUE(shim->IsReachable(partner_folder2));
208 EXPECT_TRUE(shim->IsReachable(partner_bookmark1));
209 EXPECT_FALSE(shim->IsReachable(partner_bookmark2));
210 EXPECT_TRUE(shim->IsReachable(partner_folder3));
211 EXPECT_TRUE(shim->IsReachable(partner_bookmark3));
213 EXPECT_CALL(observer_, PartnerShimChanged(shim)).Times(1);
214 shim->RemoveBookmark(partner_folder1);
215 EXPECT_TRUE(shim->IsReachable(root_partner_node));
216 EXPECT_FALSE(shim->IsReachable(partner_folder1));
217 EXPECT_TRUE(shim->IsReachable(partner_folder2));
218 EXPECT_FALSE(shim->IsReachable(partner_bookmark1));
219 EXPECT_FALSE(shim->IsReachable(partner_bookmark2));
220 EXPECT_TRUE(shim->IsReachable(partner_folder3));
221 EXPECT_TRUE(shim->IsReachable(partner_bookmark3));
223 EXPECT_CALL(observer_, PartnerShimChanged(shim)).Times(1);
224 shim->RemoveBookmark(root_partner_node);
225 EXPECT_FALSE(shim->IsReachable(root_partner_node));
226 EXPECT_FALSE(shim->IsReachable(partner_folder1));
227 EXPECT_FALSE(shim->IsReachable(partner_folder2));
228 EXPECT_FALSE(shim->IsReachable(partner_bookmark1));
229 EXPECT_FALSE(shim->IsReachable(partner_bookmark2));
230 EXPECT_FALSE(shim->IsReachable(partner_folder3));
231 EXPECT_FALSE(shim->IsReachable(partner_bookmark3));
235 PartnerBookmarksShim* shim = partner_bookmarks_shim();
236 shim->AddObserver(&observer_);
238 EXPECT_CALL(observer_, PartnerShimLoaded(shim)).Times(0);
239 EXPECT_CALL(observer_, PartnerShimChanged(shim)).Times(0);
266 ASSERT_FALSE(shim->IsLoaded());
267 EXPECT_CALL(observer_, PartnerShimLoaded(shim)).Times(1);
268 shim->SetPartnerBookmarksRoot(root_partner_node);
269 ASSERT_TRUE(shim->IsLoaded());
271 EXPECT_EQ(root_partner_node, shim->GetNodeByID(0));
272 EXPECT_EQ(partner_folder1, shim->GetNodeByID(1));
273 EXPECT_EQ(partner_folder2, shim->GetNodeByID(2));
274 EXPECT_EQ(partner_bookmark1, shim->GetNodeByID(3));
275 EXPECT_EQ(partner_bookmark2, shim->GetNodeByID(4));
277 EXPECT_TRUE(shim->IsReachable(root_partner_node));
278 EXPECT_TRUE(shim->IsReachable(partner_folder1));
279 EXPECT_TRUE(shim->IsReachable(partner_folder2));
280 EXPECT_TRUE(shim->IsReachable(partner_bookmark1));
281 EXPECT_TRUE(shim->IsReachable(partner_bookmark2));
283 EXPECT_CALL(observer_, PartnerShimChanged(shim)).Times(1);
284 EXPECT_EQ(base::ASCIIToUTF16("b.com"), shim->GetTitle(partner_bookmark2));
285 shim->RenameBookmark(partner_bookmark2, base::ASCIIToUTF16("b2.com"));
286 EXPECT_EQ(base::ASCIIToUTF16("b2.com"), shim->GetTitle(partner_bookmark2));
288 EXPECT_TRUE(shim->IsReachable(root_partner_node));
289 EXPECT_TRUE(shim->IsReachable(partner_folder1));
290 EXPECT_TRUE(shim->IsReachable(partner_folder2));
291 EXPECT_TRUE(shim->IsReachable(partner_bookmark1));
292 EXPECT_TRUE(shim->IsReachable(partner_bookmark2));
294 EXPECT_CALL(observer_, PartnerShimChanged(shim)).Times(1);
295 EXPECT_EQ(base::ASCIIToUTF16("a.net"), shim->GetTitle(partner_folder1));
296 shim->RenameBookmark(partner_folder1, base::ASCIIToUTF16("a2.net"));
297 EXPECT_EQ(base::ASCIIToUTF16("a2.net"), shim->GetTitle(partner_folder1));
299 EXPECT_TRUE(shim->IsReachable(root_partner_node));
300 EXPECT_TRUE(shim->IsReachable(partner_folder1));
301 EXPECT_TRUE(shim->IsReachable(partner_folder2));
302 EXPECT_TRUE(shim->IsReachable(partner_bookmark1));
303 EXPECT_TRUE(shim->IsReachable(partner_bookmark2));
305 EXPECT_CALL(observer_, PartnerShimChanged(shim)).Times(1);
307 shim->GetTitle(root_partner_node));
308 shim->RenameBookmark(root_partner_node, base::ASCIIToUTF16("Partner"));
309 EXPECT_EQ(base::ASCIIToUTF16("Partner"), shim->GetTitle(root_partner_node));
311 EXPECT_TRUE(shim->IsReachable(root_partner_node));
312 EXPECT_TRUE(shim->IsReachable(partner_folder1));
313 EXPECT_TRUE(shim->IsReachable(partner_folder2));
314 EXPECT_TRUE(shim->IsReachable(partner_bookmark1));
315 EXPECT_TRUE(shim->IsReachable(partner_bookmark2));
320 PartnerBookmarksShim* shim = partner_bookmarks_shim();
321 shim->AddObserver(&observer_);
323 EXPECT_CALL(observer_, PartnerShimLoaded(shim)).Times(0);
324 EXPECT_CALL(observer_, PartnerShimChanged(shim)).Times(0);
346 ASSERT_FALSE(shim->IsLoaded());
347 EXPECT_CALL(observer_, PartnerShimLoaded(shim)).Times(1);
348 shim->SetPartnerBookmarksRoot(root_partner_node);
349 ASSERT_TRUE(shim->IsLoaded());
351 EXPECT_CALL(observer_, PartnerShimChanged(shim)).Times(2);
352 shim->RenameBookmark(partner_bookmark1, base::ASCIIToUTF16("a2.com"));
353 shim->RemoveBookmark(partner_bookmark2);
354 EXPECT_EQ(base::ASCIIToUTF16("a2.com"), shim->GetTitle(partner_bookmark1));
355 EXPECT_FALSE(shim->IsReachable(partner_bookmark2));
361 PartnerBookmarksShim* shim = partner_bookmarks_shim();
362 shim->AddObserver(&observer_);
364 EXPECT_CALL(observer_, PartnerShimLoaded(shim)).Times(0);
365 EXPECT_CALL(observer_, PartnerShimChanged(shim)).Times(0);
366 ASSERT_TRUE(shim->IsLoaded());
368 const BookmarkNode* partner_bookmark1 = shim->GetNodeByID(3);
369 const BookmarkNode* partner_bookmark2 = shim->GetNodeByID(5);
371 EXPECT_EQ(base::ASCIIToUTF16("a2.com"), shim->GetTitle(partner_bookmark1));
372 EXPECT_FALSE(shim->IsReachable(partner_bookmark2));
377 PartnerBookmarksShim* shim = partner_bookmarks_shim();
378 shim->AddObserver(&observer_);
380 EXPECT_CALL(observer_, PartnerShimLoaded(shim)).Times(0);
381 EXPECT_CALL(observer_, PartnerShimChanged(shim)).Times(0);
396 ASSERT_FALSE(shim->IsLoaded());
397 EXPECT_CALL(observer_, PartnerShimLoaded(shim)).Times(1);
398 shim->SetPartnerBookmarksRoot(root_partner_node);
399 ASSERT_TRUE(shim->IsLoaded());
402 EXPECT_CALL(observer_, PartnerShimChanged(shim)).Times(2);
403 shim->RenameBookmark(partner_bookmark1, base::ASCIIToUTF16("a2.com"));
404 shim->RemoveBookmark(partner_bookmark2);
405 EXPECT_EQ(base::ASCIIToUTF16("a2.com"), shim->GetTitle(partner_bookmark1));
406 EXPECT_FALSE(shim->IsReachable(partner_bookmark2));
410 EXPECT_EQ(base::ASCIIToUTF16("a"), shim->GetTitle(partner_bookmark1));
411 EXPECT_TRUE(shim->IsReachable(partner_bookmark2));