Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(110)

Side by Side Diff: chrome/browser/extensions/extension_menu_manager_unittest.cc

Issue 9564001: Clean up password manager code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add a unit test for sub-frame navigation Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698