| 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/prefs/pref_service.h" | 5 #include "base/prefs/pref_service.h" |
| 6 #include "base/strings/utf_string_conversions.h" | 6 #include "base/strings/utf_string_conversions.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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 chrome::IsCommandEnabled(browser(), IDC_BASIC_PRINT)); | 83 chrome::IsCommandEnabled(browser(), IDC_BASIC_PRINT)); |
| 84 } | 84 } |
| 85 | 85 |
| 86 // Disable the test for mac, see http://crbug/367665. | 86 // Disable the test for mac, see http://crbug/367665. |
| 87 #if (defined(OS_MACOSX) && !defined(OS_IOS)) || defined(OS_LINUX) | 87 #if (defined(OS_MACOSX) && !defined(OS_IOS)) || defined(OS_LINUX) |
| 88 #define MAYBE_TaskManagerNewPrintPreview DISABLED_TaskManagerNewPrintPreview | 88 #define MAYBE_TaskManagerNewPrintPreview DISABLED_TaskManagerNewPrintPreview |
| 89 #else | 89 #else |
| 90 #define MAYBE_TaskManagerNewPrintPreview TaskManagerNewPrintPreview | 90 #define MAYBE_TaskManagerNewPrintPreview TaskManagerNewPrintPreview |
| 91 #endif | 91 #endif |
| 92 IN_PROC_BROWSER_TEST_F(PrintPreviewTest, MAYBE_TaskManagerNewPrintPreview) { | 92 IN_PROC_BROWSER_TEST_F(PrintPreviewTest, MAYBE_TaskManagerNewPrintPreview) { |
| 93 // This test is for the old implementation of the task manager. We must |
| 94 // explicitly disable the new one. |
| 95 task_manager::browsertest_util::EnableOldTaskManager(); |
| 96 |
| 93 chrome::ShowTaskManager(browser()); // Show task manager BEFORE print dialog. | 97 chrome::ShowTaskManager(browser()); // Show task manager BEFORE print dialog. |
| 94 | 98 |
| 95 ASSERT_NO_FATAL_FAILURE(WaitForTaskManagerRows(1, MatchAboutBlankTab())); | 99 ASSERT_NO_FATAL_FAILURE(WaitForTaskManagerRows(1, MatchAboutBlankTab())); |
| 96 ASSERT_NO_FATAL_FAILURE(WaitForTaskManagerRows(1, MatchAnyTab())); | 100 ASSERT_NO_FATAL_FAILURE(WaitForTaskManagerRows(1, MatchAnyTab())); |
| 97 ASSERT_NO_FATAL_FAILURE(WaitForTaskManagerRows(0, MatchAnyPrint())); | 101 ASSERT_NO_FATAL_FAILURE(WaitForTaskManagerRows(0, MatchAnyPrint())); |
| 98 | 102 |
| 99 // Create the print preview dialog. | 103 // Create the print preview dialog. |
| 100 Print(); | 104 Print(); |
| 101 | 105 |
| 102 ASSERT_NO_FATAL_FAILURE(WaitForTaskManagerRows(1, MatchAboutBlankTab())); | 106 ASSERT_NO_FATAL_FAILURE(WaitForTaskManagerRows(1, MatchAboutBlankTab())); |
| 103 ASSERT_NO_FATAL_FAILURE(WaitForTaskManagerRows(1, MatchAnyTab())); | 107 ASSERT_NO_FATAL_FAILURE(WaitForTaskManagerRows(1, MatchAnyTab())); |
| 104 ASSERT_NO_FATAL_FAILURE(WaitForTaskManagerRows(1, MatchAnyPrint())); | 108 ASSERT_NO_FATAL_FAILURE(WaitForTaskManagerRows(1, MatchAnyPrint())); |
| 105 ASSERT_NO_FATAL_FAILURE( | 109 ASSERT_NO_FATAL_FAILURE( |
| 106 WaitForTaskManagerRows(1, MatchPrint(url::kAboutBlankURL))); | 110 WaitForTaskManagerRows(1, MatchPrint(url::kAboutBlankURL))); |
| 107 } | 111 } |
| 108 | 112 |
| 109 // http://crbug/367665. | 113 // http://crbug/367665. |
| 110 IN_PROC_BROWSER_TEST_F(PrintPreviewTest, | 114 IN_PROC_BROWSER_TEST_F(PrintPreviewTest, |
| 111 DISABLED_TaskManagerExistingPrintPreview) { | 115 DISABLED_TaskManagerExistingPrintPreview) { |
| 116 // This test is for the old implementation of the task manager. We must |
| 117 // explicitly disable the new one. |
| 118 task_manager::browsertest_util::EnableOldTaskManager(); |
| 119 |
| 112 // Create the print preview dialog. | 120 // Create the print preview dialog. |
| 113 Print(); | 121 Print(); |
| 114 | 122 |
| 115 chrome::ShowTaskManager(browser()); // Show task manager AFTER print dialog. | 123 chrome::ShowTaskManager(browser()); // Show task manager AFTER print dialog. |
| 116 | 124 |
| 117 ASSERT_NO_FATAL_FAILURE(WaitForTaskManagerRows(1, MatchAboutBlankTab())); | 125 ASSERT_NO_FATAL_FAILURE(WaitForTaskManagerRows(1, MatchAboutBlankTab())); |
| 118 ASSERT_NO_FATAL_FAILURE(WaitForTaskManagerRows(1, MatchAnyTab())); | 126 ASSERT_NO_FATAL_FAILURE(WaitForTaskManagerRows(1, MatchAnyTab())); |
| 119 ASSERT_NO_FATAL_FAILURE(WaitForTaskManagerRows(1, MatchAnyPrint())); | 127 ASSERT_NO_FATAL_FAILURE(WaitForTaskManagerRows(1, MatchAnyPrint())); |
| 120 ASSERT_NO_FATAL_FAILURE( | 128 ASSERT_NO_FATAL_FAILURE( |
| 121 WaitForTaskManagerRows(1, MatchPrint(url::kAboutBlankURL))); | 129 WaitForTaskManagerRows(1, MatchPrint(url::kAboutBlankURL))); |
| (...skipping 12 matching lines...) Expand all Loading... |
| 134 browser()->tab_strip_model()->ActivateTabAt(0, true); | 142 browser()->tab_strip_model()->ActivateTabAt(0, true); |
| 135 | 143 |
| 136 // Navigate main tab to hide print preview. | 144 // Navigate main tab to hide print preview. |
| 137 ui_test_utils::NavigateToURL(browser(), GURL("about:blank")); | 145 ui_test_utils::NavigateToURL(browser(), GURL("about:blank")); |
| 138 | 146 |
| 139 browser()->tab_strip_model()->ActivateTabAt(1, true); | 147 browser()->tab_strip_model()->ActivateTabAt(1, true); |
| 140 } | 148 } |
| 141 #endif // defined(OS_WIN) | 149 #endif // defined(OS_WIN) |
| 142 | 150 |
| 143 } // namespace | 151 } // namespace |
| OLD | NEW |