| 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 540 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 551 TEST_F(MenuManagerTest, ExecuteCommand) { | 551 TEST_F(MenuManagerTest, ExecuteCommand) { |
| 552 TestingProfile profile; | 552 TestingProfile profile; |
| 553 | 553 |
| 554 MockExtensionSystem* mock_extension_system = | 554 MockExtensionSystem* mock_extension_system = |
| 555 static_cast<MockExtensionSystem*>(ExtensionSystemFactory::GetInstance()-> | 555 static_cast<MockExtensionSystem*>(ExtensionSystemFactory::GetInstance()-> |
| 556 SetTestingFactoryAndUse(&profile, &BuildMockExtensionSystem)); | 556 SetTestingFactoryAndUse(&profile, &BuildMockExtensionSystem)); |
| 557 MockEventRouter* mock_event_router = | 557 MockEventRouter* mock_event_router = |
| 558 static_cast<MockEventRouter*>(mock_extension_system->event_router()); | 558 static_cast<MockEventRouter*>(mock_extension_system->event_router()); |
| 559 | 559 |
| 560 content::ContextMenuParams params; | 560 content::ContextMenuParams params; |
| 561 params.media_type = WebKit::WebContextMenuData::MediaTypeImage; | 561 params.media_type = blink::WebContextMenuData::MediaTypeImage; |
| 562 params.src_url = GURL("http://foo.bar/image.png"); | 562 params.src_url = GURL("http://foo.bar/image.png"); |
| 563 params.page_url = GURL("http://foo.bar"); | 563 params.page_url = GURL("http://foo.bar"); |
| 564 params.selection_text = ASCIIToUTF16("Hello World"); | 564 params.selection_text = ASCIIToUTF16("Hello World"); |
| 565 params.is_editable = false; | 565 params.is_editable = false; |
| 566 | 566 |
| 567 Extension* extension = AddExtension("test"); | 567 Extension* extension = AddExtension("test"); |
| 568 MenuItem* parent = CreateTestItem(extension); | 568 MenuItem* parent = CreateTestItem(extension); |
| 569 MenuItem* item = CreateTestItem(extension); | 569 MenuItem* item = CreateTestItem(extension); |
| 570 MenuItem::Id parent_id = parent->id(); | 570 MenuItem::Id parent_id = parent->id(); |
| 571 MenuItem::Id id = item->id(); | 571 MenuItem::Id id = item->id(); |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 750 EXPECT_EQ(4u, manager_.MenuItems(extension1->id())->size()); | 750 EXPECT_EQ(4u, manager_.MenuItems(extension1->id())->size()); |
| 751 EXPECT_EQ(1u, manager_.MenuItems(extension2->id())->size()); | 751 EXPECT_EQ(1u, manager_.MenuItems(extension2->id())->size()); |
| 752 | 752 |
| 753 // Remove all context menu items with incognito true. | 753 // Remove all context menu items with incognito true. |
| 754 manager_.RemoveAllIncognitoContextItems(); | 754 manager_.RemoveAllIncognitoContextItems(); |
| 755 EXPECT_EQ(2u, manager_.MenuItems(extension1->id())->size()); | 755 EXPECT_EQ(2u, manager_.MenuItems(extension1->id())->size()); |
| 756 EXPECT_EQ(1u, manager_.MenuItems(extension2->id())->size()); | 756 EXPECT_EQ(1u, manager_.MenuItems(extension2->id())->size()); |
| 757 } | 757 } |
| 758 | 758 |
| 759 } // namespace extensions | 759 } // namespace extensions |
| OLD | NEW |