OLD | NEW |
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 "base/message_loop/message_loop.h" | 5 #include "base/message_loop/message_loop.h" |
6 #include "base/prefs/pref_service.h" | 6 #include "base/prefs/pref_service.h" |
7 #include "chrome/browser/ui/browser.h" | 7 #include "chrome/browser/ui/browser.h" |
8 #include "chrome/browser/ui/browser_finder.h" | 8 #include "chrome/browser/ui/browser_finder.h" |
9 #include "chrome/browser/ui/zoom/zoom_controller.h" | 9 #include "chrome/browser/ui/zoom/zoom_controller.h" |
10 #include "chrome/browser/ui/zoom/zoom_observer.h" | 10 #include "chrome/browser/ui/zoom/zoom_observer.h" |
11 #include "chrome/common/pref_names.h" | 11 #include "chrome/common/pref_names.h" |
12 #include "chrome/test/base/chrome_render_view_host_test_harness.h" | 12 #include "chrome/test/base/chrome_render_view_host_test_harness.h" |
13 #include "chrome/test/base/testing_profile.h" | 13 #include "chrome/test/base/testing_profile.h" |
14 #include "content/public/browser/browser_thread.h" | |
15 #include "content/public/browser/host_zoom_map.h" | 14 #include "content/public/browser/host_zoom_map.h" |
16 #include "content/public/browser/navigation_details.h" | 15 #include "content/public/browser/navigation_details.h" |
17 #include "content/public/common/frame_navigate_params.h" | 16 #include "content/public/common/frame_navigate_params.h" |
18 #include "content/public/test/test_utils.h" | 17 #include "content/public/test/test_utils.h" |
19 #include "testing/gmock/include/gmock/gmock.h" | 18 #include "testing/gmock/include/gmock/gmock.h" |
20 #include "testing/gtest/include/gtest/gtest.h" | 19 #include "testing/gtest/include/gtest/gtest.h" |
21 | 20 |
22 class TestZoomObserver : public ZoomObserver { | 21 class TestZoomObserver : public ZoomObserver { |
23 public: | 22 public: |
24 MOCK_METHOD2(OnZoomChanged, void(content::WebContents*, bool)); | 23 MOCK_METHOD2(OnZoomChanged, void(content::WebContents*, bool)); |
(...skipping 30 matching lines...) Expand all Loading... |
55 | 54 |
56 TEST_F(ZoomControllerTest, Observe) { | 55 TEST_F(ZoomControllerTest, Observe) { |
57 EXPECT_CALL(zoom_observer_, OnZoomChanged(web_contents(), false)).Times(1); | 56 EXPECT_CALL(zoom_observer_, OnZoomChanged(web_contents(), false)).Times(1); |
58 | 57 |
59 content::HostZoomMap* host_zoom_map = | 58 content::HostZoomMap* host_zoom_map = |
60 content::HostZoomMap::GetForBrowserContext( | 59 content::HostZoomMap::GetForBrowserContext( |
61 web_contents()->GetBrowserContext()); | 60 web_contents()->GetBrowserContext()); |
62 | 61 |
63 host_zoom_map->SetZoomLevelForHost(std::string(), 110.0f); | 62 host_zoom_map->SetZoomLevelForHost(std::string(), 110.0f); |
64 } | 63 } |
OLD | NEW |