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 "chrome/browser/ui/browser.h" | 6 #include "chrome/browser/ui/browser.h" |
7 #include "chrome/browser/ui/browser_finder.h" | 7 #include "chrome/browser/ui/browser_finder.h" |
8 #include "chrome/test/base/chrome_render_view_host_test_harness.h" | 8 #include "chrome/test/base/chrome_render_view_host_test_harness.h" |
9 #include "chrome/test/base/testing_profile.h" | 9 #include "chrome/test/base/testing_profile.h" |
10 #include "components/prefs/pref_service.h" | 10 #include "components/prefs/pref_service.h" |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 zoom_controller_->DidFinishNavigation(navigation_handle.get()); | 59 zoom_controller_->DidFinishNavigation(navigation_handle.get()); |
60 zoom_change_watcher.Wait(); | 60 zoom_change_watcher.Wait(); |
61 } | 61 } |
62 | 62 |
63 TEST_F(ZoomControllerTest, Observe_ZoomController) { | 63 TEST_F(ZoomControllerTest, Observe_ZoomController) { |
64 double old_zoom_level = zoom_controller_->GetZoomLevel(); | 64 double old_zoom_level = zoom_controller_->GetZoomLevel(); |
65 double new_zoom_level = 110.0; | 65 double new_zoom_level = 110.0; |
66 | 66 |
67 NavigateAndCommit(GURL("about:blank")); | 67 NavigateAndCommit(GURL("about:blank")); |
68 | 68 |
69 // Changing from default to default so the bubble should not be shown. | |
70 ZoomController::ZoomChangedEventData zoom_change_data1( | 69 ZoomController::ZoomChangedEventData zoom_change_data1( |
71 web_contents(), old_zoom_level, old_zoom_level, | 70 web_contents(), |
72 ZoomController::ZOOM_MODE_ISOLATED, false /* can_show_bubble */); | 71 old_zoom_level, |
| 72 old_zoom_level, |
| 73 ZoomController::ZOOM_MODE_ISOLATED, |
| 74 true /* can_show_bubble */); |
73 | 75 |
74 { | 76 { |
75 ZoomChangedWatcher zoom_change_watcher1(zoom_controller_.get(), | 77 ZoomChangedWatcher zoom_change_watcher1(zoom_controller_.get(), |
76 zoom_change_data1); | 78 zoom_change_data1); |
77 zoom_controller_->SetZoomMode(ZoomController::ZOOM_MODE_ISOLATED); | 79 zoom_controller_->SetZoomMode(ZoomController::ZOOM_MODE_ISOLATED); |
78 zoom_change_watcher1.Wait(); | 80 zoom_change_watcher1.Wait(); |
79 } | 81 } |
80 | 82 |
81 ZoomController::ZoomChangedEventData zoom_change_data2( | 83 ZoomController::ZoomChangedEventData zoom_change_data2( |
82 web_contents(), | 84 web_contents(), |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 ZoomController::ZOOM_MODE_MANUAL, | 125 ZoomController::ZOOM_MODE_MANUAL, |
124 false /* can_show_bubble */); | 126 false /* can_show_bubble */); |
125 { | 127 { |
126 ZoomChangedWatcher zoom_change_watcher2(zoom_controller_.get(), | 128 ZoomChangedWatcher zoom_change_watcher2(zoom_controller_.get(), |
127 zoom_change_data2); | 129 zoom_change_data2); |
128 zoom_controller_->SetZoomLevel(new_zoom_level2); | 130 zoom_controller_->SetZoomLevel(new_zoom_level2); |
129 zoom_change_watcher2.Wait(); | 131 zoom_change_watcher2.Wait(); |
130 } | 132 } |
131 | 133 |
132 } | 134 } |
OLD | NEW |