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" | 5 #include "base/command_line.h" |
Lei Zhang
2014/05/21 19:07:53
Ditto for command_line.h and chrome_switches.h.
jam
2014/05/21 19:31:06
Done.
| |
6 #include "base/prefs/pref_service.h" | 6 #include "base/prefs/pref_service.h" |
7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
8 #include "chrome/app/chrome_command_ids.h" | 8 #include "chrome/app/chrome_command_ids.h" |
9 #include "chrome/browser/content_settings/host_content_settings_map.h" | 9 #include "chrome/browser/content_settings/host_content_settings_map.h" |
10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
11 #include "chrome/browser/task_manager/task_manager_browsertest_util.h" | 11 #include "chrome/browser/task_manager/task_manager_browsertest_util.h" |
12 #include "chrome/browser/ui/browser.h" | 12 #include "chrome/browser/ui/browser.h" |
13 #include "chrome/browser/ui/browser_commands.h" | 13 #include "chrome/browser/ui/browser_commands.h" |
14 #include "chrome/browser/ui/browser_dialogs.h" | 14 #include "chrome/browser/ui/browser_dialogs.h" |
15 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 15 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
(...skipping 23 matching lines...) Expand all Loading... | |
39 // They must not have been running before since these bots didn't have the PDf | 39 // They must not have been running before since these bots didn't have the PDf |
40 // plugin. | 40 // plugin. |
41 #if !defined(ADDRESS_SANITIZER) | 41 #if !defined(ADDRESS_SANITIZER) |
42 | 42 |
43 namespace { | 43 namespace { |
44 | 44 |
45 class PrintPreviewTest : public InProcessBrowserTest { | 45 class PrintPreviewTest : public InProcessBrowserTest { |
46 public: | 46 public: |
47 PrintPreviewTest() {} | 47 PrintPreviewTest() {} |
48 | 48 |
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() { | 49 void Print() { |
56 content::TestNavigationObserver nav_observer(NULL); | 50 content::TestNavigationObserver nav_observer(NULL); |
57 nav_observer.StartWatchingNewWebContents(); | 51 nav_observer.StartWatchingNewWebContents(); |
58 chrome::ExecuteCommand(browser(), IDC_PRINT); | 52 chrome::ExecuteCommand(browser(), IDC_PRINT); |
59 nav_observer.Wait(); | 53 nav_observer.Wait(); |
60 nav_observer.StopWatchingNewWebContents(); | 54 nav_observer.StopWatchingNewWebContents(); |
61 } | 55 } |
62 }; | 56 }; |
63 | 57 |
64 IN_PROC_BROWSER_TEST_F(PrintPreviewTest, PrintCommands) { | 58 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. | 201 // Navigate main tab to hide print preview. |
208 ui_test_utils::NavigateToURL(browser(), GURL("about:blank")); | 202 ui_test_utils::NavigateToURL(browser(), GURL("about:blank")); |
209 | 203 |
210 browser()->tab_strip_model()->ActivateTabAt(1, true); | 204 browser()->tab_strip_model()->ActivateTabAt(1, true); |
211 } | 205 } |
212 #endif | 206 #endif |
213 | 207 |
214 } // namespace | 208 } // namespace |
215 | 209 |
216 #endif | 210 #endif |
OLD | NEW |