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

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

Issue 204703002: Rename NOTIFICATION_EXTENSION_UNLOADED to (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: maybe upload wont do something bizarre this time Created 6 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
« no previous file with comments | « chrome/browser/extensions/menu_manager.cc ('k') | chrome/browser/extensions/plugin_manager.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after
435 // Create a menu item with a different extension id and add it to the manager. 435 // Create a menu item with a different extension id and add it to the manager.
436 Extension* extension2 = AddExtension("2222"); 436 Extension* extension2 = AddExtension("2222");
437 MenuItem* item2 = CreateTestItem(extension2); 437 MenuItem* item2 = CreateTestItem(extension2);
438 ASSERT_NE(item1->extension_id(), item2->extension_id()); 438 ASSERT_NE(item1->extension_id(), item2->extension_id());
439 ASSERT_TRUE(manager_.AddContextItem(extension2, item2)); 439 ASSERT_TRUE(manager_.AddContextItem(extension2, item2));
440 440
441 // Notify that the extension was unloaded, and make sure the right item is 441 // Notify that the extension was unloaded, and make sure the right item is
442 // gone. 442 // gone.
443 UnloadedExtensionInfo details( 443 UnloadedExtensionInfo details(
444 extension1, UnloadedExtensionInfo::REASON_DISABLE); 444 extension1, UnloadedExtensionInfo::REASON_DISABLE);
445 notifier->Notify(chrome::NOTIFICATION_EXTENSION_UNLOADED, 445 notifier->Notify(chrome::NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED,
446 content::Source<Profile>(&profile_), 446 content::Source<Profile>(&profile_),
447 content::Details<UnloadedExtensionInfo>( 447 content::Details<UnloadedExtensionInfo>(
448 &details)); 448 &details));
449 ASSERT_EQ(NULL, manager_.MenuItems(MenuItem::ExtensionKey(extension1->id()))); 449 ASSERT_EQ(NULL, manager_.MenuItems(MenuItem::ExtensionKey(extension1->id())));
450 ASSERT_EQ( 450 ASSERT_EQ(
451 1u, manager_.MenuItems(MenuItem::ExtensionKey(extension2->id()))->size()); 451 1u, manager_.MenuItems(MenuItem::ExtensionKey(extension2->id()))->size());
452 ASSERT_TRUE(manager_.GetItemById(id1) == NULL); 452 ASSERT_TRUE(manager_.GetItemById(id1) == NULL);
453 ASSERT_TRUE(manager_.GetItemById(item2->id()) != NULL); 453 ASSERT_TRUE(manager_.GetItemById(item2->id()) != NULL);
454 } 454 }
455 455
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after
760 EXPECT_EQ(4u, manager_.MenuItems(key1)->size()); 760 EXPECT_EQ(4u, manager_.MenuItems(key1)->size());
761 EXPECT_EQ(1u, manager_.MenuItems(key2)->size()); 761 EXPECT_EQ(1u, manager_.MenuItems(key2)->size());
762 762
763 // Remove all context menu items with incognito true. 763 // Remove all context menu items with incognito true.
764 manager_.RemoveAllIncognitoContextItems(); 764 manager_.RemoveAllIncognitoContextItems();
765 EXPECT_EQ(2u, manager_.MenuItems(key1)->size()); 765 EXPECT_EQ(2u, manager_.MenuItems(key1)->size());
766 EXPECT_EQ(1u, manager_.MenuItems(key2)->size()); 766 EXPECT_EQ(1u, manager_.MenuItems(key2)->size());
767 } 767 }
768 768
769 } // namespace extensions 769 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/menu_manager.cc ('k') | chrome/browser/extensions/plugin_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698