| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "components/power/origin_power_map.h" | 5 #include "components/power/origin_power_map.h" |
| 6 | 6 |
| 7 #include <stddef.h> |
| 8 |
| 7 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
| 8 | 10 |
| 9 namespace power { | 11 namespace power { |
| 10 | 12 |
| 11 TEST(OriginPowerMapTest, StartEmpty) { | 13 TEST(OriginPowerMapTest, StartEmpty) { |
| 12 OriginPowerMap origin_power_map; | 14 OriginPowerMap origin_power_map; |
| 13 EXPECT_EQ(size_t(0), origin_power_map.GetPercentOriginMap().size()); | 15 EXPECT_EQ(size_t(0), origin_power_map.GetPercentOriginMap().size()); |
| 14 } | 16 } |
| 15 | 17 |
| 16 TEST(OriginPowerMapTest, AddOneOriginNotInMap) { | 18 TEST(OriginPowerMapTest, AddOneOriginNotInMap) { |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 | 61 |
| 60 TEST(OriginPowerMapTest, EmptyPercentOriginMapWhenZeroConsumed) { | 62 TEST(OriginPowerMapTest, EmptyPercentOriginMapWhenZeroConsumed) { |
| 61 OriginPowerMap origin_power_map; | 63 OriginPowerMap origin_power_map; |
| 62 EXPECT_EQ(size_t(0), origin_power_map.GetPercentOriginMap().size()); | 64 EXPECT_EQ(size_t(0), origin_power_map.GetPercentOriginMap().size()); |
| 63 GURL url("http://www.google.com"); | 65 GURL url("http://www.google.com"); |
| 64 origin_power_map.AddPowerForOrigin(url, 0); | 66 origin_power_map.AddPowerForOrigin(url, 0); |
| 65 EXPECT_EQ(size_t(0), origin_power_map.GetPercentOriginMap().size()); | 67 EXPECT_EQ(size_t(0), origin_power_map.GetPercentOriginMap().size()); |
| 66 } | 68 } |
| 67 | 69 |
| 68 } // namespace power | 70 } // namespace power |
| OLD | NEW |