| 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/strings/utf_string_conversions.h" | 5 #include "base/strings/utf_string_conversions.h" |
| 6 #include "build/build_config.h" | 6 #include "build/build_config.h" |
| 7 #include "chrome/app/chrome_command_ids.h" | 7 #include "chrome/app/chrome_command_ids.h" |
| 8 #include "chrome/browser/profiles/profile.h" | 8 #include "chrome/browser/profiles/profile.h" |
| 9 #include "chrome/browser/task_manager/task_manager_browsertest_util.h" | 9 #include "chrome/browser/task_manager/task_manager_browsertest_util.h" |
| 10 #include "chrome/browser/ui/browser.h" | 10 #include "chrome/browser/ui/browser.h" |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 // Create the print preview dialog. | 68 // Create the print preview dialog. |
| 69 Print(); | 69 Print(); |
| 70 | 70 |
| 71 ASSERT_FALSE(chrome::IsCommandEnabled(browser(), IDC_PRINT)); | 71 ASSERT_FALSE(chrome::IsCommandEnabled(browser(), IDC_PRINT)); |
| 72 | 72 |
| 73 ASSERT_EQ(is_basic_print_expected, | 73 ASSERT_EQ(is_basic_print_expected, |
| 74 chrome::IsCommandEnabled(browser(), IDC_BASIC_PRINT)); | 74 chrome::IsCommandEnabled(browser(), IDC_BASIC_PRINT)); |
| 75 | 75 |
| 76 content::TestNavigationObserver reload_observer( | 76 content::TestNavigationObserver reload_observer( |
| 77 browser()->tab_strip_model()->GetActiveWebContents()); | 77 browser()->tab_strip_model()->GetActiveWebContents()); |
| 78 chrome::Reload(browser(), CURRENT_TAB); | 78 chrome::Reload(browser(), WindowOpenDisposition::CURRENT_TAB); |
| 79 reload_observer.Wait(); | 79 reload_observer.Wait(); |
| 80 | 80 |
| 81 ASSERT_TRUE(chrome::IsCommandEnabled(browser(), IDC_PRINT)); | 81 ASSERT_TRUE(chrome::IsCommandEnabled(browser(), IDC_PRINT)); |
| 82 | 82 |
| 83 ASSERT_EQ(is_basic_print_expected, | 83 ASSERT_EQ(is_basic_print_expected, |
| 84 chrome::IsCommandEnabled(browser(), IDC_BASIC_PRINT)); | 84 chrome::IsCommandEnabled(browser(), IDC_BASIC_PRINT)); |
| 85 } | 85 } |
| 86 | 86 |
| 87 // Disable the test for mac, see http://crbug/367665. | 87 // Disable the test for mac, see http://crbug/367665. |
| 88 #if defined(OS_MACOSX) || defined(OS_LINUX) | 88 #if defined(OS_MACOSX) || defined(OS_LINUX) |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 WaitForTaskManagerRows(1, MatchPrint(url::kAboutBlankURL))); | 122 WaitForTaskManagerRows(1, MatchPrint(url::kAboutBlankURL))); |
| 123 } | 123 } |
| 124 | 124 |
| 125 #if defined(OS_WIN) | 125 #if defined(OS_WIN) |
| 126 // http://crbug.com/396360 | 126 // http://crbug.com/396360 |
| 127 IN_PROC_BROWSER_TEST_F(PrintPreviewTest, DISABLED_NoCrashOnCloseWithOtherTabs) { | 127 IN_PROC_BROWSER_TEST_F(PrintPreviewTest, DISABLED_NoCrashOnCloseWithOtherTabs) { |
| 128 // Now print preview. | 128 // Now print preview. |
| 129 Print(); | 129 Print(); |
| 130 | 130 |
| 131 ui_test_utils::NavigateToURLWithDisposition( | 131 ui_test_utils::NavigateToURLWithDisposition( |
| 132 browser(), GURL("about:blank"), NEW_FOREGROUND_TAB, | 132 browser(), GURL("about:blank"), WindowOpenDisposition::NEW_FOREGROUND_TAB, |
| 133 ui_test_utils::BROWSER_TEST_WAIT_FOR_NAVIGATION); | 133 ui_test_utils::BROWSER_TEST_WAIT_FOR_NAVIGATION); |
| 134 | 134 |
| 135 browser()->tab_strip_model()->ActivateTabAt(0, true); | 135 browser()->tab_strip_model()->ActivateTabAt(0, true); |
| 136 | 136 |
| 137 // Navigate main tab to hide print preview. | 137 // Navigate main tab to hide print preview. |
| 138 ui_test_utils::NavigateToURL(browser(), GURL("about:blank")); | 138 ui_test_utils::NavigateToURL(browser(), GURL("about:blank")); |
| 139 | 139 |
| 140 browser()->tab_strip_model()->ActivateTabAt(1, true); | 140 browser()->tab_strip_model()->ActivateTabAt(1, true); |
| 141 } | 141 } |
| 142 #endif // defined(OS_WIN) | 142 #endif // defined(OS_WIN) |
| 143 | 143 |
| 144 } // namespace | 144 } // namespace |
| OLD | NEW |