| 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 470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 481 private: | 481 private: |
| 482 DISALLOW_COPY_AND_ASSIGN(MockEventRouter); | 482 DISALLOW_COPY_AND_ASSIGN(MockEventRouter); |
| 483 }; | 483 }; |
| 484 | 484 |
| 485 // A mock ExtensionSystem to serve our MockEventRouter. | 485 // A mock ExtensionSystem to serve our MockEventRouter. |
| 486 class MockExtensionSystem : public TestExtensionSystem { | 486 class MockExtensionSystem : public TestExtensionSystem { |
| 487 public: | 487 public: |
| 488 explicit MockExtensionSystem(Profile* profile) | 488 explicit MockExtensionSystem(Profile* profile) |
| 489 : TestExtensionSystem(profile) {} | 489 : TestExtensionSystem(profile) {} |
| 490 | 490 |
| 491 virtual EventRouter* event_router() override { | 491 EventRouter* event_router() override { |
| 492 if (!mock_event_router_) | 492 if (!mock_event_router_) |
| 493 mock_event_router_.reset(new MockEventRouter(profile_)); | 493 mock_event_router_.reset(new MockEventRouter(profile_)); |
| 494 return mock_event_router_.get(); | 494 return mock_event_router_.get(); |
| 495 } | 495 } |
| 496 | 496 |
| 497 private: | 497 private: |
| 498 scoped_ptr<MockEventRouter> mock_event_router_; | 498 scoped_ptr<MockEventRouter> mock_event_router_; |
| 499 | 499 |
| 500 DISALLOW_COPY_AND_ASSIGN(MockExtensionSystem); | 500 DISALLOW_COPY_AND_ASSIGN(MockExtensionSystem); |
| 501 }; | 501 }; |
| (...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 763 EXPECT_EQ(4u, manager_.MenuItems(key1)->size()); | 763 EXPECT_EQ(4u, manager_.MenuItems(key1)->size()); |
| 764 EXPECT_EQ(1u, manager_.MenuItems(key2)->size()); | 764 EXPECT_EQ(1u, manager_.MenuItems(key2)->size()); |
| 765 | 765 |
| 766 // Remove all context menu items with incognito true. | 766 // Remove all context menu items with incognito true. |
| 767 manager_.RemoveAllIncognitoContextItems(); | 767 manager_.RemoveAllIncognitoContextItems(); |
| 768 EXPECT_EQ(2u, manager_.MenuItems(key1)->size()); | 768 EXPECT_EQ(2u, manager_.MenuItems(key1)->size()); |
| 769 EXPECT_EQ(1u, manager_.MenuItems(key2)->size()); | 769 EXPECT_EQ(1u, manager_.MenuItems(key2)->size()); |
| 770 } | 770 } |
| 771 | 771 |
| 772 } // namespace extensions | 772 } // namespace extensions |
| OLD | NEW |