This source file includes following definitions.
- TEST
#include "extensions/browser/process_map.h"
#include "testing/gtest/include/gtest/gtest.h"
using extensions::ProcessMap;
TEST(ExtensionProcessMapTest, Test) {
ProcessMap map;
EXPECT_FALSE(map.Contains("a", 1));
EXPECT_FALSE(map.Remove("a", 1, 1));
EXPECT_EQ(0u, map.size());
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());
EXPECT_FALSE(map.Insert("a", 1, 1));
EXPECT_TRUE(map.Contains("a", 1));
EXPECT_EQ(1u, map.size());
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));
EXPECT_TRUE(map.Contains("a", 2));
EXPECT_TRUE(map.Contains("b", 1));
EXPECT_TRUE(map.Contains("b", 2));
EXPECT_FALSE(map.Contains("a", 3));
EXPECT_TRUE(map.Insert("a", 1, 5));
EXPECT_TRUE(map.Contains("a", 1));
EXPECT_TRUE(map.Remove("a", 1, 1));
EXPECT_FALSE(map.Remove("a", 1, 1));
EXPECT_EQ(4u, map.size());
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.RemoveAllFromProcess(2));
EXPECT_EQ(1u, map.size());
EXPECT_EQ(0, map.RemoveAllFromProcess(2));
EXPECT_EQ(1u, map.size());
}