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

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

Issue 1772513002: Add frameId to contextMenus.onClicked / onclick. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
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/macros.h" 9 #include "base/macros.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 572 matching lines...) Expand 10 before | Expand all | Expand 10 after
583 DispatchEventToExtensionMock( 583 DispatchEventToExtensionMock(
584 item->extension_id(), 584 item->extension_id(),
585 context_menus::OnClicked::kEventName, 585 context_menus::OnClicked::kEventName,
586 _, 586 _,
587 &profile, 587 &profile,
588 GURL(), 588 GURL(),
589 EventRouter::USER_GESTURE_ENABLED)) 589 EventRouter::USER_GESTURE_ENABLED))
590 .Times(1) 590 .Times(1)
591 .WillOnce(DeleteArg<2>()); 591 .WillOnce(DeleteArg<2>());
592 } 592 }
593 manager_.ExecuteCommand(&profile, NULL /* web_contents */, params, id); 593 manager_.ExecuteCommand(&profile, nullptr /* web_contents */,
594 nullptr /* render_frame_host */, params, id);
594 595
595 ASSERT_EQ(2u, list->GetSize()); 596 ASSERT_EQ(2u, list->GetSize());
596 597
597 base::DictionaryValue* info; 598 base::DictionaryValue* info;
598 ASSERT_TRUE(list->GetDictionary(0, &info)); 599 ASSERT_TRUE(list->GetDictionary(0, &info));
599 600
600 int tmp_id = 0; 601 int tmp_id = 0;
601 ASSERT_TRUE(info->GetInteger("menuItemId", &tmp_id)); 602 ASSERT_TRUE(info->GetInteger("menuItemId", &tmp_id));
602 ASSERT_EQ(id.uid, tmp_id); 603 ASSERT_EQ(id.uid, tmp_id);
603 ASSERT_TRUE(info->GetInteger("parentMenuItemId", &tmp_id)); 604 ASSERT_TRUE(info->GetInteger("parentMenuItemId", &tmp_id));
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
744 EXPECT_EQ(4u, manager_.MenuItems(key1)->size()); 745 EXPECT_EQ(4u, manager_.MenuItems(key1)->size());
745 EXPECT_EQ(1u, manager_.MenuItems(key2)->size()); 746 EXPECT_EQ(1u, manager_.MenuItems(key2)->size());
746 747
747 // Remove all context menu items with incognito true. 748 // Remove all context menu items with incognito true.
748 manager_.RemoveAllIncognitoContextItems(); 749 manager_.RemoveAllIncognitoContextItems();
749 EXPECT_EQ(2u, manager_.MenuItems(key1)->size()); 750 EXPECT_EQ(2u, manager_.MenuItems(key1)->size());
750 EXPECT_EQ(1u, manager_.MenuItems(key2)->size()); 751 EXPECT_EQ(1u, manager_.MenuItems(key2)->size());
751 } 752 }
752 753
753 } // namespace extensions 754 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698