| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <vector> | 5 #include <vector> |
| 6 | 6 |
| 7 #include "base/files/scoped_temp_dir.h" | 7 #include "base/files/scoped_temp_dir.h" |
| 8 #include "base/json/json_reader.h" | 8 #include "base/json/json_reader.h" |
| 9 #include "base/memory/scoped_vector.h" | 9 #include "base/memory/scoped_vector.h" |
| 10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
| (...skipping 585 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 596 &profile, | 596 &profile, |
| 597 GURL(), | 597 GURL(), |
| 598 EventRouter::USER_GESTURE_ENABLED)) | 598 EventRouter::USER_GESTURE_ENABLED)) |
| 599 .Times(1) | 599 .Times(1) |
| 600 .WillOnce(DeleteArg<2>()); | 600 .WillOnce(DeleteArg<2>()); |
| 601 } | 601 } |
| 602 manager_.ExecuteCommand(&profile, NULL /* web_contents */, params, id); | 602 manager_.ExecuteCommand(&profile, NULL /* web_contents */, params, id); |
| 603 | 603 |
| 604 ASSERT_EQ(2u, list->GetSize()); | 604 ASSERT_EQ(2u, list->GetSize()); |
| 605 | 605 |
| 606 DictionaryValue* info; | 606 base::DictionaryValue* info; |
| 607 ASSERT_TRUE(list->GetDictionary(0, &info)); | 607 ASSERT_TRUE(list->GetDictionary(0, &info)); |
| 608 | 608 |
| 609 int tmp_id = 0; | 609 int tmp_id = 0; |
| 610 ASSERT_TRUE(info->GetInteger("menuItemId", &tmp_id)); | 610 ASSERT_TRUE(info->GetInteger("menuItemId", &tmp_id)); |
| 611 ASSERT_EQ(id.uid, tmp_id); | 611 ASSERT_EQ(id.uid, tmp_id); |
| 612 ASSERT_TRUE(info->GetInteger("parentMenuItemId", &tmp_id)); | 612 ASSERT_TRUE(info->GetInteger("parentMenuItemId", &tmp_id)); |
| 613 ASSERT_EQ(parent_id.uid, tmp_id); | 613 ASSERT_EQ(parent_id.uid, tmp_id); |
| 614 | 614 |
| 615 std::string tmp; | 615 std::string tmp; |
| 616 ASSERT_TRUE(info->GetString("mediaType", &tmp)); | 616 ASSERT_TRUE(info->GetString("mediaType", &tmp)); |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 751 EXPECT_EQ(4u, manager_.MenuItems(extension1->id())->size()); | 751 EXPECT_EQ(4u, manager_.MenuItems(extension1->id())->size()); |
| 752 EXPECT_EQ(1u, manager_.MenuItems(extension2->id())->size()); | 752 EXPECT_EQ(1u, manager_.MenuItems(extension2->id())->size()); |
| 753 | 753 |
| 754 // Remove all context menu items with incognito true. | 754 // Remove all context menu items with incognito true. |
| 755 manager_.RemoveAllIncognitoContextItems(); | 755 manager_.RemoveAllIncognitoContextItems(); |
| 756 EXPECT_EQ(2u, manager_.MenuItems(extension1->id())->size()); | 756 EXPECT_EQ(2u, manager_.MenuItems(extension1->id())->size()); |
| 757 EXPECT_EQ(1u, manager_.MenuItems(extension2->id())->size()); | 757 EXPECT_EQ(1u, manager_.MenuItems(extension2->id())->size()); |
| 758 } | 758 } |
| 759 | 759 |
| 760 } // namespace extensions | 760 } // namespace extensions |
| OLD | NEW |