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" |
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/ui/browser.h" | 11 #include "chrome/browser/ui/browser.h" |
12 #include "chrome/browser/ui/browser_commands.h" | 12 #include "chrome/browser/ui/browser_commands.h" |
13 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 13 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
14 #include "chrome/common/chrome_switches.h" | 14 #include "chrome/common/chrome_switches.h" |
15 #include "chrome/common/pref_names.h" | 15 #include "chrome/common/pref_names.h" |
16 #include "chrome/common/url_constants.h" | 16 #include "chrome/common/url_constants.h" |
17 #include "chrome/test/base/in_process_browser_test.h" | 17 #include "chrome/test/base/in_process_browser_test.h" |
18 #include "chrome/test/base/ui_test_utils.h" | 18 #include "chrome/test/base/ui_test_utils.h" |
19 #include "content/public/browser/web_contents.h" | 19 #include "content/public/browser/web_contents.h" |
20 #include "content/public/browser/web_contents_observer.h" | 20 #include "content/public/browser/web_contents_observer.h" |
21 #include "content/public/test/browser_test_utils.h" | 21 #include "content/public/test/browser_test_utils.h" |
22 #include "content/public/test/test_navigation_observer.h" | 22 #include "content/public/test/test_navigation_observer.h" |
23 #include "content/public/test/test_utils.h" | 23 #include "content/public/test/test_utils.h" |
24 | 24 |
25 #if defined(OS_WIN) && defined(USE_AURA) | 25 #if defined(OS_WIN) |
26 #include "content/public/browser/web_contents_view.h" | 26 #include "content/public/browser/web_contents_view.h" |
27 #include "ui/aura/root_window.h" | 27 #include "ui/aura/root_window.h" |
28 #include "ui/aura/window.h" | 28 #include "ui/aura/window.h" |
29 #endif | 29 #endif |
30 | 30 |
31 namespace { | 31 namespace { |
32 | 32 |
33 class PrintPreviewTest : public InProcessBrowserTest { | 33 class PrintPreviewTest : public InProcessBrowserTest { |
34 public: | 34 public: |
35 PrintPreviewTest() {} | 35 PrintPreviewTest() {} |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 browser()->tab_strip_model()->GetActiveWebContents()); | 72 browser()->tab_strip_model()->GetActiveWebContents()); |
73 chrome::Reload(browser(), CURRENT_TAB); | 73 chrome::Reload(browser(), CURRENT_TAB); |
74 reload_observer.Wait(); | 74 reload_observer.Wait(); |
75 | 75 |
76 ASSERT_TRUE(chrome::IsCommandEnabled(browser(), IDC_PRINT)); | 76 ASSERT_TRUE(chrome::IsCommandEnabled(browser(), IDC_PRINT)); |
77 | 77 |
78 // Make sure advanced print command (Ctrl+Shift+p) is enabled. | 78 // Make sure advanced print command (Ctrl+Shift+p) is enabled. |
79 ASSERT_TRUE(chrome::IsCommandEnabled(browser(), IDC_ADVANCED_PRINT)); | 79 ASSERT_TRUE(chrome::IsCommandEnabled(browser(), IDC_ADVANCED_PRINT)); |
80 } | 80 } |
81 | 81 |
82 #if defined(OS_WIN) && defined(USE_AURA) | 82 #if defined(OS_WIN) |
83 | 83 |
84 BOOL CALLBACK EnumerateChildren(HWND hwnd, LPARAM l_param) { | 84 BOOL CALLBACK EnumerateChildren(HWND hwnd, LPARAM l_param) { |
85 HWND* child = reinterpret_cast<HWND*>(l_param); | 85 HWND* child = reinterpret_cast<HWND*>(l_param); |
86 *child = hwnd; | 86 *child = hwnd; |
87 // The first child window is the plugin, then its children. So stop | 87 // The first child window is the plugin, then its children. So stop |
88 // enumerating after the first callback. | 88 // enumerating after the first callback. |
89 return FALSE; | 89 return FALSE; |
90 } | 90 } |
91 | 91 |
92 // This test verifies that constrained windows aren't covered by windowed NPAPI | 92 // This test verifies that constrained windows aren't covered by windowed NPAPI |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 browser()->tab_strip_model()->ActivateTabAt(0, true); | 153 browser()->tab_strip_model()->ActivateTabAt(0, true); |
154 | 154 |
155 // Navigate main tab to hide print preview. | 155 // Navigate main tab to hide print preview. |
156 ui_test_utils::NavigateToURL(browser(), GURL("about:blank")); | 156 ui_test_utils::NavigateToURL(browser(), GURL("about:blank")); |
157 | 157 |
158 browser()->tab_strip_model()->ActivateTabAt(1, true); | 158 browser()->tab_strip_model()->ActivateTabAt(1, true); |
159 } | 159 } |
160 #endif | 160 #endif |
161 | 161 |
162 } // namespace | 162 } // namespace |
OLD | NEW |