Index: chrome/browser/apps/app_browsertest.cc |
diff --git a/chrome/browser/apps/app_browsertest.cc b/chrome/browser/apps/app_browsertest.cc |
index d21586b5d2d5044da08423bf4d7498a538d924d3..9ddf53cd59b473bb544d8d49ce0160b9d168b907 100644 |
--- a/chrome/browser/apps/app_browsertest.cc |
+++ b/chrome/browser/apps/app_browsertest.cc |
@@ -31,6 +31,7 @@ |
#include "chrome/browser/ui/browser.h" |
#include "chrome/browser/ui/extensions/application_launch.h" |
#include "chrome/browser/ui/tabs/tab_strip_model.h" |
+#include "chrome/browser/ui/webui/print_preview/print_preview_ui.h" |
#include "chrome/common/chrome_switches.h" |
#include "chrome/common/extensions/api/app_runtime.h" |
#include "chrome/common/pref_names.h" |
@@ -1025,6 +1026,37 @@ IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest, MAYBE_WebContentsHasFocus) { |
GetRenderWidgetHostView()->HasFocus()); |
} |
+class PlatformAppPrintBrowserTest : public PlatformAppBrowserTest { |
+ public: |
+ PlatformAppPrintBrowserTest() {} |
+ |
+#if !defined(GOOGLE_CHROME_BUILD) |
Vitaly Buka (NO REVIEWS)
2013/08/28 01:20:26
ifdef could be removed
dharcourt
2013/08/28 23:23:57
Done.
|
+ // Ensures print tests use the print preview panel even for non-Chrome |
+ // Chromium builds (Chrome branded builds always use this panel). |
+ virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { |
+ command_line->AppendSwitch(switches::kEnablePrintPreview); |
+ PlatformAppBrowserTest::SetUpCommandLine(command_line); |
+ } |
+#endif |
+}; |
+ |
+// Currently this test doesn't work on OS X and only works if the PDF preview |
+// plug-in is available. This plug-in will only be available in Chrome release |
+// builds or if it has been manually copied from a Chrome release build. To run |
+// this test when the plug-in has been manually copied, manually comment out the |
+// GOOGLE_CHROME_BUILD part of the next line. |
+#if defined(OS_MACOSX) || !defined(GOOGLE_CHROME_BUILD) |
+#define MAYBE_WindowDotPrintWorks DISABLED_WindowDotPrintWorks |
+#else |
+#define MAYBE_WindowDotPrintWorks WindowDotPrintWorks |
+#endif |
+ |
+IN_PROC_BROWSER_TEST_F(PlatformAppPrintBrowserTest, MAYBE_WindowDotPrintWorks) { |
+ PrintPreviewUI::SetAutoCancelForTesting(true); |
+ ASSERT_TRUE(RunPlatformAppTest("platform_apps/print_api")) << message_; |
Vitaly Buka (NO REVIEWS)
2013/08/28 01:20:26
without auto close, where exactly tests timeouts?
dharcourt
2013/08/28 23:23:57
Inside RunPlatformAppTest, which never returns if
|
+ PrintPreviewUI::SetAutoCancelForTesting(false); |
Vitaly Buka (NO REVIEWS)
2013/08/28 01:20:26
Probably you can avoid static methods using if you
dharcourt
2013/08/28 23:23:57
Unfortunately I don't think I can use the same met
|
+} |
+ |
#if defined(OS_CHROMEOS) |