| 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/content_settings/host_content_settings_map.h" | 8 #include "chrome/browser/content_settings/host_content_settings_map.h" |
| 9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
| 10 #include "chrome/browser/task_manager/task_manager_browsertest_util.h" | 10 #include "chrome/browser/task_manager/task_manager_browsertest_util.h" |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 | 41 |
| 42 void Print() { | 42 void Print() { |
| 43 content::TestNavigationObserver nav_observer(NULL); | 43 content::TestNavigationObserver nav_observer(NULL); |
| 44 nav_observer.StartWatchingNewWebContents(); | 44 nav_observer.StartWatchingNewWebContents(); |
| 45 chrome::ExecuteCommand(browser(), IDC_PRINT); | 45 chrome::ExecuteCommand(browser(), IDC_PRINT); |
| 46 nav_observer.Wait(); | 46 nav_observer.Wait(); |
| 47 nav_observer.StopWatchingNewWebContents(); | 47 nav_observer.StopWatchingNewWebContents(); |
| 48 } | 48 } |
| 49 }; | 49 }; |
| 50 | 50 |
| 51 // The two tests below are failing on Linux LSAN | |
| 52 // crbug.com/382523 | |
| 53 #if !defined(ADDRESS_SANITIZER) | |
| 54 | |
| 55 IN_PROC_BROWSER_TEST_F(PrintPreviewTest, PrintCommands) { | 51 IN_PROC_BROWSER_TEST_F(PrintPreviewTest, PrintCommands) { |
| 56 // We start off at about:blank page. | 52 // We start off at about:blank page. |
| 57 // Make sure there is 1 tab and print is enabled. | 53 // Make sure there is 1 tab and print is enabled. |
| 58 ASSERT_EQ(1, browser()->tab_strip_model()->count()); | 54 ASSERT_EQ(1, browser()->tab_strip_model()->count()); |
| 59 | 55 |
| 60 ASSERT_TRUE(chrome::IsCommandEnabled(browser(), IDC_PRINT)); | 56 ASSERT_TRUE(chrome::IsCommandEnabled(browser(), IDC_PRINT)); |
| 61 | 57 |
| 62 // Make sure advanced print command (Ctrl+Shift+p) is enabled. | 58 // Make sure advanced print command (Ctrl+Shift+p) is enabled. |
| 63 ASSERT_TRUE(chrome::IsCommandEnabled(browser(), IDC_ADVANCED_PRINT)); | 59 ASSERT_TRUE(chrome::IsCommandEnabled(browser(), IDC_ADVANCED_PRINT)); |
| 64 | 60 |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 | 93 |
| 98 // Create the print preview dialog. | 94 // Create the print preview dialog. |
| 99 Print(); | 95 Print(); |
| 100 | 96 |
| 101 ASSERT_NO_FATAL_FAILURE(WaitForTaskManagerRows(1, MatchAboutBlankTab())); | 97 ASSERT_NO_FATAL_FAILURE(WaitForTaskManagerRows(1, MatchAboutBlankTab())); |
| 102 ASSERT_NO_FATAL_FAILURE(WaitForTaskManagerRows(1, MatchAnyTab())); | 98 ASSERT_NO_FATAL_FAILURE(WaitForTaskManagerRows(1, MatchAnyTab())); |
| 103 ASSERT_NO_FATAL_FAILURE(WaitForTaskManagerRows(1, MatchAnyPrint())); | 99 ASSERT_NO_FATAL_FAILURE(WaitForTaskManagerRows(1, MatchAnyPrint())); |
| 104 ASSERT_NO_FATAL_FAILURE(WaitForTaskManagerRows(1, MatchPrint("about:blank"))); | 100 ASSERT_NO_FATAL_FAILURE(WaitForTaskManagerRows(1, MatchPrint("about:blank"))); |
| 105 } | 101 } |
| 106 | 102 |
| 107 #endif | |
| 108 | |
| 109 // Disable the test for mac as it started being flaky, see http://crbug/367665. | 103 // Disable the test for mac as it started being flaky, see http://crbug/367665. |
| 110 #if defined(OS_MACOSX) && !defined(OS_IOS) | 104 #if defined(OS_MACOSX) && !defined(OS_IOS) |
| 111 #define MAYBE_TaskManagerExistingPrintPreview DISABLED_TaskManagerExistingPrintP
review | 105 #define MAYBE_TaskManagerExistingPrintPreview DISABLED_TaskManagerExistingPrintP
review |
| 112 #else | 106 #else |
| 113 #define MAYBE_TaskManagerExistingPrintPreview TaskManagerExistingPrintPreview | 107 #define MAYBE_TaskManagerExistingPrintPreview TaskManagerExistingPrintPreview |
| 114 #endif | 108 #endif |
| 115 IN_PROC_BROWSER_TEST_F(PrintPreviewTest, | 109 IN_PROC_BROWSER_TEST_F(PrintPreviewTest, |
| 116 MAYBE_TaskManagerExistingPrintPreview) { | 110 MAYBE_TaskManagerExistingPrintPreview) { |
| 117 // Create the print preview dialog. | 111 // Create the print preview dialog. |
| 118 Print(); | 112 Print(); |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 browser()->tab_strip_model()->ActivateTabAt(0, true); | 192 browser()->tab_strip_model()->ActivateTabAt(0, true); |
| 199 | 193 |
| 200 // Navigate main tab to hide print preview. | 194 // Navigate main tab to hide print preview. |
| 201 ui_test_utils::NavigateToURL(browser(), GURL("about:blank")); | 195 ui_test_utils::NavigateToURL(browser(), GURL("about:blank")); |
| 202 | 196 |
| 203 browser()->tab_strip_model()->ActivateTabAt(1, true); | 197 browser()->tab_strip_model()->ActivateTabAt(1, true); |
| 204 } | 198 } |
| 205 #endif | 199 #endif |
| 206 | 200 |
| 207 } // namespace | 201 } // namespace |
| OLD | NEW |