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/test/base/chrome_render_view_host_test_harness.h" | 9 #include "chrome/test/base/chrome_render_view_host_test_harness.h" |
10 #include "chrome/test/base/testing_profile.h" | 10 #include "chrome/test/base/testing_profile.h" |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 }; | 58 }; |
59 | 59 |
60 class ZoomControllerTest : public ChromeRenderViewHostTestHarness { | 60 class ZoomControllerTest : public ChromeRenderViewHostTestHarness { |
61 public: | 61 public: |
62 void SetUp() override { | 62 void SetUp() override { |
63 ChromeRenderViewHostTestHarness::SetUp(); | 63 ChromeRenderViewHostTestHarness::SetUp(); |
64 zoom_controller_.reset(new ZoomController(web_contents())); | 64 zoom_controller_.reset(new ZoomController(web_contents())); |
65 | 65 |
66 // This call is needed so that the RenderViewHost reports being alive. This | 66 // This call is needed so that the RenderViewHost reports being alive. This |
67 // is only important for tests that call ZoomController::SetZoomLevel(). | 67 // is only important for tests that call ZoomController::SetZoomLevel(). |
68 content::RenderViewHostTester::For(rvh())->CreateRenderView( | 68 content::RenderViewHostTester::For(rvh())->CreateTestRenderView( |
69 base::string16(), MSG_ROUTING_NONE, MSG_ROUTING_NONE, -1, false); | 69 base::string16(), MSG_ROUTING_NONE, MSG_ROUTING_NONE, -1, false); |
70 } | 70 } |
71 | 71 |
72 void TearDown() override { | 72 void TearDown() override { |
73 zoom_controller_.reset(); | 73 zoom_controller_.reset(); |
74 ChromeRenderViewHostTestHarness::TearDown(); | 74 ChromeRenderViewHostTestHarness::TearDown(); |
75 } | 75 } |
76 | 76 |
77 protected: | 77 protected: |
78 scoped_ptr<ZoomController> zoom_controller_; | 78 scoped_ptr<ZoomController> zoom_controller_; |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 ZoomController::ZOOM_MODE_MANUAL, | 158 ZoomController::ZOOM_MODE_MANUAL, |
159 false /* can_show_bubble */); | 159 false /* can_show_bubble */); |
160 { | 160 { |
161 ZoomChangedWatcher zoom_change_watcher2(zoom_controller_.get(), | 161 ZoomChangedWatcher zoom_change_watcher2(zoom_controller_.get(), |
162 zoom_change_data2); | 162 zoom_change_data2); |
163 zoom_controller_->SetZoomLevel(new_zoom_level2); | 163 zoom_controller_->SetZoomLevel(new_zoom_level2); |
164 zoom_change_watcher2.Wait(); | 164 zoom_change_watcher2.Wait(); |
165 } | 165 } |
166 | 166 |
167 } | 167 } |
OLD | NEW |