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

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

Issue 2376193006: Disable Ctrl+Shift+P on Chrome OS (Closed)
Patch Set: fix for buildflag Created 4 years, 2 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
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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 } 49 }
50 }; 50 };
51 51
52 IN_PROC_BROWSER_TEST_F(PrintPreviewTest, PrintCommands) { 52 IN_PROC_BROWSER_TEST_F(PrintPreviewTest, PrintCommands) {
53 // We start off at about:blank page. 53 // We start off at about:blank page.
54 // Make sure there is 1 tab and print is enabled. 54 // Make sure there is 1 tab and print is enabled.
55 ASSERT_EQ(1, browser()->tab_strip_model()->count()); 55 ASSERT_EQ(1, browser()->tab_strip_model()->count());
56 56
57 ASSERT_TRUE(chrome::IsCommandEnabled(browser(), IDC_PRINT)); 57 ASSERT_TRUE(chrome::IsCommandEnabled(browser(), IDC_PRINT));
58 58
59 #if defined(ENABLE_BASIC_PRINTING) 59 #if defined(ENABLE_BASIC_PRINTING) && !defined(OS_CHROMEOS)
Lei Zhang 2016/10/04 22:10:54 Can you add a comment to explain why this is not E
skau 2016/10/05 00:18:00 Done.
60 bool is_basic_print_expected = true; 60 bool is_basic_print_expected = true;
61 #else 61 #else
62 bool is_basic_print_expected = false; 62 bool is_basic_print_expected = false;
63 #endif // ENABLE_BASIC_PRINTING 63 #endif
64 64
65 ASSERT_EQ(is_basic_print_expected, 65 ASSERT_EQ(is_basic_print_expected,
66 chrome::IsCommandEnabled(browser(), IDC_BASIC_PRINT)); 66 chrome::IsCommandEnabled(browser(), IDC_BASIC_PRINT));
67 67
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,
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698