| 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. |
| 69 ZoomController::ZoomChangedEventData zoom_change_data1( | 70 ZoomController::ZoomChangedEventData zoom_change_data1( |
| 70 web_contents(), | 71 web_contents(), old_zoom_level, old_zoom_level, |
| 71 old_zoom_level, | 72 ZoomController::ZOOM_MODE_ISOLATED, false /* can_show_bubble */); |
| 72 old_zoom_level, | |
| 73 ZoomController::ZOOM_MODE_ISOLATED, | |
| 74 true /* can_show_bubble */); | |
| 75 | 73 |
| 76 { | 74 { |
| 77 ZoomChangedWatcher zoom_change_watcher1(zoom_controller_.get(), | 75 ZoomChangedWatcher zoom_change_watcher1(zoom_controller_.get(), |
| 78 zoom_change_data1); | 76 zoom_change_data1); |
| 79 zoom_controller_->SetZoomMode(ZoomController::ZOOM_MODE_ISOLATED); | 77 zoom_controller_->SetZoomMode(ZoomController::ZOOM_MODE_ISOLATED); |
| 80 zoom_change_watcher1.Wait(); | 78 zoom_change_watcher1.Wait(); |
| 81 } | 79 } |
| 82 | 80 |
| 83 ZoomController::ZoomChangedEventData zoom_change_data2( | 81 ZoomController::ZoomChangedEventData zoom_change_data2( |
| 84 web_contents(), | 82 web_contents(), |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 ZoomController::ZOOM_MODE_MANUAL, | 123 ZoomController::ZOOM_MODE_MANUAL, |
| 126 false /* can_show_bubble */); | 124 false /* can_show_bubble */); |
| 127 { | 125 { |
| 128 ZoomChangedWatcher zoom_change_watcher2(zoom_controller_.get(), | 126 ZoomChangedWatcher zoom_change_watcher2(zoom_controller_.get(), |
| 129 zoom_change_data2); | 127 zoom_change_data2); |
| 130 zoom_controller_->SetZoomLevel(new_zoom_level2); | 128 zoom_controller_->SetZoomLevel(new_zoom_level2); |
| 131 zoom_change_watcher2.Wait(); | 129 zoom_change_watcher2.Wait(); |
| 132 } | 130 } |
| 133 | 131 |
| 134 } | 132 } |
| OLD | NEW |