OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "content/browser/host_zoom_map_impl.h" | 5 #include "content/browser/host_zoom_map_impl.h" |
6 | 6 |
7 #include "base/memory/ref_counted.h" | 7 #include "base/memory/ref_counted.h" |
8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
9 #include "content/public/browser/browser_thread.h" | 9 #include "content/public/browser/browser_thread.h" |
10 #include "content/public/test/test_browser_thread.h" | 10 #include "content/public/test/test_browser_thread.h" |
(...skipping 14 matching lines...) Expand all Loading... |
25 TEST_F(HostZoomMapTest, GetSetZoomLevel) { | 25 TEST_F(HostZoomMapTest, GetSetZoomLevel) { |
26 HostZoomMapImpl host_zoom_map; | 26 HostZoomMapImpl host_zoom_map; |
27 | 27 |
28 double zoomed = 2.5; | 28 double zoomed = 2.5; |
29 host_zoom_map.SetZoomLevel("zoomed.com", zoomed); | 29 host_zoom_map.SetZoomLevel("zoomed.com", zoomed); |
30 | 30 |
31 EXPECT_DOUBLE_EQ(host_zoom_map.GetZoomLevel("normal.com"), 0); | 31 EXPECT_DOUBLE_EQ(host_zoom_map.GetZoomLevel("normal.com"), 0); |
32 EXPECT_DOUBLE_EQ(host_zoom_map.GetZoomLevel("zoomed.com"), zoomed); | 32 EXPECT_DOUBLE_EQ(host_zoom_map.GetZoomLevel("zoomed.com"), zoomed); |
33 } | 33 } |
34 | 34 |
| 35 TEST_F(HostZoomMapTest, GetSetZoomLevelWithScheme) { |
| 36 HostZoomMapImpl host_zoom_map; |
| 37 |
| 38 double zoomed = 2.5; |
| 39 double default_zoom = 1.5; |
| 40 |
| 41 host_zoom_map.SetZoomLevel("chrome", "login", 0); |
| 42 |
| 43 host_zoom_map.SetDefaultZoomLevel(default_zoom); |
| 44 |
| 45 EXPECT_DOUBLE_EQ(host_zoom_map.GetZoomLevel("chrome", "login"), 0); |
| 46 EXPECT_DOUBLE_EQ(host_zoom_map.GetZoomLevel("http", "login"), default_zoom); |
| 47 |
| 48 host_zoom_map.SetZoomLevel("login", zoomed); |
| 49 |
| 50 EXPECT_DOUBLE_EQ(host_zoom_map.GetZoomLevel("chrome", "login"), 0); |
| 51 EXPECT_DOUBLE_EQ(host_zoom_map.GetZoomLevel("http", "login"), zoomed); |
| 52 } |
| 53 |
35 } // namespace content | 54 } // namespace content |
OLD | NEW |