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

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

Issue 11440004: Remove deprecated extension EventRouter APIs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years 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/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.h" 10 #include "base/message_loop.h"
(...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after
450 450
451 MOCK_METHOD6(DispatchEventToExtensionMock, 451 MOCK_METHOD6(DispatchEventToExtensionMock,
452 void(const std::string& extension_id, 452 void(const std::string& extension_id,
453 const std::string& event_name, 453 const std::string& event_name,
454 base::ListValue* event_args, 454 base::ListValue* event_args,
455 Profile* source_profile, 455 Profile* source_profile,
456 const GURL& event_url, 456 const GURL& event_url,
457 EventRouter::UserGestureState state)); 457 EventRouter::UserGestureState state));
458 458
459 virtual void DispatchEventToExtension(const std::string& extension_id, 459 virtual void DispatchEventToExtension(const std::string& extension_id,
460 const std::string& event_name, 460 scoped_ptr<Event> event) {
461 scoped_ptr<base::ListValue> event_args, 461 DispatchEventToExtensionMock(extension_id,
Yoyo Zhou 2012/12/05 22:28:32 This mock method doesn't make sense anymore; it sh
Matt Perry 2012/12/05 22:53:53 If you look later in the file, it uses gmock to ch
462 Profile* source_profile, 462 event->event_name,
463 const GURL& event_url, 463 event->event_args.release(),
464 EventRouter::UserGestureState state) { 464 event->restrict_to_profile,
465 DispatchEventToExtensionMock(extension_id, event_name, event_args.release(), 465 event->event_url,
466 source_profile, event_url, state); 466 event->user_gesture);
467 } 467 }
468 468
469 private: 469 private:
470 DISALLOW_COPY_AND_ASSIGN(MockEventRouter); 470 DISALLOW_COPY_AND_ASSIGN(MockEventRouter);
471 }; 471 };
472 472
473 // A mock ExtensionSystem to serve our MockEventRouter. 473 // A mock ExtensionSystem to serve our MockEventRouter.
474 class MockExtensionSystem : public TestExtensionSystem { 474 class MockExtensionSystem : public TestExtensionSystem {
475 public: 475 public:
476 explicit MockExtensionSystem(Profile* profile) 476 explicit MockExtensionSystem(Profile* profile)
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after
741 EXPECT_EQ(4u, manager_.MenuItems(extension1->id())->size()); 741 EXPECT_EQ(4u, manager_.MenuItems(extension1->id())->size());
742 EXPECT_EQ(1u, manager_.MenuItems(extension2->id())->size()); 742 EXPECT_EQ(1u, manager_.MenuItems(extension2->id())->size());
743 743
744 // Remove all context menu items with incognito true. 744 // Remove all context menu items with incognito true.
745 manager_.RemoveAllIncognitoContextItems(); 745 manager_.RemoveAllIncognitoContextItems();
746 EXPECT_EQ(2u, manager_.MenuItems(extension1->id())->size()); 746 EXPECT_EQ(2u, manager_.MenuItems(extension1->id())->size());
747 EXPECT_EQ(1u, manager_.MenuItems(extension2->id())->size()); 747 EXPECT_EQ(1u, manager_.MenuItems(extension2->id())->size());
748 } 748 }
749 749
750 } // namespace extensions 750 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698