Index: chrome/browser/extensions/process_map_unittest.cc |
diff --git a/chrome/browser/extensions/process_map_unittest.cc b/chrome/browser/extensions/process_map_unittest.cc |
index 40b3e5959cb62232df2a3466cfebecbfc753b08e..3c90826a2a9ac1caa1b9652cb867379176998c7b 100644 |
--- a/chrome/browser/extensions/process_map_unittest.cc |
+++ b/chrome/browser/extensions/process_map_unittest.cc |
@@ -13,25 +13,25 @@ TEST(ExtensionProcessMapTest, Test) { |
// Test behavior when empty. |
EXPECT_FALSE(map.Contains("a", 1)); |
- EXPECT_FALSE(map.Remove("a", 1)); |
+ EXPECT_FALSE(map.Remove("a", 1, 1)); |
EXPECT_EQ(0u, map.size()); |
// Test insertion and behavior with one item. |
- EXPECT_TRUE(map.Insert("a", 1)); |
+ EXPECT_TRUE(map.Insert("a", 1, 1)); |
EXPECT_TRUE(map.Contains("a", 1)); |
EXPECT_FALSE(map.Contains("a", 2)); |
EXPECT_FALSE(map.Contains("b", 1)); |
EXPECT_EQ(1u, map.size()); |
// Test inserting a duplicate item. |
- EXPECT_FALSE(map.Insert("a", 1)); |
+ EXPECT_FALSE(map.Insert("a", 1, 1)); |
EXPECT_TRUE(map.Contains("a", 1)); |
EXPECT_EQ(1u, map.size()); |
// Insert some more items. |
- EXPECT_TRUE(map.Insert("a", 2)); |
- EXPECT_TRUE(map.Insert("b", 1)); |
- EXPECT_TRUE(map.Insert("b", 2)); |
+ EXPECT_TRUE(map.Insert("a", 2, 2)); |
+ EXPECT_TRUE(map.Insert("b", 1, 3)); |
+ EXPECT_TRUE(map.Insert("b", 2, 4)); |
EXPECT_EQ(4u, map.size()); |
EXPECT_TRUE(map.Contains("a", 1)); |
@@ -40,13 +40,26 @@ TEST(ExtensionProcessMapTest, Test) { |
EXPECT_TRUE(map.Contains("b", 2)); |
EXPECT_FALSE(map.Contains("a", 3)); |
+ // Note that this only differs from an existing item because of the site |
+ // instance id. |
+ EXPECT_TRUE(map.Insert("a", 1, 5)); |
+ EXPECT_TRUE(map.Contains("a", 1)); |
+ |
// Test removal. |
- EXPECT_TRUE(map.Remove("a", 1)); |
- EXPECT_FALSE(map.Remove("a", 1)); |
+ EXPECT_TRUE(map.Remove("a", 1, 1)); |
+ EXPECT_FALSE(map.Remove("a", 1, 1)); |
+ EXPECT_EQ(4u, map.size()); |
+ |
+ // Should still return true because there were two site instances for this |
+ // extension/process pair. |
+ EXPECT_TRUE(map.Contains("a", 1)); |
+ |
+ EXPECT_TRUE(map.Remove("a", 1, 5)); |
EXPECT_EQ(3u, map.size()); |
+ EXPECT_FALSE(map.Contains("a", 1)); |
- EXPECT_EQ(2, map.Remove(2)); |
+ EXPECT_EQ(2, map.RemoveAllFromProcess(2)); |
EXPECT_EQ(1u, map.size()); |
- EXPECT_EQ(0, map.Remove(2)); |
+ EXPECT_EQ(0, map.RemoveAllFromProcess(2)); |
EXPECT_EQ(1u, map.size()); |
} |