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 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
361 | 361 |
362 private: | 362 private: |
363 DISALLOW_COPY_AND_ASSIGN(MockExtensionEventRouter); | 363 DISALLOW_COPY_AND_ASSIGN(MockExtensionEventRouter); |
364 }; | 364 }; |
365 | 365 |
366 // A mock profile for tests of ExtensionMenuManager::ExecuteCommand. | 366 // A mock profile for tests of ExtensionMenuManager::ExecuteCommand. |
367 class MockTestingProfile : public TestingProfile { | 367 class MockTestingProfile : public TestingProfile { |
368 public: | 368 public: |
369 MockTestingProfile() {} | 369 MockTestingProfile() {} |
370 MOCK_METHOD0(GetExtensionEventRouter, ExtensionEventRouter*()); | 370 MOCK_METHOD0(GetExtensionEventRouter, ExtensionEventRouter*()); |
371 MOCK_METHOD0(IsOffTheRecord, bool()); | 371 MOCK_CONST_METHOD0(IsOffTheRecord, bool()); |
372 | 372 |
373 private: | 373 private: |
374 DISALLOW_COPY_AND_ASSIGN(MockTestingProfile); | 374 DISALLOW_COPY_AND_ASSIGN(MockTestingProfile); |
375 }; | 375 }; |
376 | 376 |
377 // Tests the RemoveAll functionality. | 377 // Tests the RemoveAll functionality. |
378 TEST_F(ExtensionMenuManagerTest, RemoveAll) { | 378 TEST_F(ExtensionMenuManagerTest, RemoveAll) { |
379 // Try removing all items for an extension id that doesn't have any items. | 379 // Try removing all items for an extension id that doesn't have any items. |
380 manager_.RemoveAllContextItems("CCCC"); | 380 manager_.RemoveAllContextItems("CCCC"); |
381 | 381 |
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
578 ASSERT_TRUE(new_item->checked()); | 578 ASSERT_TRUE(new_item->checked()); |
579 ASSERT_TRUE(child1->checked()); | 579 ASSERT_TRUE(child1->checked()); |
580 | 580 |
581 // Removing |parent| should cause only |child1| to be selected. | 581 // Removing |parent| should cause only |child1| to be selected. |
582 manager_.RemoveContextMenuItem(parent->id()); | 582 manager_.RemoveContextMenuItem(parent->id()); |
583 parent = NULL; | 583 parent = NULL; |
584 ASSERT_FALSE(new_item->checked()); | 584 ASSERT_FALSE(new_item->checked()); |
585 ASSERT_TRUE(child1->checked()); | 585 ASSERT_TRUE(child1->checked()); |
586 } | 586 } |
587 | 587 |
OLD | NEW |