Chromium Code Reviews| 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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 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) |
| 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 // ENABLE_BASIC_PRINTING && !OS_CHROMEOS |
|
Lei Zhang
2016/10/03 23:03:58
omit
skau
2016/10/03 23:32:13
Done.
| |
| 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 Loading... | |
| 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 |