| 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/json/json_reader.h" | 7 #include "base/json/json_reader.h" |
| 8 #include "base/memory/scoped_vector.h" | 8 #include "base/memory/scoped_vector.h" |
| 9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
| 10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
| (...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 432 &details)); | 432 &details)); |
| 433 ASSERT_EQ(NULL, manager_.MenuItems(extension1->id())); | 433 ASSERT_EQ(NULL, manager_.MenuItems(extension1->id())); |
| 434 ASSERT_EQ(1u, manager_.MenuItems(extension2->id())->size()); | 434 ASSERT_EQ(1u, manager_.MenuItems(extension2->id())->size()); |
| 435 ASSERT_TRUE(manager_.GetItemById(id1) == NULL); | 435 ASSERT_TRUE(manager_.GetItemById(id1) == NULL); |
| 436 ASSERT_TRUE(manager_.GetItemById(item2->id()) != NULL); | 436 ASSERT_TRUE(manager_.GetItemById(item2->id()) != NULL); |
| 437 } | 437 } |
| 438 | 438 |
| 439 // A mock message service for tests of MenuManager::ExecuteCommand. | 439 // A mock message service for tests of MenuManager::ExecuteCommand. |
| 440 class MockEventRouter : public EventRouter { | 440 class MockEventRouter : public EventRouter { |
| 441 public: | 441 public: |
| 442 explicit MockEventRouter(Profile* profile) : EventRouter(profile, NULL) {} | 442 explicit MockEventRouter(Profile* profile) : EventRouter(profile) {} |
| 443 | 443 |
| 444 MOCK_METHOD6(DispatchEventToExtensionMock, | 444 MOCK_METHOD6(DispatchEventToExtensionMock, |
| 445 void(const std::string& extension_id, | 445 void(const std::string& extension_id, |
| 446 const std::string& event_name, | 446 const std::string& event_name, |
| 447 base::ListValue* event_args, | 447 base::ListValue* event_args, |
| 448 Profile* source_profile, | 448 Profile* source_profile, |
| 449 const GURL& event_url, | 449 const GURL& event_url, |
| 450 EventRouter::UserGestureState state)); | 450 EventRouter::UserGestureState state)); |
| 451 | 451 |
| 452 virtual void DispatchEventToExtension(const std::string& extension_id, | 452 virtual void DispatchEventToExtension(const std::string& extension_id, |
| (...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 734 EXPECT_EQ(4u, manager_.MenuItems(extension1->id())->size()); | 734 EXPECT_EQ(4u, manager_.MenuItems(extension1->id())->size()); |
| 735 EXPECT_EQ(1u, manager_.MenuItems(extension2->id())->size()); | 735 EXPECT_EQ(1u, manager_.MenuItems(extension2->id())->size()); |
| 736 | 736 |
| 737 // Remove all context menu items with incognito true. | 737 // Remove all context menu items with incognito true. |
| 738 manager_.RemoveAllIncognitoContextItems(); | 738 manager_.RemoveAllIncognitoContextItems(); |
| 739 EXPECT_EQ(2u, manager_.MenuItems(extension1->id())->size()); | 739 EXPECT_EQ(2u, manager_.MenuItems(extension1->id())->size()); |
| 740 EXPECT_EQ(1u, manager_.MenuItems(extension2->id())->size()); | 740 EXPECT_EQ(1u, manager_.MenuItems(extension2->id())->size()); |
| 741 } | 741 } |
| 742 | 742 |
| 743 } // namespace extensions | 743 } // namespace extensions |
| OLD | NEW |