| 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 // This is analagous to ENABLE_BASIC_PRINT_DIALOG but helps to verify |
| 61 // that it is defined as expected. |
| 60 bool is_basic_print_expected = true; | 62 bool is_basic_print_expected = true; |
| 61 #else | 63 #else |
| 62 bool is_basic_print_expected = false; | 64 bool is_basic_print_expected = false; |
| 63 #endif // ENABLE_BASIC_PRINTING | 65 #endif |
| 64 | 66 |
| 65 ASSERT_EQ(is_basic_print_expected, | 67 ASSERT_EQ(is_basic_print_expected, |
| 66 chrome::IsCommandEnabled(browser(), IDC_BASIC_PRINT)); | 68 chrome::IsCommandEnabled(browser(), IDC_BASIC_PRINT)); |
| 67 | 69 |
| 68 // Create the print preview dialog. | 70 // Create the print preview dialog. |
| 69 Print(); | 71 Print(); |
| 70 | 72 |
| 71 ASSERT_FALSE(chrome::IsCommandEnabled(browser(), IDC_PRINT)); | 73 ASSERT_FALSE(chrome::IsCommandEnabled(browser(), IDC_PRINT)); |
| 72 | 74 |
| 73 ASSERT_EQ(is_basic_print_expected, | 75 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); | 137 browser()->tab_strip_model()->ActivateTabAt(0, true); |
| 136 | 138 |
| 137 // Navigate main tab to hide print preview. | 139 // Navigate main tab to hide print preview. |
| 138 ui_test_utils::NavigateToURL(browser(), GURL("about:blank")); | 140 ui_test_utils::NavigateToURL(browser(), GURL("about:blank")); |
| 139 | 141 |
| 140 browser()->tab_strip_model()->ActivateTabAt(1, true); | 142 browser()->tab_strip_model()->ActivateTabAt(1, true); |
| 141 } | 143 } |
| 142 #endif // defined(OS_WIN) | 144 #endif // defined(OS_WIN) |
| 143 | 145 |
| 144 } // namespace | 146 } // namespace |
| OLD | NEW |