| 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 "chrome/app/chrome_command_ids.h" | 5 #include "chrome/app/chrome_command_ids.h" |
| 6 #include "chrome/browser/bookmarks/bookmark_model_factory.h" | 6 #include "chrome/browser/bookmarks/bookmark_model_factory.h" |
| 7 #include "chrome/browser/chrome_page_zoom.h" | 7 #include "chrome/browser/chrome_page_zoom.h" |
| 8 #include "chrome/browser/ui/browser_command_controller.h" | 8 #include "chrome/browser/ui/browser_command_controller.h" |
| 9 #include "chrome/browser/ui/browser_commands.h" | 9 #include "chrome/browser/ui/browser_commands.h" |
| 10 #include "chrome/browser/ui/browser_finder.h" | 10 #include "chrome/browser/ui/browser_finder.h" |
| 11 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 11 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| 12 #include "chrome/browser/ui/zoom/zoom_controller.h" | |
| 13 #include "chrome/common/url_constants.h" | 12 #include "chrome/common/url_constants.h" |
| 14 #include "chrome/test/base/browser_with_test_window_test.h" | 13 #include "chrome/test/base/browser_with_test_window_test.h" |
| 15 #include "chrome/test/base/testing_profile.h" | 14 #include "chrome/test/base/testing_profile.h" |
| 16 #include "components/bookmarks/browser/bookmark_model.h" | 15 #include "components/bookmarks/browser/bookmark_model.h" |
| 17 #include "components/bookmarks/test/bookmark_test_helpers.h" | 16 #include "components/bookmarks/test/bookmark_test_helpers.h" |
| 17 #include "components/ui/zoom/zoom_controller.h" |
| 18 #include "content/public/browser/navigation_controller.h" | 18 #include "content/public/browser/navigation_controller.h" |
| 19 #include "content/public/browser/navigation_entry.h" | 19 #include "content/public/browser/navigation_entry.h" |
| 20 #include "content/public/browser/web_contents.h" | 20 #include "content/public/browser/web_contents.h" |
| 21 | 21 |
| 22 typedef BrowserWithTestWindowTest BrowserCommandsTest; | 22 typedef BrowserWithTestWindowTest BrowserCommandsTest; |
| 23 | 23 |
| 24 using components::ZoomController; |
| 24 using content::OpenURLParams; | 25 using content::OpenURLParams; |
| 25 using content::Referrer; | 26 using content::Referrer; |
| 26 using content::WebContents; | 27 using content::WebContents; |
| 27 | 28 |
| 28 // Tests IDC_SELECT_TAB_0, IDC_SELECT_NEXT_TAB, IDC_SELECT_PREVIOUS_TAB and | 29 // Tests IDC_SELECT_TAB_0, IDC_SELECT_NEXT_TAB, IDC_SELECT_PREVIOUS_TAB and |
| 29 // IDC_SELECT_LAST_TAB. | 30 // IDC_SELECT_LAST_TAB. |
| 30 TEST_F(BrowserCommandsTest, TabNavigationAccelerators) { | 31 TEST_F(BrowserCommandsTest, TabNavigationAccelerators) { |
| 31 GURL about_blank(url::kAboutBlankURL); | 32 GURL about_blank(url::kAboutBlankURL); |
| 32 | 33 |
| 33 // Create three tabs. | 34 // Create three tabs. |
| (...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 332 tab_strip_model->ActivateTabAt(1, true); | 333 tab_strip_model->ActivateTabAt(1, true); |
| 333 EXPECT_TRUE(tab_strip_model->IsTabSelected(1)); | 334 EXPECT_TRUE(tab_strip_model->IsTabSelected(1)); |
| 334 chrome_page_zoom::Zoom(contents2, content::PAGE_ZOOM_OUT); | 335 chrome_page_zoom::Zoom(contents2, content::PAGE_ZOOM_OUT); |
| 335 | 336 |
| 336 zoom_controller = ZoomController::FromWebContents(contents2); | 337 zoom_controller = ZoomController::FromWebContents(contents2); |
| 337 EXPECT_EQ(zoom_controller->GetZoomPercent(), 90.0f); | 338 EXPECT_EQ(zoom_controller->GetZoomPercent(), 90.0f); |
| 338 EXPECT_TRUE(chrome::IsCommandEnabled(browser(), IDC_ZOOM_PLUS)); | 339 EXPECT_TRUE(chrome::IsCommandEnabled(browser(), IDC_ZOOM_PLUS)); |
| 339 EXPECT_TRUE(chrome::IsCommandEnabled(browser(), IDC_ZOOM_NORMAL)); | 340 EXPECT_TRUE(chrome::IsCommandEnabled(browser(), IDC_ZOOM_NORMAL)); |
| 340 EXPECT_TRUE(chrome::IsCommandEnabled(browser(), IDC_ZOOM_MINUS)); | 341 EXPECT_TRUE(chrome::IsCommandEnabled(browser(), IDC_ZOOM_MINUS)); |
| 341 } | 342 } |
| OLD | NEW |