| 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/command_line.h" | |
| 6 #include "base/prefs/pref_service.h" | 5 #include "base/prefs/pref_service.h" |
| 7 #include "base/strings/utf_string_conversions.h" | 6 #include "base/strings/utf_string_conversions.h" |
| 8 #include "chrome/app/chrome_command_ids.h" | 7 #include "chrome/app/chrome_command_ids.h" |
| 9 #include "chrome/browser/content_settings/host_content_settings_map.h" | 8 #include "chrome/browser/content_settings/host_content_settings_map.h" |
| 10 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
| 11 #include "chrome/browser/task_manager/task_manager_browsertest_util.h" | 10 #include "chrome/browser/task_manager/task_manager_browsertest_util.h" |
| 12 #include "chrome/browser/ui/browser.h" | 11 #include "chrome/browser/ui/browser.h" |
| 13 #include "chrome/browser/ui/browser_commands.h" | 12 #include "chrome/browser/ui/browser_commands.h" |
| 14 #include "chrome/browser/ui/browser_dialogs.h" | 13 #include "chrome/browser/ui/browser_dialogs.h" |
| 15 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 14 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| 16 #include "chrome/common/chrome_switches.h" | |
| 17 #include "chrome/common/pref_names.h" | 15 #include "chrome/common/pref_names.h" |
| 18 #include "chrome/common/url_constants.h" | 16 #include "chrome/common/url_constants.h" |
| 19 #include "chrome/test/base/in_process_browser_test.h" | 17 #include "chrome/test/base/in_process_browser_test.h" |
| 20 #include "chrome/test/base/ui_test_utils.h" | 18 #include "chrome/test/base/ui_test_utils.h" |
| 21 #include "content/public/browser/web_contents.h" | 19 #include "content/public/browser/web_contents.h" |
| 22 #include "content/public/browser/web_contents_observer.h" | 20 #include "content/public/browser/web_contents_observer.h" |
| 23 #include "content/public/test/browser_test_utils.h" | 21 #include "content/public/test/browser_test_utils.h" |
| 24 #include "content/public/test/test_navigation_observer.h" | 22 #include "content/public/test/test_navigation_observer.h" |
| 25 #include "content/public/test/test_utils.h" | 23 #include "content/public/test/test_utils.h" |
| 26 | 24 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 39 // They must not have been running before since these bots didn't have the PDf | 37 // They must not have been running before since these bots didn't have the PDf |
| 40 // plugin. | 38 // plugin. |
| 41 #if !defined(ADDRESS_SANITIZER) | 39 #if !defined(ADDRESS_SANITIZER) |
| 42 | 40 |
| 43 namespace { | 41 namespace { |
| 44 | 42 |
| 45 class PrintPreviewTest : public InProcessBrowserTest { | 43 class PrintPreviewTest : public InProcessBrowserTest { |
| 46 public: | 44 public: |
| 47 PrintPreviewTest() {} | 45 PrintPreviewTest() {} |
| 48 | 46 |
| 49 #if !defined(GOOGLE_CHROME_BUILD) | |
| 50 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { | |
| 51 command_line->AppendSwitch(switches::kEnablePrintPreview); | |
| 52 } | |
| 53 #endif | |
| 54 | |
| 55 void Print() { | 47 void Print() { |
| 56 content::TestNavigationObserver nav_observer(NULL); | 48 content::TestNavigationObserver nav_observer(NULL); |
| 57 nav_observer.StartWatchingNewWebContents(); | 49 nav_observer.StartWatchingNewWebContents(); |
| 58 chrome::ExecuteCommand(browser(), IDC_PRINT); | 50 chrome::ExecuteCommand(browser(), IDC_PRINT); |
| 59 nav_observer.Wait(); | 51 nav_observer.Wait(); |
| 60 nav_observer.StopWatchingNewWebContents(); | 52 nav_observer.StopWatchingNewWebContents(); |
| 61 } | 53 } |
| 62 }; | 54 }; |
| 63 | 55 |
| 64 IN_PROC_BROWSER_TEST_F(PrintPreviewTest, PrintCommands) { | 56 IN_PROC_BROWSER_TEST_F(PrintPreviewTest, PrintCommands) { |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 207 // Navigate main tab to hide print preview. | 199 // Navigate main tab to hide print preview. |
| 208 ui_test_utils::NavigateToURL(browser(), GURL("about:blank")); | 200 ui_test_utils::NavigateToURL(browser(), GURL("about:blank")); |
| 209 | 201 |
| 210 browser()->tab_strip_model()->ActivateTabAt(1, true); | 202 browser()->tab_strip_model()->ActivateTabAt(1, true); |
| 211 } | 203 } |
| 212 #endif | 204 #endif |
| 213 | 205 |
| 214 } // namespace | 206 } // namespace |
| 215 | 207 |
| 216 #endif | 208 #endif |
| OLD | NEW |