Lines Matching refs:item1
112 MenuItem* item1 = CreateTestItem(extension);
113 ASSERT_TRUE(item1 != NULL);
114 ASSERT_TRUE(manager_.AddContextItem(extension, item1));
115 ASSERT_EQ(item1, manager_.GetItemById(item1->id()));
116 const MenuItem::List* items = manager_.MenuItems(item1->id().extension_key);
118 ASSERT_EQ(item1, items->at(0));
126 ASSERT_EQ(item1, items->at(0));
162 MenuItem* item1 = CreateTestItem(extension1);
172 ASSERT_TRUE(manager_.AddContextItem(extension1, item1));
175 MenuItem::Id id1 = item1->id();
186 ASSERT_EQ(0, item1->child_count());
189 ASSERT_EQ(1u, manager_.MenuItems(item1->id().extension_key)->size());
190 ASSERT_EQ(item1, manager_.MenuItems(item1->id().extension_key)->at(0));
280 MenuItem* item1 = CreateTestItem(extension);
286 MenuItem::Id item1_id = item1->id();
295 // item1 -> item2 -> item3 -> item4 -> item5 -> item6.
296 ASSERT_TRUE(manager_.AddContextItem(extension, item1));
302 ASSERT_EQ(item1, manager_.GetItemById(item1_id));
313 ASSERT_EQ(item1, manager_.GetItemById(item1_id));
324 ASSERT_EQ(item1, manager_.GetItemById(item1_id));
332 // Now remove item1 and make sure item2 and item3 are gone as well.
346 MenuItem* item1 = CreateTestItem(extension1);
349 ASSERT_TRUE(manager_.AddContextItem(extension1, item1));
352 const MenuItem::List* items = manager_.MenuItems(item1->id().extension_key);
354 ASSERT_EQ(item1, items->at(0));
357 // Now create a third item, initially add it as a child of item1, then move
361 ASSERT_TRUE(manager_.AddChildItem(item1->id(), item3));
362 ASSERT_EQ(1, item1->child_count());
363 ASSERT_EQ(item3, item1->children()[0]);
366 ASSERT_EQ(0, item1->child_count());
370 // Move item2 to be a child of item1.
371 ASSERT_TRUE(manager_.ChangeParent(item2->id(), &item1->id()));
372 ASSERT_EQ(1, item1->child_count());
373 ASSERT_EQ(item2, item1->children()[0]);
379 items = manager_.MenuItems(item1->id().extension_key);
381 ASSERT_EQ(item1, items->at(0));
383 // Move item3 back to being a child of item1, so it's now a sibling of item2.
384 ASSERT_TRUE(manager_.ChangeParent(item3->id(), &item1->id()));
385 ASSERT_EQ(2, item1->child_count());
386 ASSERT_EQ(item2, item1->children()[0]);
387 ASSERT_EQ(item3, item1->children()[1]);
389 // Try switching item3 to be the parent of item1 - this should fail.
390 ASSERT_FALSE(manager_.ChangeParent(item1->id(), &item3->id()));
392 ASSERT_EQ(2, item1->child_count());
393 ASSERT_EQ(item2, item1->children()[0]);
394 ASSERT_EQ(item3, item1->children()[1]);
395 items = manager_.MenuItems(item1->id().extension_key);
397 ASSERT_EQ(item1, items->at(0));
401 items = manager_.MenuItems(item1->id().extension_key);
403 ASSERT_EQ(item1, items->at(0));
405 ASSERT_EQ(1, item1->child_count());
406 ASSERT_EQ(item3, item1->children()[0]);
412 ASSERT_FALSE(manager_.ChangeParent(item4->id(), &item1->id()));
413 ASSERT_FALSE(manager_.ChangeParent(item1
416 ASSERT_FALSE(manager_.ChangeParent(item1->id(), &item1->id()));
430 MenuItem* item1 = CreateTestItem(extension1);
431 MenuItem::Id id1 = item1->id();
432 ASSERT_EQ(extension1->id(), item1->extension_id());
433 ASSERT_TRUE(manager_.AddContextItem(extension1, item1));
440 ASSERT_NE(item1->extension_id(), item2->extension_id());
516 MenuItem* item1 = CreateTestItem(extension1);
519 ASSERT_TRUE(manager_.AddContextItem(extension1, item1));
521 ASSERT_TRUE(manager_.AddChildItem(item1->id(), item3));
547 MenuItem* item1 = CreateTestItem(extension1);
550 ASSERT_TRUE(manager_.AddContextItem(extension1, item1));
557 manager_.RemoveContextMenuItem(item1->id());
649 MenuItem* item1 = CreateTestItem(extension);
651 item1->set_type(MenuItem::RADIO);
652 item1->SetChecked(false);
653 ASSERT_FALSE(item1->checked());
654 manager_.AddContextItem(extension, item1);
655 ASSERT_TRUE(item1->checked());
658 item1->SetChecked(false);
662 ASSERT_FALSE(item1->checked());
665 ASSERT_TRUE(item1->checked());
669 item1->SetChecked(true);
671 ASSERT_TRUE(item1->checked());
673 manager_.ItemUpdated(item1->id());
674 ASSERT_FALSE(item1->checked());
678 item1->SetChecked(false);
680 ASSERT_FALSE(item1->checked());
684 ASSERT_TRUE(item1->checked());
688 item1->SetChecked(true);
692 ASSERT_TRUE(item1->checked());
695 ASSERT_FALSE(item1->checked());
740 MenuItem* item1 = CreateTestItem(extension1, true);
743 ASSERT_TRUE(manager_.AddContextItem(extension1, item1));
745 ASSERT_TRUE(manager_.AddChildItem(item1->id(), item3));