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

Unified Diff: chrome/browser/dom_ui/print_preview_ui_uitest.cc

Issue 5529004: Revert 68228 - Disable printing context menus on the print preview page.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 10 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/printing/print_preview_tab_controller.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/dom_ui/print_preview_ui_uitest.cc
===================================================================
--- chrome/browser/dom_ui/print_preview_ui_uitest.cc (revision 68243)
+++ chrome/browser/dom_ui/print_preview_ui_uitest.cc (working copy)
@@ -5,7 +5,6 @@
#include "app/l10n_util.h"
#include "base/string16.h"
#include "base/utf_string_conversions.h"
-#include "chrome/app/chrome_command_ids.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/url_constants.h"
#include "chrome/test/automation/browser_proxy.h"
@@ -25,14 +24,6 @@
}
void AssertIsPrintPage(TabProxy* tab) {
- // Wait for '#mainview' to become visible to make sure the document is
- // mostly loaded. Otherwise GetTabTitle() below is flaky.
- scoped_refptr<DOMElementProxy> dom(tab->GetDOMDocument());
- ASSERT_TRUE(dom.get());
- scoped_refptr<DOMElementProxy> mainview = dom->WaitFor1VisibleElement(
- DOMElementProxy::By::Selectors("#mainview"));
- ASSERT_TRUE(mainview.get());
-
std::wstring title;
ASSERT_TRUE(tab->GetTabTitle(&title));
string16 expected_title =
@@ -55,29 +46,4 @@
AssertIsPrintPage(tab);
}
-TEST_F(PrintPreviewUITest, PrintCommandDisabled) {
- scoped_refptr<BrowserProxy> browser(automation()->GetBrowserWindow(0));
- ASSERT_TRUE(browser.get());
-
- // Go to the about:blank page.
- NavigateToURL(GURL(chrome::kAboutBlankURL));
-
- // Make sure there is 1 tab and print is enabled. Create print preview tab.
- int tab_count;
- ASSERT_TRUE(browser->GetTabCount(&tab_count));
- ASSERT_EQ(1, tab_count);
- bool enabled;
- ASSERT_TRUE(browser->IsMenuCommandEnabled(IDC_PRINT, &enabled));
- ASSERT_TRUE(enabled);
- ASSERT_TRUE(browser->RunCommandAsync(IDC_PRINT));
-
- // Make sure there are 2 tabs and print is disabled.
- WaitUntilTabCount(2);
- scoped_refptr<TabProxy> tab = browser->GetActiveTab();
- ASSERT_TRUE(tab.get());
- AssertIsPrintPage(tab);
- ASSERT_TRUE(browser->IsMenuCommandEnabled(IDC_PRINT, &enabled));
- ASSERT_FALSE(enabled);
-}
-
} // namespace
« no previous file with comments | « no previous file | chrome/browser/printing/print_preview_tab_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698