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

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

Issue 3516010: Initial Print Preview UI. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: more renaming Created 10 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/dom_ui/print_preview_ui_uitest.cc
===================================================================
--- chrome/browser/dom_ui/print_preview_ui_uitest.cc (revision 0)
+++ chrome/browser/dom_ui/print_preview_ui_uitest.cc (revision 0)
@@ -0,0 +1,48 @@
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "app/l10n_util.h"
+#include "base/string16.h"
+#include "base/utf_string_conversions.h"
+#include "chrome/common/chrome_switches.h"
+#include "chrome/common/url_constants.h"
+#include "chrome/test/automation/browser_proxy.h"
+#include "chrome/test/automation/tab_proxy.h"
+#include "chrome/test/ui/ui_test.h"
+
+#include "grit/generated_resources.h"
+
+namespace {
+
+class PrintPreviewUITest : public UITest {
+ public:
+ PrintPreviewUITest() {
+ dom_automation_enabled_ = true;
+ // TODO(thestig): Remove when print preview is enabled by default.
+ launch_arguments_.AppendSwitch(switches::kEnablePrintPreview);
+ }
+
+ void AssertIsPrintPage(TabProxy* tab) {
+ std::wstring title;
+ ASSERT_TRUE(tab->GetTabTitle(&title));
+ string16 expected_title = l10n_util::GetStringUTF16(IDS_PRINTPREVIEW_TITLE);
+ ASSERT_EQ(expected_title, WideToUTF16Hack(title));
+ }
+};
+
+// TODO(thestig) Remove this test in the future if loading
+// chrome::kChromeUIPrintURL directly does not make sense.
+TEST_F(PrintPreviewUITest, LoadPrintPreviewByURL) {
+ scoped_refptr<BrowserProxy> browser(automation()->GetBrowserWindow(0));
+ ASSERT_TRUE(browser.get());
+
+ scoped_refptr<TabProxy> tab = browser->GetActiveTab();
+ ASSERT_TRUE(tab.get());
+
+ // Go to the print preview tab via URL.
+ NavigateToURL(GURL(chrome::kChromeUIPrintURL));
+ AssertIsPrintPage(tab);
+}
+
+} // namespace
Property changes on: chrome/browser/dom_ui/print_preview_ui_uitest.cc
___________________________________________________________________
Added: svn:eol-style
+ LF

Powered by Google App Engine
This is Rietveld 408576698