Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(240)

Side by Side Diff: chrome/browser/ui/webui/print_preview/print_preview_ui_browsertest.cc

Issue 1922683003: Make old task manager tests work against new task manager. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix OSX function call namespace Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/browser/ui/views/task_manager_view.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
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)
89 #define MAYBE_TaskManagerNewPrintPreview DISABLED_TaskManagerNewPrintPreview 89 #define MAYBE_TaskManagerNewPrintPreview DISABLED_TaskManagerNewPrintPreview
90 #else 90 #else
91 #define MAYBE_TaskManagerNewPrintPreview TaskManagerNewPrintPreview 91 #define MAYBE_TaskManagerNewPrintPreview TaskManagerNewPrintPreview
92 #endif 92 #endif
93 IN_PROC_BROWSER_TEST_F(PrintPreviewTest, MAYBE_TaskManagerNewPrintPreview) { 93 IN_PROC_BROWSER_TEST_F(PrintPreviewTest, MAYBE_TaskManagerNewPrintPreview) {
94 // This test is for the old implementation of the task manager. We must
95 // explicitly disable the new one.
96 task_manager::browsertest_util::EnableOldTaskManager();
97
98 chrome::ShowTaskManager(browser()); // Show task manager BEFORE print dialog. 94 chrome::ShowTaskManager(browser()); // Show task manager BEFORE print dialog.
99 95
100 ASSERT_NO_FATAL_FAILURE(WaitForTaskManagerRows(1, MatchAboutBlankTab())); 96 ASSERT_NO_FATAL_FAILURE(WaitForTaskManagerRows(1, MatchAboutBlankTab()));
101 ASSERT_NO_FATAL_FAILURE(WaitForTaskManagerRows(1, MatchAnyTab())); 97 ASSERT_NO_FATAL_FAILURE(WaitForTaskManagerRows(1, MatchAnyTab()));
102 ASSERT_NO_FATAL_FAILURE(WaitForTaskManagerRows(0, MatchAnyPrint())); 98 ASSERT_NO_FATAL_FAILURE(WaitForTaskManagerRows(0, MatchAnyPrint()));
103 99
104 // Create the print preview dialog. 100 // Create the print preview dialog.
105 Print(); 101 Print();
106 102
107 ASSERT_NO_FATAL_FAILURE(WaitForTaskManagerRows(1, MatchAboutBlankTab())); 103 ASSERT_NO_FATAL_FAILURE(WaitForTaskManagerRows(1, MatchAboutBlankTab()));
108 ASSERT_NO_FATAL_FAILURE(WaitForTaskManagerRows(1, MatchAnyTab())); 104 ASSERT_NO_FATAL_FAILURE(WaitForTaskManagerRows(1, MatchAnyTab()));
109 ASSERT_NO_FATAL_FAILURE(WaitForTaskManagerRows(1, MatchAnyPrint())); 105 ASSERT_NO_FATAL_FAILURE(WaitForTaskManagerRows(1, MatchAnyPrint()));
110 ASSERT_NO_FATAL_FAILURE( 106 ASSERT_NO_FATAL_FAILURE(
111 WaitForTaskManagerRows(1, MatchPrint(url::kAboutBlankURL))); 107 WaitForTaskManagerRows(1, MatchPrint(url::kAboutBlankURL)));
112 } 108 }
113 109
114 // http://crbug/367665. 110 // http://crbug/367665.
115 IN_PROC_BROWSER_TEST_F(PrintPreviewTest, 111 IN_PROC_BROWSER_TEST_F(PrintPreviewTest,
116 DISABLED_TaskManagerExistingPrintPreview) { 112 DISABLED_TaskManagerExistingPrintPreview) {
117 // This test is for the old implementation of the task manager. We must
118 // explicitly disable the new one.
119 task_manager::browsertest_util::EnableOldTaskManager();
120
121 // Create the print preview dialog. 113 // Create the print preview dialog.
122 Print(); 114 Print();
123 115
124 chrome::ShowTaskManager(browser()); // Show task manager AFTER print dialog. 116 chrome::ShowTaskManager(browser()); // Show task manager AFTER print dialog.
125 117
126 ASSERT_NO_FATAL_FAILURE(WaitForTaskManagerRows(1, MatchAboutBlankTab())); 118 ASSERT_NO_FATAL_FAILURE(WaitForTaskManagerRows(1, MatchAboutBlankTab()));
127 ASSERT_NO_FATAL_FAILURE(WaitForTaskManagerRows(1, MatchAnyTab())); 119 ASSERT_NO_FATAL_FAILURE(WaitForTaskManagerRows(1, MatchAnyTab()));
128 ASSERT_NO_FATAL_FAILURE(WaitForTaskManagerRows(1, MatchAnyPrint())); 120 ASSERT_NO_FATAL_FAILURE(WaitForTaskManagerRows(1, MatchAnyPrint()));
129 ASSERT_NO_FATAL_FAILURE( 121 ASSERT_NO_FATAL_FAILURE(
130 WaitForTaskManagerRows(1, MatchPrint(url::kAboutBlankURL))); 122 WaitForTaskManagerRows(1, MatchPrint(url::kAboutBlankURL)));
(...skipping 12 matching lines...) Expand all
143 browser()->tab_strip_model()->ActivateTabAt(0, true); 135 browser()->tab_strip_model()->ActivateTabAt(0, true);
144 136
145 // Navigate main tab to hide print preview. 137 // Navigate main tab to hide print preview.
146 ui_test_utils::NavigateToURL(browser(), GURL("about:blank")); 138 ui_test_utils::NavigateToURL(browser(), GURL("about:blank"));
147 139
148 browser()->tab_strip_model()->ActivateTabAt(1, true); 140 browser()->tab_strip_model()->ActivateTabAt(1, true);
149 } 141 }
150 #endif // defined(OS_WIN) 142 #endif // defined(OS_WIN)
151 143
152 } // namespace 144 } // namespace
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/task_manager_view.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698