Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(205)

Side by Side Diff: chrome/browser/ui/webui/print_preview_ui_uitest.cc

Issue 7721001: PrintPreview: Make ctrl-shift-p start the native print flow. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase + merge conflicts fix Created 9 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/string16.h" 5 #include "base/string16.h"
6 #include "base/utf_string_conversions.h" 6 #include "base/utf_string_conversions.h"
7 #include "chrome/app/chrome_command_ids.h" 7 #include "chrome/app/chrome_command_ids.h"
8 #include "chrome/common/chrome_switches.h" 8 #include "chrome/common/chrome_switches.h"
9 #include "chrome/common/url_constants.h" 9 #include "chrome/common/url_constants.h"
10 #include "chrome/test/automation/automation_proxy.h" 10 #include "chrome/test/automation/automation_proxy.h"
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 // Make sure there are 2 tabs and print is disabled. 65 // Make sure there are 2 tabs and print is disabled.
66 ASSERT_TRUE(browser->GetTabCount(&tab_count)); 66 ASSERT_TRUE(browser->GetTabCount(&tab_count));
67 ASSERT_EQ(2, tab_count); 67 ASSERT_EQ(2, tab_count);
68 scoped_refptr<TabProxy> tab = browser->GetActiveTab(); 68 scoped_refptr<TabProxy> tab = browser->GetActiveTab();
69 ASSERT_TRUE(tab.get()); 69 ASSERT_TRUE(tab.get());
70 AssertIsPrintPage(tab); 70 AssertIsPrintPage(tab);
71 ASSERT_TRUE(browser->IsMenuCommandEnabled(IDC_PRINT, &enabled)); 71 ASSERT_TRUE(browser->IsMenuCommandEnabled(IDC_PRINT, &enabled));
72 ASSERT_FALSE(enabled); 72 ASSERT_FALSE(enabled);
73 } 73 }
74 74
75 TEST_F(PrintPreviewUITest, AdvancedPrintCommandEnabled) {
76 scoped_refptr<BrowserProxy> browser(automation()->GetBrowserWindow(0));
77 ASSERT_TRUE(browser.get());
78
79 // Go to the about:blank page.
80 NavigateToURL(GURL(chrome::kAboutBlankURL));
81
82 // Make sure there is 1 tab and print is enabled. Create print preview tab.
83 int tab_count;
84 ASSERT_TRUE(browser->GetTabCount(&tab_count));
85 ASSERT_EQ(1, tab_count);
86 bool enabled;
87 ASSERT_TRUE(browser->IsMenuCommandEnabled(IDC_PRINT, &enabled));
88 ASSERT_TRUE(enabled);
89
90 // Make sure advanced print command (Ctrl+Shift+p) is enabled.
91 enabled = false;
92 ASSERT_TRUE(browser->IsMenuCommandEnabled(IDC_ADVANCED_PRINT, &enabled));
93 ASSERT_TRUE(enabled);
94
95 ASSERT_TRUE(browser->RunCommand(IDC_PRINT));
96
97 // Make sure there are 2 tabs and print is disabled.
98 ASSERT_TRUE(browser->GetTabCount(&tab_count));
99 ASSERT_EQ(2, tab_count);
100 scoped_refptr<TabProxy> tab = browser->GetActiveTab();
101 ASSERT_TRUE(tab.get());
102 AssertIsPrintPage(tab);
103 ASSERT_TRUE(browser->IsMenuCommandEnabled(IDC_PRINT, &enabled));
104 ASSERT_FALSE(enabled);
105
106 // Make sure advanced print command (Ctrl+Shift+p) is enabled on preview tab.
107 enabled = false;
108 ASSERT_TRUE(browser->IsMenuCommandEnabled(IDC_ADVANCED_PRINT, &enabled));
109 ASSERT_TRUE(enabled);
110 }
111
75 } // namespace 112 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698