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.h" | 5 #include "base/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" |
(...skipping 10 matching lines...) Expand all Loading... |
21 #include "testing/gtest/include/gtest/gtest.h" | 21 #include "testing/gtest/include/gtest/gtest.h" |
22 | 22 |
23 class TestZoomObserver : public ZoomObserver { | 23 class TestZoomObserver : public ZoomObserver { |
24 public: | 24 public: |
25 MOCK_METHOD2(OnZoomChanged, void(content::WebContents*, bool)); | 25 MOCK_METHOD2(OnZoomChanged, void(content::WebContents*, bool)); |
26 }; | 26 }; |
27 | 27 |
28 class ZoomControllerTest : public ChromeRenderViewHostTestHarness { | 28 class ZoomControllerTest : public ChromeRenderViewHostTestHarness { |
29 public: | 29 public: |
30 ZoomControllerTest() | 30 ZoomControllerTest() |
31 : ui_thread_(content::BrowserThread::UI, MessageLoop::current()) {} | 31 : ui_thread_(content::BrowserThread::UI, base::MessageLoop::current()) {} |
32 | 32 |
33 virtual void SetUp() OVERRIDE { | 33 virtual void SetUp() OVERRIDE { |
34 ChromeRenderViewHostTestHarness::SetUp(); | 34 ChromeRenderViewHostTestHarness::SetUp(); |
35 zoom_controller_.reset(new ZoomController(web_contents())); | 35 zoom_controller_.reset(new ZoomController(web_contents())); |
36 zoom_controller_->set_observer(&zoom_observer_); | 36 zoom_controller_->set_observer(&zoom_observer_); |
37 } | 37 } |
38 | 38 |
39 virtual void TearDown() OVERRIDE { | 39 virtual void TearDown() OVERRIDE { |
40 zoom_controller_.reset(); | 40 zoom_controller_.reset(); |
41 ChromeRenderViewHostTestHarness::TearDown(); | 41 ChromeRenderViewHostTestHarness::TearDown(); |
(...skipping 21 matching lines...) Expand all Loading... |
63 | 63 |
64 TEST_F(ZoomControllerTest, Observe) { | 64 TEST_F(ZoomControllerTest, Observe) { |
65 EXPECT_CALL(zoom_observer_, OnZoomChanged(web_contents(), false)).Times(1); | 65 EXPECT_CALL(zoom_observer_, OnZoomChanged(web_contents(), false)).Times(1); |
66 | 66 |
67 content::HostZoomMap* host_zoom_map = | 67 content::HostZoomMap* host_zoom_map = |
68 content::HostZoomMap::GetForBrowserContext( | 68 content::HostZoomMap::GetForBrowserContext( |
69 web_contents()->GetBrowserContext()); | 69 web_contents()->GetBrowserContext()); |
70 | 70 |
71 host_zoom_map->SetZoomLevelForHost(std::string(), 110.0f); | 71 host_zoom_map->SetZoomLevelForHost(std::string(), 110.0f); |
72 } | 72 } |
OLD | NEW |