OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "components/zoom/zoom_controller.h" | 5 #include "components/zoom/zoom_controller.h" |
6 | 6 |
7 #include "base/macros.h" | 7 #include "base/macros.h" |
8 #include "base/process/kill.h" | 8 #include "base/process/kill.h" |
9 #include "build/build_config.h" | 9 #include "build/build_config.h" |
10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 ErrorPagesCanZoomAfterTabRestore) { | 173 ErrorPagesCanZoomAfterTabRestore) { |
174 // This url is meant to cause a network error page to be loaded. | 174 // This url is meant to cause a network error page to be loaded. |
175 // Tests can't reach the network, so this test should continue | 175 // Tests can't reach the network, so this test should continue |
176 // to work even if the domain listed is someday registered. | 176 // to work even if the domain listed is someday registered. |
177 GURL url("http://kjfhkjsdf.com"); | 177 GURL url("http://kjfhkjsdf.com"); |
178 | 178 |
179 TabStripModel* tab_strip = browser()->tab_strip_model(); | 179 TabStripModel* tab_strip = browser()->tab_strip_model(); |
180 ASSERT_TRUE(tab_strip); | 180 ASSERT_TRUE(tab_strip); |
181 | 181 |
182 ui_test_utils::NavigateToURLWithDisposition( | 182 ui_test_utils::NavigateToURLWithDisposition( |
183 browser(), url, NEW_FOREGROUND_TAB, | 183 browser(), url, WindowOpenDisposition::NEW_FOREGROUND_TAB, |
184 ui_test_utils::BROWSER_TEST_WAIT_FOR_NAVIGATION); | 184 ui_test_utils::BROWSER_TEST_WAIT_FOR_NAVIGATION); |
185 { | 185 { |
186 content::WebContents* web_contents = tab_strip->GetActiveWebContents(); | 186 content::WebContents* web_contents = tab_strip->GetActiveWebContents(); |
187 | 187 |
188 EXPECT_EQ( | 188 EXPECT_EQ( |
189 content::PAGE_TYPE_ERROR, | 189 content::PAGE_TYPE_ERROR, |
190 web_contents->GetController().GetLastCommittedEntry()->GetPageType()); | 190 web_contents->GetController().GetLastCommittedEntry()->GetPageType()); |
191 | 191 |
192 content::WebContentsDestroyedWatcher destroyed_watcher(web_contents); | 192 content::WebContentsDestroyedWatcher destroyed_watcher(web_contents); |
193 tab_strip->CloseWebContentsAt(tab_strip->active_index(), | 193 tab_strip->CloseWebContentsAt(tab_strip->active_index(), |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
279 IN_PROC_BROWSER_TEST_F(ZoomControllerBrowserTest, | 279 IN_PROC_BROWSER_TEST_F(ZoomControllerBrowserTest, |
280 SettingsZoomAfterSigninWorks) { | 280 SettingsZoomAfterSigninWorks) { |
281 GURL signin_url(std::string(chrome::kChromeUIChromeSigninURL) | 281 GURL signin_url(std::string(chrome::kChromeUIChromeSigninURL) |
282 .append("?access_point=0&reason=0")); | 282 .append("?access_point=0&reason=0")); |
283 // We open the signin page in a new tab so that the ZoomController is | 283 // We open the signin page in a new tab so that the ZoomController is |
284 // created against the HostZoomMap of the special StoragePartition that | 284 // created against the HostZoomMap of the special StoragePartition that |
285 // backs the signin page. When we subsequently navigate away from the | 285 // backs the signin page. When we subsequently navigate away from the |
286 // signin page, the HostZoomMap changes, and we need to test that the | 286 // signin page, the HostZoomMap changes, and we need to test that the |
287 // ZoomController correctly detects this. | 287 // ZoomController correctly detects this. |
288 ui_test_utils::NavigateToURLWithDisposition( | 288 ui_test_utils::NavigateToURLWithDisposition( |
289 browser(), signin_url, NEW_FOREGROUND_TAB, | 289 browser(), signin_url, WindowOpenDisposition::NEW_FOREGROUND_TAB, |
290 ui_test_utils::BROWSER_TEST_WAIT_FOR_NAVIGATION); | 290 ui_test_utils::BROWSER_TEST_WAIT_FOR_NAVIGATION); |
291 login_ui_test_utils::WaitUntilUIReady(browser()); | 291 login_ui_test_utils::WaitUntilUIReady(browser()); |
292 content::WebContents* web_contents = | 292 content::WebContents* web_contents = |
293 browser()->tab_strip_model()->GetActiveWebContents(); | 293 browser()->tab_strip_model()->GetActiveWebContents(); |
294 EXPECT_NE( | 294 EXPECT_NE( |
295 content::PAGE_TYPE_ERROR, | 295 content::PAGE_TYPE_ERROR, |
296 web_contents->GetController().GetLastCommittedEntry()->GetPageType()); | 296 web_contents->GetController().GetLastCommittedEntry()->GetPageType()); |
297 | 297 |
298 EXPECT_EQ(signin_url, web_contents->GetLastCommittedURL()); | 298 EXPECT_EQ(signin_url, web_contents->GetLastCommittedURL()); |
299 ZoomController* zoom_controller = | 299 ZoomController* zoom_controller = |
(...skipping 22 matching lines...) Expand all Loading... |
322 web_contents, | 322 web_contents, |
323 old_zoom_level, | 323 old_zoom_level, |
324 new_zoom_level, | 324 new_zoom_level, |
325 ZoomController::ZOOM_MODE_DEFAULT, | 325 ZoomController::ZOOM_MODE_DEFAULT, |
326 true); // We have a non-empty host, so this will be 'true'. | 326 true); // We have a non-empty host, so this will be 'true'. |
327 ZoomChangedWatcher zoom_change_watcher(web_contents, zoom_change_data); | 327 ZoomChangedWatcher zoom_change_watcher(web_contents, zoom_change_data); |
328 zoom_controller->SetZoomLevel(new_zoom_level); | 328 zoom_controller->SetZoomLevel(new_zoom_level); |
329 zoom_change_watcher.Wait(); | 329 zoom_change_watcher.Wait(); |
330 } | 330 } |
331 #endif // !defined(OS_CHROMEOS) | 331 #endif // !defined(OS_CHROMEOS) |
OLD | NEW |